Let swipe actions recognize simultaneously with navigation pop

This commit is contained in:
Shadowfacts 2023-01-14 13:30:50 -05:00
parent 5fef8de2ae
commit ad90eba9b6
1 changed files with 11 additions and 0 deletions

View File

@ -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
}
}
}