Instance Method

restoreUserActivityState(_:)

Restores the state needed to continue the given user activity.

Declaration

func restoreUserActivityState(_ userActivity: NSUserActivity)

Parameters

activity

The user activity to be continued.

Discussion

Subclasses override this method to restore the responder’s state with the given user activity. The override should use the state data contained in the userInfo dictionary of the given user activity to restore the object.

User activities managed by NSDocument can be restored automatically, if false is returned from application:continueActivity:restorationHandler: or if it is unimplemented. In this situation, the document is opened by the NSDocumentController method openDocument(withContentsOf:display:completionHandler:) and receives a restoreUserActivityState(_:) message.

See Also

Supporting User Activities

var userActivity: NSUserActivity?

An object encapsulating a user activity supported by this document.

func updateUserActivityState(NSUserActivity)

Updates the state of the given user activity.