When I sit down from left to right in the navigation bar, my navigation controller pushes out the view controller. I already looked at this question , so I know that I can install ...
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
... but it just disables scrolling in the view under the navigation bar, not in the bar itself.
My current solution is to manually find the gesture and turn it off. Which works, but not sure if there is a better way. The navigation bar does not seem to have the same property as interactivePopGestureRecognizer .
// This is inside a `UINavigationController` subclass. for (UISwipeGestureRecognizer *gr in self.navigationBar.gestureRecognizers) { if ([gr isKindOfClass:[UISwipeGestureRecognizer class]] && gr.direction == UISwipeGestureRecognizerDirectionRight) { gr.enabled = NO; } }
Hlung source share