AppDelgate.h
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOp tions:(NSDictionary *)launchOptions
{
application.applicationSupportsShake ToEdit = YES;
}
AppDelgate.m文件
-(BOOL)canBecomeFirstResponder {
return YES;
}
-(void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[self becomeFirstResponder];
}
- (void)viewWillDisappear:(BOOL)animated {
[self resignFirstResponder];
[super viewWillDisappear:animated];
}
- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event
{
if (motion == UIEventSubtypeMotionShak e) {
NSLog(@"ffff");
}
NSLog(@"wwww");
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOp
{
}
AppDelgate.m文件
-(BOOL)canBecomeFirstResponder {
}
-(void)viewDidAppear:(BOOL)animated {
}
- (void)viewWillDisappear:(BOOL)animated {
}
- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event
{
}