I extended SKSpriteNode
with my own class to have more functions.
But how can I get this extended node when something \'hits\' this node and didBe
So, here is an example of how you can get the node associated with the physics body.
var node = SKSpriteNode(imageNamed: "theimage")
node.physicsBody = SKPhysicsBody(circleOfRadius: 6)
var copy = node.physicsBody
Now, I will get the SKNode associated with copy
var node = copy.node
So, all you have to do is call the property node
on the physicsBody. Remember that the node
property returns an SKNode
, not SKSpriteNode
.