I am confused with the objects of my class Card that is the subclass of SKSpriteNode. How do I get access to these objects when a user move them. So far I can only access SKNode objects overriding touchesEnded function.
override func touchesEnded(touches: Set<UITouch>, withEvent event: UIEvent?) {
let touch : UITouch = touches.first as UITouch!
let touchLocation = touch.locationInNode(self)
touchedNode = self.nodeAtPoint(touchLocation)
touchedNode.position = CGPoint(x: size.width * 0.5, y: size.height * 0.5)
touchedNode.zPosition = 0
}
I need to know what object the user is moving but in this case when touchedNode is an object of SKNode class (not my Card object class) I am not able to figure that out.