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

# CFTreeRemove(_:)

Removes a tree from its parent.

## Declaration

```swift
func CFTreeRemove(_ tree: CFTree!)
```

## Parameters

- `tree`: The tree to remove from its parent.

## Discussion

Discussion When a child tree is removed from its parent, the parent releases it. If you want to use the child after you have removed it, you should ensure you retain it before removing it from its parent.

## See Also

### Modifying a Tree

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