

Enabling this capability is necessary in order to allow for all sorts of sharing of sandbox data and other IPC. App Groups are added to iOS targets by declaring the capability in the target’s entitlements section.
#SWIFT SHARE CORE DATA WITH EXTENSION HOW TO#
We’ll talk about how to do this more below.Īpple provides an excellent overview of the architecture and lifecycle here:Īpp Groups are a concept that allows apps access to shared data sandbox data containers and allow for forms of interprocess communication. However, sandbox resources can still be shared, using App Groups, and a form of interprocess communication (IPC) can be achieved using Darwin notifications. This extension runs as a different process than your iOS app within iOS.This Extension is bundled as part of the containing iOS app. The second is the WatchKit Extension Target that is created. The interface for Glances, notifications and the App reside in the same storyboard file. This is the bundle that gets copied to the Watch itself and consists primarily of the Storyboard files that make up the App UI, as well as additional resources such as images and fonts. The first is the “Apple Watch App” bundle. If you are creating an Apple Watch app today, it’s going to consist of a couple of different parts:

The strategies and methods discussed here will work just as well for other types of extensions as well, such as the Today Extensions, or Share Extensions. Since there is no such thing as a standalone Apple Watch App (for now), one of the hurdles that developers will encounter is how to share information between the Extension and the containing iOS App. These are not truly native apps yet, as all the code driving the app will run on the iPhone that the Apple Watch is paired with. Taking advantage of custom notification types that were introduced in iOS 8, these apps can also customize how the expanded, or long-look form of a notification will look on the Apple Watch.They conform to a set of templates and are used to show information that the user will find most relevant and convenient.
#SWIFT SHARE CORE DATA WITH EXTENSION FULL#
