I\'m developing a app with a gesture system, basically if I turn the iPhone to left my app will do a function, if I turn the iPhone to Right, other function, with others ges
Speedy99's swift answer is in the Objective C version
- (void)viewDidLoad {
[super viewDidLoad];
[self becomeFirstResponder];
}
- (BOOL)canBecomeFirstResponder{
return true;
}
- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event{
if(event.subtype == UIEventSubtypeMotionShake){
NSLog(@"Why are you shaking me?");
}
}