Contents

updateUserActivityState(_:)

Updates the state of the given user activity.

Declaration

func updateUserActivityState(_ userActivity: NSUserActivity)

Parameters

  • userActivity:

    The user activity to be updated.

Discussion

Subclasses override this method to update the state of the supplied userActivity. Add state representing the user’s activity into userActivity using its addUserInfoEntries(from:) method. When the state is dirty, set the needsSave property to true.

When an NSUserActivity object managed by AppKit is updated, an empty userInfo dictionary is given to the user activity, and all of the objects associated with the user activity are sent an NSResponder message.

See Also

Related Documentation

Supporting User Activities