---
title: "CFTreeAppendChild(_:_:)"
framework: Core Foundation
role: symbol
role_heading: Function
path: "corefoundation/cftreeappendchild(_:_:)"
---

# CFTreeAppendChild(_:_:)

Adds a new child to a tree as the last in its list of children.

## Declaration

```swift
func CFTreeAppendChild(_ tree: CFTree!, _ newChild: CFTree!)
```

## Parameters

- `tree`: The tree to which to add newChild.
- `newChild`: The child tree to add to tree. If this parameter is a tree which is already a child of any other tree, the behavior is undefined.

## Discussion

Discussion When a child tree is added to another tree, the child tree is retained by its new parent.

## See Also

### Modifying a Tree

- [CFTreeInsertSibling(_:_:)](corefoundation/cftreeinsertsibling(_:_:).md)
- [CFTreeRemoveAllChildren(_:)](corefoundation/cftreeremoveallchildren(_:).md)
- [CFTreePrependChild(_:_:)](corefoundation/cftreeprependchild(_:_:).md)
- [CFTreeRemove(_:)](corefoundation/cftreeremove(_:).md)
- [CFTreeSetContext(_:_:)](corefoundation/cftreesetcontext(_:_:).md)
