Framework

WatchKit

Construct and manage your app’s user interface for watchOS. Respond to events generated by interface objects, gestures, and the system.

Overview

The WatchKit framework (WatchKit.framework) contains the classes that a WatchKit extension uses to manipulate the interface of a Watch app. A Watch app contains one or more interface controllers, each of which can have tables, buttons, sliders, and other types of visual elements. The WatchKit extension uses the classes of this framework to configure those visual elements and to respond to user interactions.

Symbols

Classes

WKAccessibilityImageRegion

An object that defines a portion of an image that you want to call out separately to an assistive app.

WKAlertAction

An object that encapsulates information about a button displayed in an alert or action sheet.

WKApplicationRefreshBackgroundTask

A class you can use to update your app’s state in the background.

WKAudioFileAsset

An object that stores a reference to an audio file and provides metadata information about that file.

WKAudioFilePlayer

An object that controls playback of a single audio item.

WKAudioFilePlayerItem

An object that manages the presentation state of an audio file while it is being played.

WKAudioFileQueuePlayer

An object that controls playback of one or more audio items.

WKCrownSequencer

An object that reports the current state of the digital crown, including its rotational speed when it is in motion.

WKExtension

An object that manages behaviors that are shared among all of your app’s interface controllers.

WKGestureRecognizer

The base class for all other gesture recognizer classes.

WKImage

A wrapper for images you use with a picker interface.

WKInterfaceActivityRing

A view that displays data from a HealthKit activity summary object.

WKInterfaceButton

A button in the user interface of your watchOS app.

WKInterfaceController

The main class for implementing the interface in a watchOS app.

WKInterfaceDate

A custom label that displays the current date or time.

WKInterfaceDevice

An object that provides information about the user’s Apple Watch.

WKInterfaceGroup

A container for one or more interface objects.

WKInterfaceHMCamera

An interface element that displays either a video stream or a single snapshot from an IP camera connected to HomeKit.

WKInterfaceImage

An image that can be displayed in the interface of your watchOS app.

WKInterfaceInlineMovie

An interface element that displays a video's poster image and supports inline playing of the video.

WKInterfaceLabel

An interface element that displays static text.

WKInterfaceMap

An interface element that displays a noninteractive map for the location you specify.

WKInterfaceMovie

An interface element that lets you play video and audio content in your watchOS app.

WKInterfaceObject

An object that provides information that is common to all interface objects in your watchOS app.

WKInterfacePaymentButton

A button that you can use to trigger payments through Apple Pay.

WKInterfacePicker

An interface element that presents a scrolling list of items for the user to choose from.

WKInterfaceSCNScene

An object that lets you manage SceneKit content for display in your app.

WKInterfaceSeparator

An interface object that displays a visual separator.

WKInterfaceSKScene

An object that lets you manage a SpriteKit scene in your watchOS app.

WKInterfaceSlider

An interface element that lets users select a single floating-point value from a range of values.

WKInterfaceSwitch

An interface element that toggles between an On and Off state.

WKInterfaceTable

An object that creates and manages the contents of a single-column table interface.

WKInterfaceTimer

A special type of label that displays a countdown or count-up timer.

WKLongPressGestureRecognizer

A gesture recognizer that looks for a touch event that occurs in the same relative area for an extended period of time.

WKPanGestureRecognizer

A gesture recognizer that looks for a touch event that moves around the screen.

WKPickerItem

A single item in a picker interface.

WKRefreshBackgroundTask

The abstract superclass for WatchKit’s background task objects.

WKSnapshotRefreshBackgroundTask

An object you use to update your app’s user interface in preparation for a snapshot.

WKSwipeGestureRecognizer

A gesture recognizer that looks for swiping gestures in one or more directions.

WKTapGestureRecognizer

A gesture recognizer that looks for a touch event occurring and ending in approximately the same area on the screen.

WKURLSessionRefreshBackgroundTask

An object that helps you respond to URLSession background transfers.

WKUserNotificationInterfaceController

An interface controller object that manages a dynamic user interface for a local or remote notification.

WKWatchConnectivityRefreshBackgroundTask

An object you use to receive background updates from the Watch Connectivity framework.

Protocols

WKCrownDelegate

A collection of methods you can implement to track the user's interaction with the digital crown, receiving notifications when the user rotates the crown or when rotation stops.

WKExtensionDelegate

A collection of methods you can implement to manage the app-level behavior of your WatchKit extension.

WKImageAnimatable

A collection of methods you can use to control the playback of animated images.

Structures

WKSwipeGestureRecognizerDirection

Constants indicating the direction of a swipe.

WatchKitError

Extended Types

NSNotification.Name

The type used for the name of a notification.