Contents

createNewActivity()

Creates and returns a new activity instance for the context.

Declaration

func createNewActivity() -> CLSActivity

Mentioned in

Return Value

A new activity.

Discussion

Use this method to create a new activity for a context every time a person makes a new attempt at a task. Afterward, use the returned value, or retrieve it by accessing the context’s currentActivity property. However, don’t store a reference to the activity as a class property because the underlying object may change from time to time as the framework performs network synchronization.

When you call this method on a context that already has an activity, the old activity is stopped and ceases to be accessible to your app, although its data remains in the network.

See Also

Creating activities