

Let storeDescription = NSPersistentStoreDescription(url: storeURL) Let storeURL = URL.storeURL(for: "", databaseName: "Coyote") let persistentContainer = NSPersistentContainer(name: "Collect") You basically save your database into the shared App Container.
#Swift share extension open app update#
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. Action extensions appear within the activity view controller which is the panel that appears when the user taps the Share button within a running application. Setting up the Persistent Container for data sharing We do not need a UI so delete MainInterface.storyboard and. Make sure you link it to the main app and not your Pods for example. Luckily enough, Apple made it easy to share a persistent container with your extensions. Go to File -> New -> Target and select Share Extension. 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 Building a iOS 10.3 Share Extension with Swift 3.1 demonstrates sharing a photo from the photo album to your apps. kandi ratings - Low support, No Bugs, No Vulnerabilities.
#Swift share extension open app code#
FREE iOS Architect Crash Course for a limited time! If you’re a mid/senior iOS developer who’s looking to improve both your skills and salary level, then join this 100% free online crash course (available only until September 25th!). Implement deegeu-swift-share-extensions with how-to, Q&A, fixes, code snippets.
