48932

Question:
I need to turn off the automatic gesture swiping to go back in navigation controller. I using Swift.
I have already searched but didn't found a solution for me.
Answer1:You can disable the interactivePopGestureRecognizer
of your navigationController:
self.navigationController?.interactivePopGestureRecognizer.enabled = false
Answer2:
self.navigationController.interactivePopGestureRecognizer.delegate = self
func gestureRecognizerShouldBegin(gestureRecognizer: UIGestureRecognizer!) -> Bool {
return false;
}
I found this after a couple little searches. Not sure if its correct or not.
Answer3:Swift version:
Add this delegate in your UIViewController
: UIGestureRecognizerDelegate
Then in your viewDidLoad()
method add the next line:
self.navigationController!.interactivePopGestureRecognizer.delegate = self
and finally add this delegate method:
func gestureRecognizerShouldBegin(gestureRecognizer: UIGestureRecognizer) -> Bool {
return false
}
Good luck!