Contents

WKUserNotificationHostingController

A WatchKit user notification interface controller that hosts a SwiftUI view hierarchy.

Declaration

@MainActor @preconcurrency class WKUserNotificationHostingController<Body> where Body : View

Overview

A WKUserNotificationHostingController presents and manages your app’s notification interface using SwiftUI views. You must subclass WKUserNotificationHostingController and override the body property to provide the set of SwiftUI views you want to display. In the storyboard of your watch app, specify the name of your custom class for your dynamic interactive interface.

Topics

Creating a hosting controller object

Getting the root view

Configuring the notification

See Also

Displaying SwiftUI views in WatchKit