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

后端 未结 6 1039
清歌不尽
清歌不尽 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:30

    obj-c

    self.navigationController.interactivePopGestureRecognizer.enabled = NO;
    

    swift

    navigationController?.interactivePopGestureRecognizer?.isEnabled = false
    

提交回复
热议问题