Post

Replies

Boosts

Views

Activity

Reply to Disable automatic iCloud sync with SwiftData
Has anyone tried with the latest iOS 17.2 beta? At first glance it's fixed as of iOS 17.2 beta 2, at least it does not crash any more with non-optional properties as it does on iOS 17.1 and below. I also don't see any attempts to sync in the console. So it seems like I can finally start bringing my app to SwiftData.
Replies
Boosts
Views
Activity
Nov ’23
Reply to SwiftData: Is syncing changes across ModelContext’s working in Beta 1?
A context will save automatically periodically and on certain system events like didEnterBackground. If you want to save in the moment, you need to call context.save(). It might be possible that the autosave feature is buggy in Seed 1. The UI should update even if you don't manually save though.
Replies
Boosts
Views
Activity
Jun ’23
Reply to How to use a child context in SwiftData?
An engineer answered this in the WWDC Slack. SwiftData does currently not support child contexts. A way around this would be to use a custom context, do the edits there and then apply them back to the mainContext and save it.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’23