<!--
{
  "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/CLSDataStoreDelegate/createContext(forIdentifier:parentContext:parentIdentifierPath:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "ClassKit"
    ],
    "preciseIdentifier" : "c:objc(pl)CLSDataStoreDelegate(im)createContextForIdentifier:parentContext:parentIdentifierPath:"
  },
  "title" : "createContext(forIdentifier:parentContext:parentIdentifierPath:)"
}
-->

# createContext(forIdentifier:parentContext:parentIdentifierPath:)

Asks the delegate for a new context with the given identifier for the given parent context.

```
func createContext(forIdentifier identifier: String, parentContext: CLSContext, parentIdentifierPath: [String]) -> CLSContext?
```

## Parameters

`identifier`

The identifier of the new context.

`parentContext`

The parent of the new context.

## Return Value

The new context.

## Discussion

The framework automatically adds the returned context as a child of the parent context and saves the changes. You only need to create, initialize, and return the new context.

---

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)