self.mManager = [[CMMotionManager alloc]init]; self.mManager.deviceMotionUpdateInterval = 0.5; if (self.mManager.gyroAvailable) { [self.mManager start ...
self.mManager = [[CMMotionManager alloc]init];
self.mManager.deviceMotionUpdateInterval = 0.5;
if (self.mManager.gyroAvailable) {
[self.mManager startDeviceMotionUpdatesToQueue:[NSOperationQueue currentQueue] withHandler:^(CMDeviceMotion * _Nullable motion, NSError * _Nullable error) {
NSLog(@"RotationRate X:%.2lf Y:%.2lf Z:%.2lf ",motion.userAcceleration.x,motion.userAcceleration.y,motion.userAcceleration.z);
}];
}
x軸 頭 靠近 負數 Y參數
x軸 頭 遠離 正數
y軸 左側 高 正數 X參數
y軸 右側 高 負數