Initial Look At The Secrets of the iWatch SDK

The release of the iWatch SDK has given developers a head start in adding WatchKit to their applications, but with the release of the iWatch Simulator, they’ve also given developers a valuable insight into how the iWatch API stack is shaped. The WatchKit framework runs on the iOS device, but to power the simulator Apple has also added many of the device side frameworks. With a little elbow grease, we can learn a lot about the iWatch’s software stack.

To start digging into the frameworks that live on the watch itself, we can navigate within the Xcode beta package to:

Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks

 

You’ll find all the existing iPhone private frameworks, with some new additions in iOS 8.2.

  • BridgePreferences.framework
  • BulletinDistributorCompanion.framework
  • CompanionFindMy.framework
  • CompanionSync.framework
  • FitnessUI.framework
  • HealthDaemonExtensions.framework
  • HealthKitExtensions.framework
  • HelpKit.framework
  • NanoAppRegistry.framework
  • NanoBackup.framework
  • NanoGlanceSettings.framework
  • NanoLeash.framework
  • NanoMailKitServer.framework
  • NanoMusicSync.framework
  • NanoPreferencesSync.framework
  • NanoRegistry.framework
  • NanoResourceGrabber.framework
  • NanoSetupUISupport.framework
  • NanoSystemSettings.framework
  • NanoTimeKitCompanion.framework
  • PBBridgeSupport.framework
  • PairedSync.framework
  • PairedUnlock.framework
  • PepperUICore.framework
  • SiriUICore.framework
  • SockPuppetCrossPlatform.framework
  • SockPuppetGizmo.framework
  • BridgeUsageBundle.bundle

Not all of these frameworks seem to necessarily be iWatch related. Some look like they could be new frameworks for the iPhone, but there are definitely some here that are meant for the iWatch. While these frameworks could be special frameworks specifically for the simulator, they don’t seem to be. Some of these frameworks are for features that don’t make sense for the simulator, but would for shipping hardware. So we can be reasonably sure that some of these frameworks are the actual frameworks that ship on device.

The iWatch UI

The most interesting thing to me that I wanted to look at was what the iWatch used for a UI framework. WatchKit relays information to the watch, but I wanted to know more about the actual framework on the device. PepperUICore.framework seems to be the UIKit equivalent on the iWatch.

Screen Shot 2014 11 18 at 8 03 03 PM

A bunch of iWatch UI related images? Looks like the right place. Dissecting this framework starts to form a more clear picture of how Apple is writing the iWatch software itself. Let’s get out your favorite reverse engineering tools. And one of the first things you might notice.

The iWatch Framework Stack is Written In Obj-C

There has been speculation that the iWatch would be a major Swift first or Swift only project and that doesn’t seem to be panning out. If there are Swift functions being written in the iWatch software stack, I haven’t seen them yet, whether I’ve been looking in PepperUICore or one of the other frameworks.

Screen Shot 2014 11 18 at 8 08 57 PM

Lot’s of Obj-C.

There is no guarantee of course that the final native UI framework exposed to developers will be PepperUICore, much like how Apple’s internal UI framework for the first version of iOS was not the one that ended up shipping to developers. But the iWatch seems to have a strong foundation in Obj-C, so there wouldn’t be much of a reason for native iWatch development to not support Obj-C.

There are bits of UIKit on the iWatch

It’s hard to tell where UIKit begins and ends with the iWatch. But it does seem like portions of UIKit are there.

Screen Shot 2014 11 18 at 8 12 08 PM

Searching for color shows that the iWatch API defines a lot of categories on UIColor, and also doesn’t define a new color class of it’s own. There are also references to UIApplicationDidEnterBackgroundNotification and UIApplicationWillEnterForegroundNotification, implying that at least in it’s present state, the iWatch may be using UIKit’s application lifecycle feature as well. Also found are references to UIWindow, UIDevice, UIImageView, UIScrollView, and many Foundation classes, also enforcing the idea that Apple may be heavily basing their iWatch work on the same iOS foundation as the iPhone and iPad.

Supporting the idea that these are the UI classes that actually ship on device, and not just for the simulator, there are numerous references functions related to the digital crown, airplane mode, do not disturb mode, and possibly a lock screen.

Certain UIKit classes DO also seem to be replicated by the native UI framework. PUICTableView seems to be a replacement for UITableView.

More to find

While most my time has been spent in PepperUICore, a lot of the other frameworks might provide hints what the final iWatch feature set will look like. More enterprising developers might be able to hack together a few native applications today using Apple’s private frameworks.

PepperUICore itself seems to be in a fairly early stage. Much like the iOS 1.0 UI frameworks, it provides the essentials and nothing more. I can’t wait to see how the iWatch’s software stack evolves as Apple starts allowing developers to write native iWatch applications.