iOS Guides | Samples

WatchKit Namespace

Framework for programming the Apple Watch.

Remarks

Watch Kit is Apple's framework for programming the Apple Watch. Watch Kit solutions are comprised of 3 Xamarin projects:

ProjectPurpose
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 WKInterfaceController. Application developers create subtypes of WKInterfaceController and override the WKInterfaceController.Awake, WKInterfaceController.WillActivate, and WKInterfaceController.DidDeactivate methods.

Classes

TypeReason
IWKImageAnimatableInterface representing the required methods (if any) of the protocol WKImageAnimatable.
WKAccessibilityExtension methods for WKInterfaceController that improve accessibility.
WKAccessibilityImageRegionA portion of an image that should be made separately available to assistive applications.
WKErrorCodeEnumerates error codes relevant to Watch Kit programming.
WKErrorCodeExtensionsExtension methods for the WatchKit.WKErrorCode enumeration.
WKInterfaceButtonA watch control that acts as a button.
WKInterfaceControllerBase class for controller objects in Watch Extension projects.
WKInterfaceDateA watch control that displays the date and time.
WKInterfaceDeviceRepresents the watch. Use the singleton object WKInterfaceDevice.CurrentDevice.
WKInterfaceGroupA container for watch controls.
WKInterfaceImageA watch control that displays an image.
WKInterfaceLabelA watch control that displays text.
WKInterfaceMapA watch control that displays an Apple-provided map.
WKInterfaceMapPinColorEnumeration of colors that can be used by pins on a WKInterfaceMap.
WKInterfaceObjectBase class for Watch controls.
WKInterfaceObject+Notifications
WKInterfaceSeparatorA watch control that displays a line for separating controls.
WKInterfaceSliderA watch control that allows the user to set a value within a range.
WKInterfaceSwitchA watch control that allows the user to manipulate a binary value.
WKInterfaceTableA watch control that provides a single-column table.
WKInterfaceTimerA watch control that displays a countdown timer.
WKMenuItemIconEnumerates standard icons for use in Watch context menus.
WKPresentMediaPlayerResultContains the result of presenting a media player.
WKTextInputModeEnumeration of restrictions on text input (constraints on emoji).
WKUserNotificationInterfaceControllerA sub-class of WKInterfaceController that adds methods that are called when a notification arrives.
WKUserNotificationInterfaceTypeEnumerates notificaion types for use with the WKUserNotificationInterfaceController.DidReceiveLocalNotification and WKUserNotificationInterfaceController.DidReceiveRemoteNotification completion handlers.