Posts

Post not yet marked as solved
1 Replies
742 Views
I am trying to create a document-based (macOS) app using SwiftUI and SwiftData. I'm trying to set up XCTests to validate my model behaviors. Clearly, I need to set up a container in my test class for my model objects. Failing to do so shows that SwiftData is trying: my app launches into the New Document dialog; if I dismiss it, the app fails with a "failed to find an active container" for my model object. Any pointer on setting up a container and context within XCTest is welcome. TIA
Posted
by DougK.
Last updated
.
Post not yet marked as solved
2 Replies
501 Views
Working through the SwiftUI tutorial, I reached the "Composing Complex Interfaces" section and downloaded the project files.On opening the "Starting Point" project, the first task is to create a new SwiftUI view named "Home.swift". If you activate the Preview for the unmodified new view, the Preview pane displays an error message whicj says that building "Home.swift" fails. Preview works for other views in the project, but not this one.I tried opening the "completed" project, and the same problem occurs for "Home.swift" in that project.I've tried cleaning the build, restarting Xcode, even restarting Catalina, and still can't get this to work.Anyone seen something similar, or can you suggest a workaround?TIA,Doug K
Posted
by DougK.
Last updated
.