<!--
{
  "availability" : [
    "watchOS: 2.0.0 - 9.2.0"
  ],
  "documentType" : "symbol",
  "framework" : "WatchKit",
  "identifier" : "/documentation/WatchKit/WKExtension",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "WatchKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WKExtension"
  },
  "title" : "WKExtension"
}
-->

# WKExtension

The centralized point of control and coordination for extension-based apps running in watchOS.

```
@MainActor class WKExtension
```

## Overview

In Xcode 13 and earlier the system divides a watchOS app into two sections:

- WatchKit app: An app bundle that contains your app icon. For storyboard-based apps, it also includes your storyboard and any assets used by the storyboard.
- WatchKit extension: An extension that contains your watchOS app’s code.

In Xcode 14 and later, you can produce watchOS apps with a single watchOS app target for code, assets, extensions, and localizations. These single-target watchOS apps can run on watchOS 7 and later

Apps with separate WatchKit app and extensions have a single extension object. While the system creates and manages this object, you can access it to perform app-level tasks such as opening URLs and getting the root interface controller of your app.

As relevant events occur within your WatchKit app, the extension object notifies its delegate of those events. Your delegate object can implement the methods it needs to provide an appropriate response to life cycle events, handle notifications, or handle Handoff–related behaviors. For more information about the methods of the delegate, see [`WKExtensionDelegate`](/documentation/WatchKit/WKExtensionDelegate).

## Topics

### Getting the extension object

[`shared()`](/documentation/WatchKit/WKExtension/shared())

Returns the shared WatchKit extension object.

### Accessing the extension delegate

[`delegate`](/documentation/WatchKit/WKExtension/delegate)

The delegate of the WatchKit extension object.

[`WKExtensionDelegate`](/documentation/WatchKit/WKExtensionDelegate)

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

### Opening a URL resource

[`openSystemURL(_:)`](/documentation/WatchKit/WKExtension/openSystemURL(_:))

Opens the specified system URL.

### Getting the interface controllers

[`rootInterfaceController`](/documentation/WatchKit/WKExtension/rootInterfaceController)

The app’s root interface controller.

[`visibleInterfaceController`](/documentation/WatchKit/WKExtension/visibleInterfaceController)

Returns the last visible interface controller.

### Managing the execution state

[`applicationState`](/documentation/WatchKit/WKExtension/applicationState)

The runtime state of the Watch app.

[`WKApplicationState`](/documentation/WatchKit/WKApplicationState)

The running states of the Watch app.

[`isApplicationRunningInDock`](/documentation/WatchKit/WKExtension/isApplicationRunningInDock)

A Boolean value that indicates whether the app is running in the dock.

[`scheduleBackgroundRefresh(withPreferredDate:userInfo:scheduledCompletion:)`](/documentation/WatchKit/WKExtension/scheduleBackgroundRefresh(withPreferredDate:userInfo:scheduledCompletion:))

Schedules a background task to refresh the app’s data.

[`isFrontmostTimeoutExtended`](/documentation/WatchKit/WKExtension/isFrontmostTimeoutExtended)

A Boolean value that determines whether the app extends its time as the frontmost app.

### Managing the user interface

[`isAutorotating`](/documentation/WatchKit/WKExtension/isAutorotating)

A Boolean value that determines whether the interface automatically rotates when the user flips their wrist.

[`isAutorotated`](/documentation/WatchKit/WKExtension/isAutorotated)

A Boolean value that indicates whether the system has automatically rotated the user interface so that it is properly oriented for another viewer.

[`globalTintColor`](/documentation/WatchKit/WKExtension/globalTintColor)

The watchOS app’s global tint color.

[`enableWaterLock()`](/documentation/WatchKit/WKExtension/enableWaterLock())

Disables the Apple Watch touch screen to prevent accidental taps while the watch is underwater.

### Managing the snapshot

[`scheduleSnapshotRefresh(withPreferredDate:userInfo:scheduledCompletion:)`](/documentation/WatchKit/WKExtension/scheduleSnapshotRefresh(withPreferredDate:userInfo:scheduledCompletion:))

Schedules a background task to refresh your app’s snapshot.

### Observing messages from the notification center

[`applicationDidFinishLaunchingNotification`](/documentation/WatchKit/WKExtension/applicationDidFinishLaunchingNotification)

A message indicating that the launch process finished and the extension is ready to run.

[`applicationDidBecomeActiveNotification`](/documentation/WatchKit/WKExtension/applicationDidBecomeActiveNotification)

A message indicating that the watchOS app is visible and processing events.

[`applicationWillResignActiveNotification`](/documentation/WatchKit/WKExtension/applicationWillResignActiveNotification)

A message indicating that the system is about to deactivate the watchOS app.

[`applicationWillEnterForegroundNotification`](/documentation/WatchKit/WKExtension/applicationWillEnterForegroundNotification)

A message indicating that the watchOS app is about to transition from the background to the foreground.

[`applicationDidEnterBackgroundNotification`](/documentation/WatchKit/WKExtension/applicationDidEnterBackgroundNotification)

A message indicating that the watchOS app transitioned from the foreground to the background.

### Registering for remote notifications

[`registerForRemoteNotifications()`](/documentation/WatchKit/WKExtension/registerForRemoteNotifications())

Register to receive remote notifications from the Apple Push Notification service (APNs).

[`unregisterForRemoteNotifications()`](/documentation/WatchKit/WKExtension/unregisterForRemoteNotifications())

Unregister for all remote notifications received from Apple Push Notification service (APNs).

[`isRegisteredForRemoteNotifications`](/documentation/WatchKit/WKExtension/isRegisteredForRemoteNotifications)

A Boolean value that indicates if the app has successfully registered for remote notifications.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)