<!--
{
  "availability" : [
    "watchOS: 7.0.0 - 9.2.0"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/WKExtensionDelegateAdaptor",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI26WKExtensionDelegateAdaptorV"
  },
  "title" : "WKExtensionDelegateAdaptor"
}
-->

# WKExtensionDelegateAdaptor

A property wrapper type that you use to create a WatchKit extension delegate.

```
@MainActor @preconcurrency @propertyWrapper struct WKExtensionDelegateAdaptor<DelegateType> where DelegateType : NSObject, DelegateType : WKExtensionDelegate
```

## Overview

To handle extension delegate callbacks in an extension that uses the
SwiftUI life cycle, define a type that conforms to the
<doc://com.apple.documentation/documentation/WatchKit/WKExtensionDelegate>
protocol, and implement the delegate methods that you need. For example,
you can implement the
<doc://com.apple.documentation/documentation/WatchKit/WKExtensionDelegate/didRegisterForRemoteNotifications(withDeviceToken:)>
method to handle remote notification registration:

```
class MyExtensionDelegate: NSObject, WKExtensionDelegate, ObservableObject {
    func didRegisterForRemoteNotifications(withDeviceToken: Data) {
        // Record the device token.
    }
}
```

Then use the `WKExtensionDelegateAdaptor` property wrapper inside your
[`App`](/documentation/SwiftUI/App) declaration to tell SwiftUI about the delegate type:

```
@main
struct MyApp: App {
    @WKExtensionDelegateAdaptor private var extensionDelegate: MyExtensionDelegate

    var body: some Scene { ... }
}
```

SwiftUI instantiates the delegate and calls the delegate’s
methods in response to life cycle events. Define the delegate adaptor
only in your [`App`](/documentation/SwiftUI/App) declaration, and only once for a given extension. If
you declare it more than once, SwiftUI generates a runtime error.

If your extension delegate conforms to the
<doc://com.apple.documentation/documentation/Combine/ObservableObject>
protocol, as in the example above, then SwiftUI puts the delegate it
creates into the [`Environment`](/documentation/SwiftUI/Environment). You can access the delegate from
any scene or view in your extension using the [`EnvironmentObject`](/documentation/SwiftUI/EnvironmentObject) property
wrapper:

```
@EnvironmentObject private var extensionDelegate: MyExtensionDelegate
```

This enables you to use the dollar sign (`$`) prefix to get a binding to
published properties that you declare in the delegate. For more information,
see [`projectedValue`](/documentation/SwiftUI/WKExtensionDelegateAdaptor/projectedValue).

> Important: Manage an externsion’s life cycle events without using a
> delegate whenever possible. For example, prefer to handle changes
> in ``doc://com.apple.SwiftUI/documentation/SwiftUI/ScenePhase`` instead of relying on delegate callbacks, like
> <doc://com.apple.documentation/documentation/WatchKit/WKExtensionDelegate/applicationDidFinishLaunching()>.

## Topics

### Creating a delegate adaptor

[`init(_:)`](/documentation/SwiftUI/WKExtensionDelegateAdaptor/init(_:))

Creates a WatchKit extension delegate adaptor using an observable
delegate.

### Getting the delegate adaptor

[`projectedValue`](/documentation/SwiftUI/WKExtensionDelegateAdaptor/projectedValue)

A projection of the observed object that provides bindings to its
properties.

[`wrappedValue`](/documentation/SwiftUI/WKExtensionDelegateAdaptor/wrappedValue)

The underlying delegate.



---

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)