Chapter 2. WatchKit Apps
Put simply, a WatchKit app is an app that runs on the watch. Apps on watchOS are separate and independent binaries that run on the watch, and communicate with their parent iOS app only when they have to. This reduces latency, and ensures that the power-hungry Bluetooth radio is used as infrequently as possible.
From the userâs perspective, apps on the watch are very similar to apps on the phone: they present information to the user, and respond to taps and other input. However, while the watch is an independent computer, itâs incredibly underpowered compared to the iPhone. You canât do heavy processing on the watchâif you need to do hard work, you get in touch with the iPhone in the userâs pocket. Additionally, certain hardware isnât best suited to being directly in contact with the userâs skin at all times (for example, cellular radios), due to the fact that they emit larger amounts of energy.
Itâs for this reason that the Apple Watch requires the user to have an iPhone: without an iPhone providing information to the watch, the watchâs utility is limited.
When youâre developing an app for the Apple Watch, youâll end up building the iOS app and the watchOS app separately. These are two different targets in Xcode, but can belong to the same project. Any code or resource that needs to run on both devices needs to be added to both of the targets.
Displaying Content on the Watch
Once you have an empty WatchKit app, the next step is to ...
Get Swift Development for the Apple Watch now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.