之前一直没有注意过摇动手势,刚才查了一下记录下来
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self becomeFirstResponder];
}
-(void)viewDidDisappear:(BOOL)animated{
[super viewDidDisappear:animated];
[self resignFirstResponder];
}
-(void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event{
if (motion == UIEventSubtypeMotionShake)
{
NSLog(@"shake");
}
}