Post

Replies

Boosts

Views

Activity

View with @FetchRequest doesn't update when items added/removed from another device
I thought that if a View had @FetchRequest(…) private var items: FetchedResultsItem and the body contained } that that would be enough for insertions and deletions to update the view automatically. Is there more that I need to do? Context I created a cross-platform app using the "App" template in Xcode 12.4 this morning. The template creates a model with an Item entity, and a main view that renders a list of all items and their creation timestamps. In both iOS and macOS targets, I enabled CloudKit, created a container, and enabled background notifications. Then I confirmed that if I opened the app from my phone, I could see items created on my Mac, and vice versa. However, neither device shows changes (insertions or deletions) made on the other device until the app is restarted.
2
0
692
Apr ’21