Generic Class

WKUserNotificationHostingController

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

Declaration

class WKUserNotificationHostingController<Body> : WKUserNotificationInterfaceController 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

init()

Creates a notification hosting controller object that you can use to implement your notification interfaces using SwiftUI views.

Getting the Root View

var body: Body

The root view of the view hierarchy to display for your notification interface.

Presenting the Interface Controller

func presentController(withNamesAndContexts: [(name: String, context: AnyObject)])

Presents one or more new interface controllers modally using a page-based arrangement.

class func reloadRootControllers(withNamesAndContexts: [(name: String, context: AnyObject)])

Loads the specified interface controllers and rebuilds the app's page-based interface.

Comparing Interface Controllers

static func == (NSObject, NSObject) -> Bool

Returns a Boolean value indicating whether two values are equal.

static func != (WKUserNotificationHostingController<Body>, WKUserNotificationHostingController<Body>) -> Bool

Returns a Boolean value indicating whether the two objects are not equivalent.

Getting Hash Information

var hashValue: Int

The hash value.

func hash(into: inout Hasher)

Hashes the essential components of this value by feeding them into the given hasher.

Relationships

Conforms To

See Also

WatchKit Hosting

class WKHostingController

A WatchKit interface controller that hosts a SwiftUI view hierarchy.

protocol WKInterfaceObjectRepresentable

A view that represents a WatchKit interface object.

enum DigitalCrownRotationalSensitivity

The amount of Digital Crown rotation needed to move between two integer numbers.