Watch Kit is Apple's framework for programming the Apple Watch. Watch Kit solutions are comprised of 3 Xamarin projects:
Project | Purpose |
---|---|
Parent App | The Parent App is a normal iPhone project that bundles the other projects and can be used for tutorials, administrative needs, and background processing. It runs in a separate sandbox than the Watch Extension and it is possible for the user to run the Watch App / Extension without ever opening the Parent App. |
Watch Extension | The Watch Extension runs on a connected iPhone and holds the program logic for the Watch App itself. |
Watch App | The Watch App is a small project that runs on the phone itself. Generally, the Watch App only consists of a Storyboard file, small resources, and links to files in the Watch Extension. |
Installation, structure, and general programming information about Watch Kit can be found in Xamarin's Watch Kit Programming Guide.
Programming Watch Extensions is heavily based on reacting to lifecycle methods of the WatchKit.WKInterfaceController. Application developers create subtypes of WatchKit.WKInterfaceController and override the WatchKit.WKInterfaceController.Awake, WatchKit.WKInterfaceController.WillActivate, and WatchKit.WKInterfaceController.DidDeactivate methods.
Type | Reason |
---|---|
WKAccessibility | Extension methods for WatchKit.WKInterfaceController that improve accessibility. |
WKAccessibilityImageRegion | A portion of an image that should be made separately available to assistive applications. |
WKErrorCode | Enumerates error codes relevant to Watch Kit programming. |
WKInterfaceButton | A watch control that acts as a button. |
WKInterfaceController | Base class for controller objects in Watch Extension projects. |
WKInterfaceDate | A watch control that displays the date and time. |
WKInterfaceDevice | Represents the watch. Use the singleton object WatchKit.WKInterfaceDevice.CurrentDevice. |
WKInterfaceGroup | A container for watch controls. |
WKInterfaceImage | A watch control that displays an image. |
WKInterfaceLabel | A watch control that displays text. |
WKInterfaceMap | A watch control that displays an Apple-provided map. |
WKInterfaceMapPinColor | Enumeration of colors that can be used by pins on a WatchKit.WKInterfaceMap. |
WKInterfaceObject | Base class for Watch controls. |
WKInterfaceSeparator | A watch control that displays a line for separating controls. |
WKInterfaceSlider | A watch control that allows the user to set a value within a range. |
WKInterfaceSwitch | A watch control that allows the user to manipulate a binary value. |
WKInterfaceTable | A watch control that provides a single-column table. |
WKInterfaceTimer | A watch control that displays a countdown timer. |
WKMenuItemIcon | Enumerates standard icons for use in Watch apps. |
WKTextInputMode | Enumeration of restrictions on text input (constraints on emoji). |
WKUserNotificationInterfaceController | A sub-class of WatchKit.WKInterfaceController that adds methods that are called when a notification arrives. |
WKUserNotificationInterfaceType | Enumerates notificaion types for use with the WatchKit.WKUserNotificationInterfaceController.DidReceiveLocalNotification and WatchKit.WKUserNotificationInterfaceController.DidReceiveRemoteNotification completion handlers. |