シェイクジェスチャ認識ラッパーを使用して、シェイクジェスチャを検出しようとしました。Geeky Lemonで提案されているコードも実装しようとしました。しかし、シェイクジェスチャーを処理できません。シェイクジェスチャを認識させる方法はありますか?
ありがとうございました!
編集1:
コードは、shake Gesture Recognition ラッパーのデモを利用して作成されています。
初期化メソッドで
ShakeDispatcher * dispatcher = [ShakeDispatcher sharedInstance];
[dispatcher addShakeListener:self];
[[[CCDirector sharedDirector]view] addGestureRecognizer:dispatcher];
-(void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
if ( event.subtype == UIEventSubtypeMotionShake ){
NSLog(@"Shake detected");
}
}