|
@@ -47,12 +47,19 @@
|
|
|
cmManager.accelerometerUpdateInterval = 0.1;
|
|
|
[cmManager startAccelerometerUpdates];
|
|
|
[cmManager startDeviceMotionUpdatesToQueue:[NSOperationQueue new] withHandler:^(CMDeviceMotion * _Nullable motion, NSError * _Nullable error) {
|
|
|
- CMRotationRate rotationRate = motion.rotationRate;
|
|
|
- CGFloat rotationRatex = rotationRate.x;
|
|
|
- CGFloat rotationRatey = rotationRate.y;
|
|
|
- CGFloat rotationRatez = rotationRate.z;
|
|
|
+// CMRotationRate rotationRate = motion.rotationRate;
|
|
|
+// CGFloat rotationRatex = rotationRate.x;
|
|
|
+// CGFloat rotationRatey = rotationRate.y;
|
|
|
+// CGFloat rotationRatez = rotationRate.z;
|
|
|
|
|
|
- if (rotationRatey > 7){
|
|
|
+ CMAcceleration accrleration = motion.gravity;
|
|
|
+ CGFloat rotationGravityz = accrleration.z;
|
|
|
+
|
|
|
+ //HLog(@"rotationRatey: %f",rotationRatey)
|
|
|
+ //HLog(@"rotationGravityz: %f",rotationGravityz)
|
|
|
+
|
|
|
+ //if (rotationRatey > 7){
|
|
|
+ if (rotationGravityz > 0.85){
|
|
|
|
|
|
BOOL haveOpenMask = [HWDataManager getBoolWithKey:Consn_Fanzhuan_Exit_app_Open];
|
|
|
if (haveOpenMask){
|