interactivePopGestureRecognizer corrupts navigation stack on root view controller

后端 未结 5 1476
攒了一身酷
攒了一身酷 2021-02-12 11:19

In my UINavigationController I added custom back buttons with the side effect that it is not possible anymore to swipe left to right to pop the view controller and

5条回答
  •  旧时难觅i
    2021-02-12 12:06

    Try this code

    func navigationController(navigationController: UINavigationController, didShowViewController vc: UIViewController, animated: Bool) {
        self.interactivePopGestureRecognizer?.enabled = self.vc.count > 1
    }
    

提交回复
热议问题