无故事王国
2023-11-29 93783809cfb18ae273bd3a78c8dbca91facd10d9
WanPai/Base/BaseNav.swift
@@ -10,7 +10,7 @@
class BaseNav: UINavigationController,UINavigationControllerDelegate {
    
    private var popDelegate: UIGestureRecognizerDelegate?
//    private var popDelegate: UIGestureRecognizerDelegate?
        /// 需要透明Nav的VC
@@ -26,9 +26,10 @@
        self.navigationBar.shadowImage = UIImage()
        self.navigationBar.isTranslucent = true
        self.delegate = self
        self.popDelegate = self.interactivePopGestureRecognizer?.delegate
//        self.popDelegate = self.interactivePopGestureRecognizer?.delegate
      self.interactivePopGestureRecognizer?.delegate = self
        if #available(iOS 15.0, *) {
            let scrollBar = UINavigationBarAppearance()
            scrollBar.configureWithOpaqueBackground()
@@ -50,8 +51,6 @@
            
            navigationBar.scrollEdgeAppearance = scrollBar //顶部透明
            navigationBar.standardAppearance = standardBar
        }else {
            navigationBar.titleTextAttributes = [.foregroundColor:UIColor.white,.font:Def_NavFont]
            navigationBar.isTranslucent = true
@@ -61,7 +60,6 @@
    }
    
    open func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) {
        let status = lucencyVCs.contains(where: {$0 == viewController.classForCoder})
      if (navigationController.viewControllers.count == 1 || status) && !(viewController is WelfareVC){
            if #available(iOS 15.0, *) {
@@ -84,7 +82,7 @@
        //侧滑
    public func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) {
        if  viewController == self.viewControllers[0] {
            self.interactivePopGestureRecognizer!.delegate = self.popDelegate
            self.interactivePopGestureRecognizer!.delegate = self
        }else{
            self.interactivePopGestureRecognizer!.delegate = nil
        }