Class

WKInterfaceDevice

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

Overview

You can use the information from WKInterfaceDevice to make decisions about the content you display in your app. You can also use this object to play haptic feedback when your app is active.

Do not subclass or create instances of this class yourself. Always call the currentDevice class method to get the shared device object.

Topics

Getting the Shared Device Object

currentDevice

Returns the shared device object.

Getting the Screen Information

screenBounds

The bounding rectangle of the screen.

screenScale

The number of pixels per point for the current screen.

Getting the Device Settings

name

The name assigned to the underlying device.

model

The model information for the device.

localizedModel

The localized version of the model information.

wristLocation

The wrist on which the user wears the Apple Watch.

WKInterfaceDeviceWristLocation

Constants indicating the wrist on which the user wears the Apple Watch.

crownOrientation

The side on which the crown is positioned.

WKInterfaceDeviceCrownOrientation

Constants indicating the crown orientation from the user’s perspective.

preferredContentSizeCategory

The preferred font-sizing option.

Getting the System Information

systemName

The name of the operating system.

systemVersion

The version of the operating system.

Getting the Layout Direction

layoutDirection

The layout direction of the user interface.

interfaceLayoutDirectionForSemanticContentAttribute:

Returns the user interface direction for the given semantic content attribute.

WKInterfaceSemanticContentAttribute

A semantic description of the view’s contents, used to determine whether the view should be flipped when switching between left-to-right and right-to-left layouts.

WKInterfaceLayoutDirection

Specifies the directional flow of the user interface.

Accessing Information about the Battery

batteryMonitoringEnabled

A Boolean value that determines whether the app can monitor the device's battery.

Beta
batteryLevel

The battery's current percent charge.

Beta
batteryState

The device's battery state.

Beta
WKInterfaceDeviceBatteryState

The battery's charging state.

Beta

Getting the Water Resistance

waterResistanceRating

The Apple Watch water-resistance rating.

WKWaterResistanceRating

The Apple Watch water-resistance rating.

Playing Haptic Feedback

playHaptic:

Gives haptic feedback to the user.

WKHapticType

Constant indicating the style of feedback to deliver using haptics.

watchOS 1 Properties and Methods

cachedImages

A dictionary containing the name and size (in bytes) of the cached images.

addCachedImage:name:

Caches the image using the provided name.

addCachedImageWithData:name:

Caches the image data using the provided name.

removeAllCachedImages

Removes all the cached images from the cachedImages dictionary.

removeCachedImageWithName:

Removes the cached image with the specified name.

Relationships

Inherits From

See Also

Extension Architecture

WKExtension

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

WKExtensionDelegate

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

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software