From 96abae091afaa741f2fb1acedbbb94facb46c1bc Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Wed, 6 Jan 2021 12:35:31 +0300 Subject: [PATCH] Fix accessibility swipe back gesture --- .../Display/Source/Navigation/NavigationController.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/submodules/Display/Source/Navigation/NavigationController.swift b/submodules/Display/Source/Navigation/NavigationController.swift index 4b156aa6a5..7386e862b4 100644 --- a/submodules/Display/Source/Navigation/NavigationController.swift +++ b/submodules/Display/Source/Navigation/NavigationController.swift @@ -99,8 +99,11 @@ private final class NavigationControllerNode: ASDisplayNode { } override func accessibilityPerformEscape() -> Bool { - let _ = self.controller?.popViewController(animated: true) - return true + if let controller = self.controller, controller.viewControllers.count > 1 { + let _ = self.controller?.popViewController(animated: true) + return true + } + return false } }