Let swipe actions recognize simultaneously with navigation pop
This commit is contained in:
parent
5fef8de2ae
commit
ad90eba9b6
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue