In my app I have different controllers. When I push controller1 to navigation controller and swipe to back, all works good. But, if I push navigation controller1, and into contr
Swift 4:
Set the delegate,
self.navigationController?.interactivePopGestureRecognizer?.delegate = self
Implement the delegate method,
extension YourVC: UIGestureRecognizerDelegate{
func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
if gestureRecognizer == self.navigationController?.interactivePopGestureRecognizer && conditionToDisableTheGesture {
return false
}else{
return true
}
}
}