Reputation: 3538
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
This line no longer seems to have any effect in iOS 8. Putting it in my viewDidLoad method still enables the back swipe gesture with a navigation controller. Any ideas?
Upvotes: 4
Views: 2359
Reputation: 24237
Setting a custom back button image generally does the trick.
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc]
initWithTitle:@""
style:UIBarButtonItemStylePlain
target:nil
action:nil];
As an aside I generally recommend against breaking the built in behaviors like this, especially since most iOS users are very familiar and comfortable with these gestures. Taking them out just serves to frustrate users unnecessarily.
So if you are using the system standard navigation bars then it definitely stands to reason that people expect system standard behaviors. If you don't want these behaviors then you are better off customizing the UI: In this scenario this means either using your own Navigation bar and setting the navigation controller's bar to hidden.
Upvotes: 1