How to enable back/left swipe gesture in UINavigationController after setting leftBarButtonItem?

前端 未结 14 1019
遥遥无期
遥遥无期 2020-11-28 22:48

I got the opposite issue from here. By default in iOS7, back swipe gesture of UINavigationController\'s stack could pop the presented ViewCon

14条回答
  •  心在旅途
    2020-11-28 23:31

    I did not need to add gestureRecognizer functions for it. It was enough for me to add following code blocks at viewDidLoad:

    override func viewDidLoad() {
        super.viewDidLoad()
        self.navigationController?.interactivePopGestureRecognizer?.delegate = nil
        self.navigationController?.interactivePopGestureRecognizer?.isEnabled = true
    }
    

提交回复
热议问题