Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SpriteKit: what causes touchesMoved to stop getting called?

touchesMoved within GameScene.swift is not getting called after a few invocations, usually three or four, even if we keep sliding a finger along the screen (i.e., never lifting the finger off the screen).

We created a simple project with nothing but code to print touchesMoved, and there is no problem. In other words, touchesMoved works as expected, continuing to get called as we slide the finger around.

Clearly, there is some code/configuration in the project causing touchesMoved to stop getting called after a few invocations (and without touchesEnd getting called). What things could cause this?

touchesMoved code that isn't getting called:

    override func touchesMoved(touches: NSSet, withEvent event: UIEvent) {            
        let curTouch = touches.anyObject() as UITouch
        let curPoint = curTouch.locationInView(self.view)
        println(curPoint)
}
like image 998
Crashalot Avatar asked Oct 30 '25 08:10

Crashalot


1 Answers

I had the same problem. In my case, was a gestureRecognizer in the SKView, after remove it everything works like a charm.

like image 89
Guilherme Torres Castro Avatar answered Oct 31 '25 20:10

Guilherme Torres Castro