24
votes

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?

1

1 Answers

31
votes

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.