Apple Watch Application Development (watchOS)
watchOS application — separate target with own lifecycle, limited resources, and specific interaction patterns. Watches are standalone devices with watchOS 7+, apps work without iPhone nearby. But data architecture and sync between iPhone and Watch — main complexity faced during development.
Technology Stack
SwiftUI — only recommended UI framework for watchOS 7+. WatchKit Views (WKInterfaceController) officially deprecated, though still work. New apps — SwiftUI only.
@main on App struct, WindowGroup — standard entry point like on iOS. But NavigationSplitView on watch doesn't work — only NavigationStack.
HealthKit, CoreMotion, CoreLocation, CoreML — available natively on Watch. URLSession — exists, but doesn't work in background on watch: network requests only while app active or via WKExtendedRuntimeSession.
WatchConnectivity: Sync with iPhone
WCSession — communication channel between iPhone and Watch apps. Not between devices generally, but specifically between apps.
Three data transfer mechanisms:
sendMessage — instant transfer, only when both apps active:
WCSession.default.sendMessage(["action": "fetchData"], replyHandler: { reply in
// Reply from iPhone
}, errorHandler: { error in
// Error handling (Watch unavailable)
})
updateApplicationContext — dictionary, delivered on next launch, overwritten by new value:
try WCSession.default.updateApplicationContext(["lastSync": Date().timeIntervalSince1970])
Good for current state (active workout, recent settings).
transferUserInfo — queue of dictionaries, delivered guaranteed in order, not overwritten. For event logs, transactions.
Common mistake: use sendMessage to transfer data when Watch in background. sendMessage requires Watch app active in foreground. For background delivery — only updateApplicationContext or transferUserInfo.
Reachability check: WCSession.default.isReachable — but state is asynchronous. App can get true, send message, Watch goes to sleep before delivery. Always handle errorHandler.
Complications: Data on Watch Face
Complications — elements on watch face. From ClockKit (deprecated) → now WidgetKit, same as iOS. ComplicationConfiguration via WidgetConfiguration same API as iOS widgets.
CLKComplication families: .circularSmall, .modularSmall, .modularLarge, .utilitarianSmall, .utilitarianLarge, .graphicCorner, .graphicBezel, .graphicCircular, .graphicRectangular, .graphicExtraLarge.
Timeline in Complication works like iOS WidgetKit: TimelineProvider, pre-filled TimelineEntry. Watch knows what to show for next several hours — battery savings.
CLKComplicationDataSource.getPrivacyBehavior — what to show on locked watch face. hideOnLockScreen — hide data, show empty complication.
Background Modes on watchOS
WKExtendedRuntimeSession — up to 60 minutes background work for specific scenarios:
-
workout— training (unlimited time with active WorkoutSession) -
selfCare— meditation, breathing exercises (up to 10 minutes after screen) -
alarm— alarm (requires user permission) -
sleepTracking— sleep tracking (night)
For workout tracking: HKWorkoutSession + HKLiveWorkoutBuilder — official API. Without HKWorkoutSession system aggressively kills background processes.
Network requests in background: URLSession with background config on watchOS not supported. Network data in background — only via iPhone (WatchConnectivity) or next foreground launch.
UX Features Important to Consider
Screen small: Series 4+ — 44mm (368×448pt retina). Minimum touch target — 44pt. List of rows without complex hierarchy — preferred navigation. Digital Crown — content scroll, MapKit zoom, value input via Stepper or Picker with custom style.
onLongPressGesture — works but requires 0.8 seconds by default. On small screen — frequent accidental triggers.
Haptic feedback via WKInterfaceDevice.current().play(.click) — important UX element on Watch where visual feedback limited.
Testing
Watch Simulator — for basic UI. Physical watches mandatory for: GPS, HealthKit, heart rate sensors, Digital Crown tactile feedback, real iron performance. Series 4 and Series 9 perform differently.
Timeframe: 1-2 weeks for full watchOS app with WatchConnectivity and Complications. Simple companion-app (no own logic, just iPhone data display): 3-5 days. Cost calculated after requirements analysis.







