Instance Property


The activity available for recording progress.


var currentActivity: CLSActivity? { get }


You add an activity to a context by calling the createNewActivity() method when the user makes a new attempt at a task. You then use the context’s currentActivity property to access the newly created activity. If the context has an existing activity from a previous attempt, it ceases to be available to your app as a result of creating a new one. However, the network still retains its data for reporting purposes.

Don’t store a reference to the current activity. Always use the currentActivity property to get it. The object returned to you might change from time to time because of network synchronization, even when the underlying task is the same.

See Also

Creating Activities

func createNewActivity() -> CLSActivity

Creates and returns a new activity instance for the context.