Hand shake gesture in SKScene

I am experimenting with SpriteKite and it does a great job with touch events. How can I implement a shake event? I assume that I will incorrectly set the first responder inside the scene / when the scene is presented.

in SKScene, which is never called.

-(void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event {
    if (event.subtype == UIEventSubtypeMotionShake ) {
        [self shakeEvent];
    }
}

Thank you in advance

+4
source share
1 answer

You can post a notification from ViewController and add an observer to SKScene.

+1
source

Source: https://habr.com/ru/post/1530132/


All Articles