From ad90eba9b639f0e79cf5d9f745467a1a2072624a Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 14 Jan 2023 13:30:50 -0500 Subject: [PATCH] Let swipe actions recognize simultaneously with navigation pop --- Reader/Screens/AppNavigationController.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Reader/Screens/AppNavigationController.swift b/Reader/Screens/AppNavigationController.swift index d831a10..83dd6ce 100644 --- a/Reader/Screens/AppNavigationController.swift +++ b/Reader/Screens/AppNavigationController.swift @@ -32,6 +32,7 @@ class AppNavigationController: UINavigationController, UINavigationControllerDel let recognizer = UIPanGestureRecognizer(target: self, action: #selector(panGestureRecognized)) recognizer.allowedScrollTypesMask = .continuous recognizer.name = AppNavigationController.panRecognizerName + recognizer.delegate = self view.addGestureRecognizer(recognizer) isNavigationBarHidden = true @@ -140,3 +141,13 @@ class AppNavigationController: UINavigationController, UINavigationControllerDel } } + +extension AppNavigationController: UIGestureRecognizerDelegate { + func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool { + if String(describing: type(of: otherGestureRecognizer)) == "_UISwipeActionPanGestureRecognizer" { + return true + } else { + return false + } + } +}