class xxxxxViewController: UIViewController {
// 修复侧滑丢失
private var naDelegate: UIGestureRecognizerDelegate?
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// 修复侧滑丢失
naDelegate = navigationController?.interactivePopGestureRecognizer?.delegate
navigationController?.interactivePopGestureRecognizer?.delegate = self as? UIGestureRecognizerDelegate
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
// 修复侧滑丢失
navigationController?.interactivePopGestureRecognizer?.delegate = naDelegate
}
网友评论