Instance Property


A value used to identify the user activity.


@property(copy) NSUserActivityPersistentIdentifier persistentIdentifier;


Set this property to a value that identifies the user activity so you can later delete it with deleteSavedUserActivitiesWithPersistentIdentifiers:completionHandler:. For example, if the user checks the weather for Cupertino each morning from home, the weather app sets the persistent identifier to the city name (Cupertino). When the user deletes Cupertino from the weather app, the app deletes the user activity associated with the identifier, "Cupertino".

Listing 1

Example of setting the persistent identifier to a city name in a fictitious weather app.

let userActivity = NSUserActivity(activityType: WeatherLookup.userActivityType)
userActivity.persistentIdentifier = "Cupertino"

See Also

Accessing Activity Information


The activity type with which the user activity object was created.


An optional, user-visible title for this activity, such as a document name or web page title.


A set of keys that represent the minimal information about the activity that should be stored for later restoration.


A dictionary containing app-specific state information needed to continue an activity on another device.

- addUserInfoEntriesFromDictionary:

Adds the contents of the specified dictionary to the user info dictionary.


Indicates that the state of the activity needs to be updated.


A set of properties that describe the activity.


A set of localized keywords that can help users find the activity in search results.