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 |
} |
} |
I would also recommend reading
Comments
Post a Comment