The conversation between human and AI assistant.
How do I sort a array of nodes via zPosition?
Yes, I have tried using the sorted() function in Swift, but it doesn't seem to work with a node's zPosition.
That's because zPosition is a property of a node in a SpriteKit scene. You would need to write a custom sorting algorithm for your array of SKNodes.