views:

99

answers:

1

I'm implementing shake gestures as described in this answer however if I shake my phone for longer than a second, motionEnded doesn't get called.

Is there not a 1-to-1 ratio of motionBegan and motionEnded events guaranteed by the OS, or is this a problem with the responder chain and events are getting sent elsewhere?

+3  A: 

Either motionEnded:withEvent: or motionCancelled:withEvent: should be called. From the docs for motionCancelled:withEvent:

This method is invoked when the Cocoa Touch framework receives an interruption requiring cancellation of the motion event. This interruption is something that might cause the application to be no longer active or the view to be removed from the window. The method can also be invoked if the shaking goes on too long.

Ole Begemann