0
Ich möchte Device Shake mit CoreMotion-Framework für iOS 7 erkennen. Kann mir jemand helfen, wie dies zu tun?Erkennung von Shake-Geste durch CoreMotion
schrieb ich Code unten in meinem viewDidAppear beschrieben
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 transform;
transform = CATransform3DMakeRotation(
motion.attitude.pitch, 1, 0, 0);
transform = CATransform3DRotate(transform,
motion.attitude.roll, 0, 1, 0);
transform = CATransform3DRotate(transform,
motion.attitude.yaw, 0, 0, 1);
}
];
aber nicht schütteln zu erkennen.
Hey, bitte teilen Sie Ihre Antwort, wenn jemand über Shake in ios 7 und oben mit Kernbewegung wissen – Sudha