Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS WatchOS - what is the difference between WatchKit App and WatchKit App extension?

Tags:

I'm trying to create an iOS WatchOS5 complication and am seeing a number of tutorials and apple documentation. They talk about:

  • WatchKit App
  • WatchKit App extension

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?

like image 954
Alex Stone Avatar asked Oct 07 '18 11:10

Alex Stone


People also ask

What is WatchKit app?

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.

How do I use Xcode on 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.

Is watchOS the same as iOS?

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.


1 Answers

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.

like image 155
Dávid Pásztor Avatar answered Sep 28 '22 07:09

Dávid Pásztor