New Possibilities with WatchKit

The Apple Watch will be released to Apple fans soon, so it’s a good time to take a quick overview of this new smartwatch.

First, it’s worth it to know that Apple Watch will not have its dedicated standalone applications. WatchKit apps will be only extensions to iPhone applications installed on iPhone. A quick overview of this architecture is presented below.

WatchKit extension architecture

Programming Language – you can build apps for the Apple Watch both in Objective-C and Swift, or use a bridge to combine code written in 2 languages.

Sample apps – Apple provided developers 2 sample apps

Official documentationWatchKit Framework Reference

Device support – One Apple Watch may be paired with only one iPhone. Unfortunately, it will not work with the iPad at this time.

Communication – The WatchKit extension may wake up the iPhone app, but the iPhone app cannot wake up its extension installed on the Apple Watch.

Notifications – There are 2 types of available notifications in WatchKit:

  • Short-Look – Similar to the notifications from the iPhone, the system uses a template to display the app name and icon along with the title string stored in the local notification or remote notification payload. This notification cannot be customized by the developer and is not scrollable. The image below presents the layout of the short-look notification:

  • Long-Look – This type of notification is scrollable and may be customized. However, the interface of this notification is separated into three areas and strictly described by Apple:
    • sash – top view, which contains app icon and name
    • content area – area which may be fully customized by developer
    • bottom area – contains Dismiss button

A sample look of the long-look notification structure is below:

Customization – WatchKit doesn’t allow developers to customize its interface elements. Moreover, views cannot be created and added dynamically, only static views, defined in Storyboard may be shown/hidden. At this time, the list of available interface elements is pretty short: WKInterfaceLabel, WKInterfaceButton, WKInterfaceImage, WKInterfaceGroup, WKInterfaceSeparator, WKInterfaceTable, WKInterfaceSwitch, WKInterfaceMap, WKInterfaceSlider and WKInterfaceTimer.

Animations – WatchKit supports animations, but the only way to present them is to have a set of previously prepared images (frames) and show them sequentially. A workaround for this restriction may be found using Core Graphics. You can use one image and modify it in order to get further frames of animation. Each frame has to be saved in memory as an image, then you will be allowed to present sequences of generated images as an animation. The animations reference is available here

Interaction Limits – At this time, the developer may only use native interface elements to interact with the Apple Watch user. Gesture recognizers are not available yet.

This basic information about the Apple Watch and WatchKit should allow you to see how this hardware will work, the type of restrictions it will have, and how you might use it in the near future.

New Possibilities with WatchKit

Leave a Reply

Your email address will not be published. Required fields are marked *