Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to turn off the automatic gesture to go back a view with a navigation controller?

Tags:

So I'm noticing all of my views are receiving the gesture to go back (pop a view) when the user swipes on the very left side of the screen (in either orientation) (This is new with iOS7)

I've tried so far with no avail to turn it off using:

    [self.navigationItem setHidesBackButton:YES]; 

Within the init of the NavigationController itself (as the delegate seems to be using that).

like image 756
Danoli3 Avatar asked Sep 26 '13 05:09

Danoli3


People also ask

How do I turn off swipe back on Iphone in react native?

To make this work, you need to: Disable the swipe gesture for the screen ( gestureEnabled: false ). Override the native back button in the header with a custom back button ( headerLeft: (props) => <CustomBackButton {... props} /> ).

How do I turn off swipe gestures in IOS?

To turn off the multifinger swipe gesture, go to Settings > Home Screen & Dock > Multitasking.

What are swipe Gestures?

One of the most common gestures you will use on your smartphone or tablet is a swipe. That's where you place your finger on the screen and slide it across the surface. In most instances, the item under your finger will move.


1 Answers

obj-c

self.navigationController.interactivePopGestureRecognizer.enabled = NO; 

swift

navigationController?.interactivePopGestureRecognizer?.isEnabled = false 
like image 189
Gabriele Petronella Avatar answered Oct 14 '22 14:10

Gabriele Petronella