watchOS
This document relates to developing watchOS apps for the Apple Watch on macOS Sierra versions 10.12.6 to 10.13.3 using Xcode versions 9.0.1 to 9.2 and watchOS 4.2 together with Swift 4.
Getting Started
Configuring Existing Xcode Project
In Xcode, select
File > New > Target
from the menu.Select
watchOS
from the selection in the top rowSelect
WatchKit App
Click
Next
Optionally select
Include Complication
Click
Finish
If prompted to activate a scheme, optionally select
Activate
For full details:
See also:
- WWDC2015 - Introducing Watch Connectivity
- watchOS 4.2 SDK Release Notes
- Technical Q&A QA1892 - Making the app name on a device consistent with the name in iTunes Connect
Building
To select an existing Watch app scheme, select Product > Scheme > Edit
Scheme...
from the main menu.
Complications
- ClockKit | Apple Developer Documentation
- Adding a Complication to Your watchOS App | Apple Developer Documentation
- CLKComplicationDataSource
- Adding Placeholders for Your Complication | Apple Developer Documentation
- Complication Images
- Technical Q&A QA1686: App Icons on iPhone, iPad and Apple Watch
- Designing Great Apple Watch Experiences - WWDC 2016 - Videos - Apple Developer
- Keeping Your Watch App Up to Date - WWDC 2016 - Videos - Apple Developer
- watchOS 2 Transition Guide: Creating a Complication
Notifications
Data Transfer
Water Lock
- https://stackoverflow.com/questions/46512709/use-enablewaterlock
- What's New in Health - WWDC 2017 - Videos - Apple Developer
Distribution
App Store Release Process
Debugging with os_log
- Profiles and Logs - Bug Reporting - Apple Developer
- Apple Watch console / device logs is empty |Apple Developer Forums
- On device watchOS debugging impossible |Apple Developer Forums
Guides
- Guides and Sample Code
- LoopHealth: Using health documents and Activity rings in HealthKit and HealthKitUI
- WatchKit Project Configuration Reference
- Understanding Memory Usage Limits for WatchKit Apps and Extensions
Sample Code
- Using the Watch Connectivity API
- SpeedySloth: Using HealthKit to build a workout app for Apple Watch
- WatchPuzzle: Using SceneKit and SpriteKit on watchOS
- HelloGameKit: A skeleton app for turn based games on watchOS
- QuickSwitch: Supporting Quick Watch Switching with WatchConnectivity
- PotLoc: CoreLocation with iPhone and Apple Watch
- WatchBackgroundRefresh: Using WKRefreshBackgroundTask to update WatchKit apps in the background
- SwingWatch: Using Device Motion on the Watch
- WatchKit Catalog: Using WatchKit Interface Elements
- Activity Rings: Contributing to Activity Rings on Apple Watch
-- Frank Dean - 14 Feb 2018
Related Topics: iOSDevelopment, iOSTips, MacOSXTips, Swift.md, Xcode