<!--
{
  "availability" : [
    "iOS: 11.3.0 -",
    "iPadOS: 11.3.0 -",
    "macCatalyst: 11.3.0 -",
    "macOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ClassKit",
  "identifier" : "/documentation/ClassKit/CLSContext/createNewActivity()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "ClassKit"
    ],
    "preciseIdentifier" : "c:objc(cs)CLSContext(im)createNewActivity"
  },
  "title" : "createNewActivity()"
}
-->

# createNewActivity()

Creates and returns a new activity instance for the context.

```
func createNewActivity() -> CLSActivity
```

## 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`](/documentation/ClassKit/CLSContext/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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)