---
title: "enumerateChildNodes(_:)"
framework: scenekit
role: symbol
role_heading: Instance Method
path: "scenekit/scnnode/enumeratechildnodes(_:)"
---

# enumerateChildNodes(_:)

Executes the specified block for each of the node’s child and descendant nodes.

## Declaration

```swift
func enumerateChildNodes(_ block: (SCNNode, UnsafeMutablePointer<ObjCBool>) -> Void)
```

## Parameters

- `block`: The block to apply to the node’s child and descendant nodes. The block takes two parameters:

## Discussion

Discussion SceneKit uses a recursive preorder traversal to process the child node subtree—that is, the block runs for a node before it runs for each of the node’s children, and it processes all children of a node before processing any of that node’s sibling nodes.

## See Also

### Searching the Node Hierarchy

- [childNodes(passingTest:)](scenekit/scnnode/childnodes(passingtest:).md)
- [childNode(withName:recursively:)](scenekit/scnnode/childnode(withname:recursively:).md)
- [enumerateHierarchy(_:)](scenekit/scnnode/enumeratehierarchy(_:).md)
