

You can do this by logging into your account at : Adding the App Group to your App IdentifierĪfter that, you can update your persistent store description. Note that the App Group is turned into red when you didn’t add it to your App Identifier yet. This will eventually result in the following overview of app groups for your project: An overview of the app groups for your project We can do this by adding an app group capability within your projects “Signing & Capabilities” section: Adding an app group to your project for Core Data sharing To share data we need to create a shared container between the main app and its extensions. Setting up the Persistent Container for data sharing Luckily enough, Apple made it easy to share a persistent container with your extensions.


The app extension and containing app have no direct access to each other’s container, even though an app extension bundle is nested within its containing app’s bundle. Within the Collect App, we have a Share extension and an Action extension that both require the use of the same underlying persistent container. Sharing your Core Data database with your Today extension, Action extension or Share extension is something quite common if you’re using Core Data as your database solution. You can read more about it in my blog post Persistent History Tracking in Core Data. Starting from iOS 13 I recommend Persistent History Tracking as a solution to sharing a single database. Sharing the same Core Data persistent container with App Extensions Use Emerge’s advanced app optimization and monitoring tools and start optimizing your apps. Emerge Blog - Written by App Performance Experts Why are Swift reference types bad for app startup time, and what’s the performance cost of protocol conformances? Articles written based on experience of working at companies like Apple, Airbnb, Snap, and Spotify.
