Replaces screen edge gesture hack with preferredScreenEdgesDeferringSystemGestures

We want priority over system gestures when tapping near edges of screen. Previously, we needed to access the private screen edge gesture recognizer, but now we can use preferredScreenEdgesDeferringSystemGestures.
This commit is contained in:
Riley Testut 2019-08-05 22:58:59 -07:00
parent 687d088827
commit cb2caa7ef1
3 changed files with 8 additions and 6 deletions

View File

@ -33,12 +33,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate
self.configureAppearance()
// Disable system gestures that delay touches on left edge of screen
for gestureRecognizer in self.window?.gestureRecognizers ?? [] where NSStringFromClass(type(of: gestureRecognizer)).contains("GateGesture")
{
gestureRecognizer.delaysTouchesBegan = false
}
// Controllers
ExternalGameControllerManager.shared.startMonitoring()

View File

@ -131,6 +131,10 @@ class GameViewController: DeltaCore.GameViewController
return !self.isGyroActive
}
override var preferredScreenEdgesDeferringSystemGestures: UIRectEdge {
return .all
}
required init()
{
super.init()

View File

@ -34,6 +34,10 @@ class LaunchViewController: RSTLaunchViewController
return self.gameViewController
}
override var childForScreenEdgesDeferringSystemGestures: UIViewController? {
return self.gameViewController
}
override var shouldAutorotate: Bool {
return self.gameViewController?.shouldAutorotate ?? true
}