How to list ALL nodes in a Sprite Kit scene?

I want to list all the nodes in my scene. Not only those who are the daughter of the scene itself, but also the children of those and these children, etc. .... Therefore, I want to be able to go through the entire hierarchy of the node.

Is there a way to do this without knowing how deep the node tree is?

+7
ios objective-c sprite-kit
source share
1 answer

Yes, use enumerateChildNodesWithName:usingBlock: and pass //* as the name of the node. You should be able to call this on any node.

This is actually one example in Apple docs :

// * This search string corresponds to each node in the node tree.

+10
source share

All Articles