Dive deeper into SwiftData

RSS for tag

Discuss the WWDC23 Session Dive deeper into SwiftData

View Session

Posts under wwdc2023-10196 tag

23 Posts
Sort by:
Post not yet marked as solved
4 Replies
2.3k Views
If I make model changes in the mainContext using a batch operation like context.update OR on a background thread ModelContext ModelContext(container), my saved changes are not automatically reflected in the UI (a List of models). Also ModelContext.willSave and ModelContext.didSave don't seem to get called. Will automatic UI updates work in an upcoming Beta but are NOT in Beta 1? Or will we refresh View/@Query based on a ModelContext.didSavenotification? Or should this be working in Beta 1 and I am missing how it works?
Posted
by
Post marked as solved
5 Replies
3.5k Views
I did manage to save my Entities to CloudKit with SwiftData but the default database is the private database. I need to store some Entities in the private and other Entities in the public CloudKit database. How do I manage that with SwiftData? With CoreData I always used different configurations for both private and public and added the entities to one or the other.
Posted
by