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


class WKInterfaceDevice : NSObject


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 current() class method to get the shared device object.


Accessing the Shared Device Object

class func current() -> WKInterfaceDevice

Returns the shared device object.

Reading the Screen Information

var screenBounds: CGRect

The bounding rectangle of the screen.

var screenScale: CGFloat

The number of pixels per point for the current screen.

Reading the Device Settings

var name: String

The name assigned to the underlying device.

var model: String

The model information for the device.

var localizedModel: String

The localized version of the model information.

var wristLocation: WKInterfaceDeviceWristLocation

The wrist on which the user wears the Apple Watch.

enum WKInterfaceDeviceWristLocation

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

var crownOrientation: WKInterfaceDeviceCrownOrientation

The side on which the crown is positioned.

enum WKInterfaceDeviceCrownOrientation

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

var preferredContentSizeCategory: String

The preferred font-sizing option.

Reading System Information

var systemName: String

The name of the operating system.

var systemVersion: String

The version of the operating system.

Accessing the Layout Direction

var layoutDirection: WKInterfaceLayoutDirection

The layout direction of the user interface.

class func interfaceLayoutDirection(for: WKInterfaceSemanticContentAttribute) -> WKInterfaceLayoutDirection

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

enum 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.

enum WKInterfaceLayoutDirection

Specifies the directional flow of the user interface.

Reading Information About the Battery

var isBatteryMonitoringEnabled: Bool

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

var batteryLevel: Float

The battery's current percent charge.

enum WKInterfaceDeviceBatteryState

The battery's charging state.

Accessing Water Resistance and Lock

var waterResistanceRating: WKWaterResistanceRating

The Apple Watch water-resistance rating.

enum WKWaterResistanceRating

Values indicating the water-resistance rating.

var isWaterLockEnabled: Bool

A Boolean value that indicates whether the water lock is enabled.

func enableWaterLock()

Disables the Apple Watch touch screen to prevent accidental taps while submerged.

Playing Haptic Feedback

func play(WKHapticType)

Gives haptic feedback to the user.

enum WKHapticType

Constant indicating the style of feedback to deliver using haptics.

Streaming Audio

var supportsAudioStreaming: Bool

A Boolean value that indicates whether the device supports audio streaming.

Validating In-App Purchases

var identifierForVendor: UUID?

An alphanumeric string that uniquely identifies a device to the app’s vendor.


Inherits From

Conforms To

See Also

App Infrastructure

Working with the watchOS App Life Cycle

Learn how the watchOS app life cycle operates and respond to life cycle notification methods.

Keeping Your watchOS Content Up to Date

Ensure that your watchOS content is relevant and up to date.

Authenticating Users on Apple Watch

Create an account sign-up and sign-in strategy for Apple Watch.

class WKExtension

An object that manages behaviors shared by an app’s interface controllers.

protocol WKExtensionDelegate

A collection of methods that manage the app-level behavior of a WatchKit extension.