swift 自定义返回按钮
viewController.navigationItem.leftBarButtonItem=UIBarButtonItem(image:UIImage(named:"arrow_back"), style: .plain, target:self, action:#selector(navBackAction))
自定义返回按钮后, 侧滑返回失效, 加下面一句话就可以解决
在ViewController里面:
self.navigationController?.interactivePopGestureRecognizer?.delegate = self as? UIGestureRecognizerDelegate
在UINavigationController里面:
self.interactivePopGestureRecognizer?.delegate = self as? UIGestureRecognizerDelegate
网友评论