<!--
{
  "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/CLSDataStore/remove(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "ClassKit"
    ],
    "preciseIdentifier" : "c:objc(cs)CLSDataStore(im)removeContext:"
  },
  "title" : "remove(_:)"
}
-->

# remove(_:)

Marks a context for removal.

```
func remove(_ context: CLSContext)
```

## Parameters

`context`

The context to remove.

## Discussion

If your context hierarchy changes, either because your app’s content is dynamic, or as a result of an app update, you might need to remove old contexts from the data store. Call this method to mark a context for removal. Call the [`save(completion:)`](/documentation/ClassKit/CLSDataStore/save(completion:)) method to commit the change.

When you remove a context, the framework removes all of its decendants as well.

---

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)