Instance Method

handleUserActivity(_:)

Responds to Handoff–related activity.

Declaration

func handleUserActivity(_ userInfo: [AnyHashable : Any]?)

Parameters

userInfo

The dictionary containing data about the activity. When launching an app from its glance, WatchKit sets this parameter to the dictionary that the glance passed to the updateUserActivity(_:userInfo:webpageURL:) method.

Discussion

Implement this method in your app’s initial interface controller and use it to respond to Handoff–related activity. If you do not implement the handleUserActivity(_:) method in your app’s extension delegate, WatchKit calls this method on your app’s initial interface controller. (If your app uses a page-based interface, WatchKit calls this method for each interface controller that is part of your initial interface.) Your implementation of this method should look at the userInfo dictionary and decide what actions (if any) to take. For example, an interface controller in a page-based interface might make itself the current page.

The default implementation of this method does nothing. When overriding this method, do not call super.

See Also

Deprecated Symbols

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

Presents a page-based interface modally.

Deprecated
func handleAction(withIdentifier: String?, forRemoteNotification: [AnyHashable : Any])

Delivers a remote notification payload and a user-selected action to the interface controller.

Deprecated
func handleAction(withIdentifier: String?, for: UILocalNotification)

Delivers a local notification payload and a user-selected action to the interface controller.

Deprecated
class func reloadRootControllers(withNames: [String], contexts: [Any]?)

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

Text Response Key

Keys for retrieving text response information.