Problem:
Since app extensions run as part of a host application rather than as part of their containing app (i.e. your app’s extensions run in somebody else’s app), data sharing isn’t automatic.
Solution:
The preferred way is to track changes (History Tracking) in the app's entities and update into widget's entities.
Refer: https://developer.apple.com/documentation/coredata/consuming_relevant_store_changes
Approach:
1.0 - Create App Groups
2.1 - Create separete app entities and widget entities
2.2 - Create separate configurations for app entities and widget entities
2.3 - Assign them configuration to their entities
3.0 - Use app group while creating and loading the container
4.0 - Use history tracking to track changes from the app's entities and update into widget's entites.
Topic:
App & System Services
SubTopic:
General
Tags: