1

I currently have an SKNode that generates children SKLabelNodes inside it for a menu. Both are classes that I wrote, with

override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) 

and I attempt to detect what is being touched with

for touches in touches{
        let location = touches.locationInNode(self)
        let nodes = nodesAtPoint(location)
        for node in nodes{ ...}
}

in both the child and parent node classes

The point being that if someone taps the child node, since it is inside the parent, both the parent node and the child node should perform actions, and if they tap inside the parent at any location, only the parent should perform actions. However it seems that only the child node touch function is called, and the parent never detects or receives the touch.

Is there a method for me to pass along the touch? Am I not supposed to include super.touchesMoved(touches, withEvent: event)?

Any sort of insight would be greatly appreciated. Thanks!

Eric Aya
  • 69,473
  • 35
  • 181
  • 253

0 Answers0