The conversation between human and AI assistant.
How do I sort a array of nodes via zPosition?
Okay, how would I go about doing that?
First, you would need to loop through your array of SKNodes and create an array of their zPositions. Then, you can sort that array using a built-in Swift function like sorted() or write your own sorting algorithm.