Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable navigation controller slide right in swift [duplicate]

I want to disable the pull left feature on a navigation window that you see here.

enter image description here

But I not sure where to start? I want the Back button to work, but not the drag left that I doing in the snapshot cause it does work for my app.

like image 838
user3069232 Avatar asked Dec 23 '22 20:12

user3069232


1 Answers

You want to do:

self.navigationController?.interactivePopGestureRecognizer?.isEnabled = false

^^ This is the gesture recogniser that it uses for that transition.

Though I would highly discourage doing this unless you have a very good reason. It is a standard iOS behaviour and is great for accessibility (for users who can't reach the top left corner with one hand, or have a 6 plus).

like image 114
George Green Avatar answered May 18 '23 18:05

George Green