美文网首页
修复Navigatoin测滑返回

修复Navigatoin测滑返回

作者: 久百一 | 来源:发表于2020-09-08 19:31 被阅读0次
    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  
        }  
    

    相关文章

      网友评论

          本文标题:修复Navigatoin测滑返回

          本文链接:https://www.haomeiwen.com/subject/ojpjektx.html