---
title: "addChildContext(_:)"
framework: classkit
role: symbol
role_heading: Instance Method
path: "classkit/clscontext/addchildcontext(_:)"
---

# addChildContext(_:)

Adds the specifed context as a child of the context receiving the method call.

## Declaration

```swift
func addChildContext(_ child: CLSContext)
```

## Parameters

- `child`: The context to add as a child of the one receiving the method call.

## Discussion

Discussion You don’t need to call this method directly. Instead, use the CLSDataStoreDelegate protocol to build contexts.

## See Also

### Managing context hierarchy

- [identifierPath](classkit/clscontext/identifierpath.md)
- [parent](classkit/clscontext/parent.md)
- [removeFromParent()](classkit/clscontext/removefromparent().md)
- [descendant(matchingIdentifierPath:completion:)](classkit/clscontext/descendant(matchingidentifierpath:completion:).md)
