Posts

Showing posts from May, 2010

Shake Gesture

If you are planning to use the shake gesture to trigger an event add the following code to your UIViewController -( BOOL )canBecomeFirstResponder { return YES ; } -( void )viewDidAppear:( BOOL )animated { [ self becomeFirstResponder]; } - ( void )motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event { if (event.type == UIEventSubtypeMotionShake) { // add the todo code here } } From: http://iphone.detailsfinder.com/en/2010/detecter-un-shake/ I would also recommend reading http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/EventHandling/EventHandling.html#//apple_ref/doc/uid/TP40007072-CH9