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

后端 未结 6 1050
清歌不尽
清歌不尽 2020-12-13 06:56

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) (

6条回答
  •  无人及你
    2020-12-13 07:35

    For IOS 8 (Swift):

    class MainNavigationController: UINavigationController {
    
        override func viewDidLoad() {
            super.viewDidLoad()
            self.interactivePopGestureRecognizer.enabled = false
    
            // Do any additional setup after loading the view.
        }
    
    }
    

提交回复
热议问题