Posts

Post marked as solved
1 Replies
When you use resources from a localised framework, make sure to use methods with the bundle: parameter! Even in the framework itself. Instead of using String(localized: "some String") use String(localized: "some String", bundle: Bundle.module). Same goes for Color, NSDataAsset and so on. This fixed my issue.
Post not yet marked as solved
2 Replies
It’s hard to tell from your screenshots but I think you need to add the frameworks to the target. Under General > Frameworks, Libraries and Embedded Content hit the + Button and add the frameworks.
Post not yet marked as solved
2 Replies
I haven't tried this out but I think it should work something like that: Create in your parent view the new context. let container = try! ModelContainer(for: Model.self, ModelConfiguration(inMemory: true)) // or whatever works for you let localContext = ModelContext(container) Then attach the localContext to a child view. yourView .modelContext(localContext) In the child view you should have access to it via the environment. @Environment(\.modelContext) var modelContext If you want to use the same container like your original context, try originalContext.container and use that in step 1. @Query in the child view will work on the given model context. At least this is my theory. I don’t have time to check it, but maybe it helps you anyways.