WatchKit

On this page 7

WatchKit is the Apple software framework for building apps that run on Apple Watch, providing the application lifecycle, background task scheduling, device information, haptic feedback and, historically, the user interface objects of watchOS apps. Among wearable platforms, it plays the role that UIKit plays on iPhone: it is the system layer that connects third-party code to watchOS.

WatchKit has changed considerably since Apple introduced it in 2014. Early apps ran their code on the paired iPhone, while modern apps run natively on the watch and usually draw their interface with SwiftUI. WatchKit remains present in every watch app, but its focus has shifted from drawing screens to managing app behavior, runtime and system integration.

How WatchKit evolved across watchOS versions

WatchKit evolved from a remote interface toolkit into a native runtime framework. Each major watchOS release moved more processing onto the watch and gave developers more direct access to hardware.

StageWhere app code runsInterface technologyKey change
watchOS 1 eraWatchKit extension on iPhoneStoryboards with interface objectsWatch acted as a remote display
watchOS 2 to 5Extension on the watchStoryboards with interface objectsNative execution, faster launch
watchOS 6On the watch, independent apps allowedSwiftUI introduced alongside storyboardsApps no longer need an iPhone app
watchOS 7 and laterOn the watchSwiftUI app lifecycleWKApplication replaces WKExtension
Current toolchainsSingle-target watch appSwiftUI preferredStoryboard objects deprecated
Major stages in the development of WatchKit

This history explains why developers still meet two styles of WatchKit code: older projects built on WKInterfaceController and storyboards, and newer ones that use SwiftUI views with WatchKit services underneath. Maintaining a legacy app often means migrating screen by screen to SwiftUI.

Core components of the framework

The core of WatchKit consists of classes that represent the running app, the device and system-scheduled work. The most important ones are summarized below.

ClassPurposeTypical use
WKApplicationRepresents the running appState checks, opening system URLs
WKApplicationDelegateReceives lifecycle eventsLaunch handling, background task delivery
WKInterfaceDeviceDescribes the current watchScreen size, battery, haptics via play
WKExtendedRuntimeSessionKeeps the app running longerMindfulness, physical therapy, alarms
WKRefreshBackgroundTaskBase of scheduled background workData refresh, snapshot updates
WKInterfaceControllerLegacy screen controllerStoryboard-based interfaces
Important WatchKit classes and their purpose

Haptic feedback is a distinctive part of the framework. Through WKInterfaceDevice, an app can play predefined patterns such as notification, success, failure or directional cues, using the Taptic Engine to communicate without sound or a glance at the screen.

Background execution and runtime limits

WatchKit manages background execution through a budgeted task system, because a watch has a small battery and must protect battery life. Instead of running freely, an app requests background refreshes and the system decides when to grant them.

The system delivers several task types to the application delegate. Each task must be completed promptly by calling its completion method, otherwise the app loses part of its budget.

Task typeTriggerPurpose
Application refreshApp-scheduled dateUpdate data while not in use
Snapshot refreshSystem or app requestRefresh the image shown in the Dock
URL session refreshFinished background downloadProcess downloaded content
Watch Connectivity refreshData from the paired iPhoneReceive files or context
Relevant shortcut refreshSmart Stack relevance updatesKeep shortcuts current
Background task types in WatchKit

For tasks that need the app active for longer, an extended runtime session or a HealthKit workout session keeps the app running with the screen lowered. These sessions are limited to approved purposes, and misuse leads to rejection during App Store review.

How WatchKit relates to neighboring frameworks

WatchKit rarely works alone; a watch app combines it with several specialized frameworks. Understanding the boundaries prevents developers from looking for features in the wrong place.

  • SwiftUI draws the interface, handles navigation and reads the Digital Crown through view modifiers.
  • WidgetKit builds complications and Smart Stack widgets, replacing the older ClockKit framework.
  • HealthKit reads and writes health data and runs workout sessions that keep the app active.
  • Watch Connectivity exchanges messages, files and application context with the iPhone app.
  • UserNotifications schedules and handles notifications, which WatchKit can display with custom interfaces.

A frequent source of confusion is the difference between WatchKit and watchOS itself. watchOS is the operating system; WatchKit is one of its public frameworks. Similarly, WatchKit is comparable to the app framework layer of Wear OS, where Jetpack libraries and Compose for Wear OS fill the equivalent roles.

Common mistakes when building with WatchKit

Most problems in watch apps come from treating the watch like a small iPhone. Interactions on the wrist typically last only a few seconds, so apps should present the most relevant information immediately and defer heavy work.

  • Ignoring background task completion, which drains the refresh budget.
  • Loading large network payloads directly on the watch instead of preparing compact data on the phone or server.
  • Keeping new development on deprecated storyboard interfaces instead of SwiftUI.
  • Assuming an iPhone is always nearby, although independent apps must work over Wi-Fi or cellular alone.

Testing also needs care. The watch simulator in Xcode runs on a desktop processor and does not reproduce real background budgets, network conditions or haptic feel, so developers should verify refresh timing, battery impact and wrist interactions on physical Apple Watch hardware before release.

Finally, developers should keep the minimum supported watchOS version in mind. Newer WatchKit features, such as the SwiftUI app lifecycle or relevance-based Smart Stack updates, are unavailable on older systems, so a project that targets older watches needs availability checks and fallback code.

In simple terms

WatchKit is a set of ready-made building blocks from Apple. Developers use it to make apps for the Apple Watch. It tells an app when it starts, when it goes to sleep and when it may update in the background.

Think of it as the house rules of the watch. The watch has a small battery and a tiny screen. WatchKit makes sure each app behaves politely, uses little power and can still tap your wrist when something matters.

A practical example

A small team builds a public transit app for Apple Watch. The interface is written in SwiftUI and shows the next two departures from the nearest stop. Using WatchKit, the app schedules an application refresh task roughly every 30 minutes, so the times are already current when the user raises the wrist.

When a selected bus is two minutes away, the app sends a notification and plays a directional haptic pattern through WKInterfaceDevice. The team also handles the snapshot refresh task, so the Dock preview shows fresh departure times. After release, the team sees that the app opens with current data in most launches, and battery impact stays within normal limits because every background task is completed quickly.