From 21df698a207e5be95d4c58a1418ae4983d4d0a8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 20 Jun 2024 11:28:35 +0200 Subject: [PATCH] iOS: Enable "double-swipe" to switch apps To prevent accidental app switching. Unfortunately, the way to do this is to disable auto-hiding of the swipe indicator. Another strange Apple quirk. --- ios/ViewController.mm | 3 ++- ios/ViewControllerMetal.mm | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ios/ViewController.mm b/ios/ViewController.mm index 6462d6a8a7..d36c329606 100644 --- a/ios/ViewController.mm +++ b/ios/ViewController.mm @@ -134,7 +134,8 @@ id sharedViewController; } - (BOOL)prefersHomeIndicatorAutoHidden { - return YES; + // Would love to hide it, but it prevents the double-swipe protection from working. + return NO; } - (void)shareText:(NSString *)text { diff --git a/ios/ViewControllerMetal.mm b/ios/ViewControllerMetal.mm index c543b4822b..f1288a6eaa 100644 --- a/ios/ViewControllerMetal.mm +++ b/ios/ViewControllerMetal.mm @@ -481,7 +481,8 @@ void VulkanRenderLoop(IOSVulkanContext *graphicsContext, CAMetalLayer *metalLaye } - (BOOL)prefersHomeIndicatorAutoHidden { - return YES; + // Would love to hide it, but it prevents the double-swipe protection from working. + return NO; } - (void)shareText:(NSString *)text { @@ -531,7 +532,6 @@ extern float g_safeInsetBottom; [self updateGesture]; } - - (void)updateGesture { INFO_LOG(SYSTEM, "Updating swipe gesture.");