Closed Mr-ZNN closed 3 years ago
Sharing data with a widget extension is out of the scope of what SyncKit does. It is something you need to design yourself in your app, but generally you will want to create an app group and store your data in the app group container, or even better you would keep the main store in your app, and create a dedicated store in the app group just to share a smaller subset of the data with the widget extension.
https://useyourloaf.com/blog/sharing-data-with-a-widget/
https://michael-kiley.medium.com/sharing-object-data-between-an-ios-app-and-its-widget-a0a1af499c31
In the app target, I can use the following code to get the received shared data.
So how to get it in the widget?