Instance Method

childNodeWithName:recursively:

Returns the first node in the node’s child node subtree with the specified name.

Declaration

- (SCNNode *)childNodeWithName:(NSString *)name recursively:(BOOL)recursively;

Parameters

name

The name of the node to search for.

recursively

YES to search the entire child node subtree, or NO to search only the node’s immediate children.

Discussion

If the recursive parameter is YES, SceneKit uses a preorder traversal to search the child node subtree—that is, the block searches a node before it searches each of the node’s children, and it searches all children of a node before searching any of that node’s sibling nodes. Otherwise, SceneKit searches only those nodes in the node’s childNodes array.

See Also

Searching the Node Hierarchy

- childNodesPassingTest:

Returns all nodes in the node’s child node subtree that satisfy the test applied by a block.

- enumerateChildNodesUsingBlock:

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

- enumerateHierarchyUsingBlock:

Executes the specified block for each of the node’s child and descendant nodes, as well as for the node itself.