Post

Replies

Boosts

Views

Activity

CKSyncEngine with SwiftData
I have been working on a toy app to learn CKSyncEngine. I'm using SwiftData as local storage with Cloudkit disabled, and use the CKSyncEngine to handle everything with full control. I've gotten everything to work except for one thing! Updating the UI from the SyncEngine. I have tested this outside the syncEngine and using @ModelActor and performing changes in a detached Task in the background updates the UI perfectly. However, I've made my class conforming to the engine a model-actor but it does not update the UI when I save from the actor's ctx. If I go back to a view in the navigation and return the data is updated, but not when it is modified. I'm at my wit's end and I think it must be the way CKSyncEngine updates are triggered in the background. Any suggestions to the possible root cause?
0
1
330
Jan ’24