Instance Property


An object encapsulating a user activity supported by this responder.


var userActivity: NSUserActivity? { get set }


By setting the userActivity property on a responder, the NSUserActivity object becomes managed by UIKit. User activities managed by UIKit are saved automatically at appropriate times. You can lazily add state data representing the user’s activity via the updateUserActivityState(_:) override. Multiple responders can share a single NSUserActivity instance, in which case they all get an updateUserActivityState(_:) callback.

A responder object can set its userActivity property to nil if it no longer wants to participate. Any NSUserActivity objects that are managed by UIKit but which have no associated responders (or documents) are automatically invalidated.

See Also

Supporting User Activities

func restoreUserActivityState(NSUserActivity)

Restores the state needed to continue the given user activity.

func updateUserActivityState(NSUserActivity)

Updates the state of the given user activity.