Instance Method


Registers the current user activity with the system


func updateUserActivity(_ type: String, userInfo: [AnyHashable : Any]? = nil, webpageURL: URL?)



The type of activity to be continued. The value is a developer-defined string in reverse-DNS format by convention, for example, com.myCompany.myEditor.editing. This parameter must not be nil or an empty string.


A dictionary containing app-specific state information needed to continue an activity on another device. Keys and values in the dictionary must be of the following types: NSArray, NSData, NSDate, NSDictionary, NSNull, NSNumber, NSSet, or NSString.


A URL containing the web page to load in a browser to continue the activity. The scheme of the URL must be http or https. Any other scheme throws an exception.


Use this method to publish your app’s current activity so that it can be handled as needed. When calling this method, you must specify a value for the userInfo parameter, the webpageURL parameter, or both. Call this method in the following situations:

  • In your glance interface controller, call this method and provide a userInfo dictionary with information about what the glance displays. If the user taps your glance, that contextual information passes to your app so it can configure its interface.

  • Call this method to register the current activity with Handoff. The system delivers the information to the user’s iPhone, which can propagate the Handoff information to the user’s other devices. For more information about supporting Handoff, see Handoff Programming Guide.

Call this method at any time during the execution of your interface controller’s code. The system takes the information you provide and stores it for delivery to the appropriate target.

See Also

Deprecated Symbols

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

Presents a page-based interface modally.

func handleUserActivity([AnyHashable : Any]?)

Responds to Handoff–related activity.

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.