Hi,
I am looking for information on how to setup a ModelContainer
for a Swift app when the SwiftData model is located in a Swift package.
Let's say the model code resides in a package called DomainModel. That package was added target's embedded content and the model types are used to init the model container using the modelContainer(for:)
view modifier on the ContentView
of the app.
This crashes the app on startup with a EXC_BAD_ACCESS code=2. When copying the model code from the package directly into the app, the app starts just fine.
I kindly ask for a code sample or any information about how to setup the model container when using a model from a Swift package.
Thanks in advance and I am looking forward to replacing CoreData 🙂