---
title: "createContext(forIdentifier:parentContext:parentIdentifierPath:)"
framework: classkit
role: symbol
role_heading: Instance Method
path: "classkit/clsdatastoredelegate/createcontext(foridentifier:parentcontext:parentidentifierpath:)"
---

# createContext(forIdentifier:parentContext:parentIdentifierPath:)

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

## Declaration

```swift
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

Return Value The new context.

## Discussion

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.
