From 1af0d2ecf43387b85aae626e895dc3834ec42c64 Mon Sep 17 00:00:00 2001 From: esterTion Date: Mon, 2 Nov 2020 00:22:29 +0800 Subject: [PATCH] prevent accidental side menu popup --- Brokenithm-iOS.xcodeproj/project.pbxproj | 4 ++-- Brokenithm-iOS/ViewController.h | 1 + Brokenithm-iOS/ViewController.m | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Brokenithm-iOS.xcodeproj/project.pbxproj b/Brokenithm-iOS.xcodeproj/project.pbxproj index 780d35f..42e687b 100644 --- a/Brokenithm-iOS.xcodeproj/project.pbxproj +++ b/Brokenithm-iOS.xcodeproj/project.pbxproj @@ -353,7 +353,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 10; + CURRENT_PROJECT_VERSION = 11; DEVELOPMENT_TEAM = K9CP5766XY; INFOPLIST_FILE = "Brokenithm-iOS/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; @@ -377,7 +377,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 10; + CURRENT_PROJECT_VERSION = 11; DEVELOPMENT_TEAM = K9CP5766XY; INFOPLIST_FILE = "Brokenithm-iOS/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; diff --git a/Brokenithm-iOS/ViewController.h b/Brokenithm-iOS/ViewController.h index 24980d6..fdb3b1d 100644 --- a/Brokenithm-iOS/ViewController.h +++ b/Brokenithm-iOS/ViewController.h @@ -33,6 +33,7 @@ BOOL invertAir; NSNumber *menuHoldDuration; UILongPressGestureRecognizer *openCloseHold; + int touchCount; } @property UIView *airIOView; @property UIView *sliderIOView; diff --git a/Brokenithm-iOS/ViewController.m b/Brokenithm-iOS/ViewController.m index 63f01f0..1778172 100644 --- a/Brokenithm-iOS/ViewController.m +++ b/Brokenithm-iOS/ViewController.m @@ -247,6 +247,7 @@ } -(void)openOrCloseFunc { + if (self->touchCount > 1) return; if (funcViewOn) { [self closeFunc]; } else { @@ -296,6 +297,7 @@ [server BroadcastData:io]; } -(void)updateTouches:(UIEvent *)event { + self->touchCount = event.allTouches.count; if (openCloseEventOnce) { if (event.allTouches.count == 1 && [event.allTouches anyObject].phase == UITouchPhaseEnded) { openCloseEventOnce = NO;