I'm trying to create an iOS WatchOS5 complication and am seeing a number of tutorials and apple documentation. They talk about:
What is the difference between iOS WatchKit App and WatchKit App Extension?
If I want to share data between my phone app and my watch app, do I need both in order to use Watch Connectivity framework?
Overview. The WatchKit framework provides infrastructure for creating watchOS apps, including an extension delegate that manages background tasks, extended runtime sessions, and Siri intents. The framework also performs other support tasks, such as accessing information about the user's Apple Watch.
Xcode adds groups and files for the watchOS app to your project, along with the schemes needed to build and run the app. Choose File > New > Target. When the template sheet appears, choose the watchOS tab, select the Watch App for iOS App template and click Next.
watchOS is the operating system of the Apple Watch, developed by Apple Inc. It is based on iOS, the operating system used by the iPhone and iPod Touch, and has many similar features. It was released on April 24, 2015, along with the Apple Watch, the only device that runs watchOS.
The two come hand-in-hand, both are needed to create a watchOS application and you cannot use one without the other.
The main difference is that a WatchKit App is responsible for displaying the UI, so this is where you store the storyboard(s) and all assets (images, etc) used from storyboards. On the other hand, your WatchKit App Extension is responsible for everything done programatically, so this is where all your interface controllers and other classes should reside. You should also store all assets that you access from code in your App Extension target.
You'll need to use the WatchConnectivity
framework from code as part of your App Extension target, however, as already stated, all watchOS applications need to have a WatchKit App target as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With