Detecting Shake Gesture by CoreMotion
问题 I want to detect device shake using coreMotion framework for iOS 7. Can anyone help me out how to do this ? I wrote code described below in my viewDidAppear CMMotionManager *motionManager = [[CMMotionManager alloc] init]; motionManager.deviceMotionUpdateInterval = 1.0/60.0; __block double myAcceleration; [motionManager startDeviceMotionUpdatesToQueue:[NSOperationQueue mainQueue] withHandler:^(CMDeviceMotion *motion, NSError *error) { myAcceleration = motion.userAcceleration.y; CATransform3D