kboda
kboda

Reputation: 43

Handle shake gesture within SKScene

I am experimenting with SpriteKite and it is handling touch events perfectly. How can I implement a shake event? I assume I am failing the set the first responder correctly within the scene/when the scene is presented.

code within SKScene that is never called.

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

Thank you in advance

Upvotes: 4

Views: 366

Answers (1)

FlyingSB
FlyingSB

Reputation: 86

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

Upvotes: 1

Related Questions