| | |
| | | |
| | | class BaseNav: UINavigationController,UINavigationControllerDelegate { |
| | | |
| | | private var popDelegate: UIGestureRecognizerDelegate? |
| | | // private var popDelegate: UIGestureRecognizerDelegate? |
| | | |
| | | |
| | | /// 需要透明Nav的VC |
| | |
| | | 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() |
| | |
| | | |
| | | navigationBar.scrollEdgeAppearance = scrollBar //顶部透明 |
| | | navigationBar.standardAppearance = standardBar |
| | | |
| | | |
| | | }else { |
| | | navigationBar.titleTextAttributes = [.foregroundColor:UIColor.white,.font:Def_NavFont] |
| | | navigationBar.isTranslucent = true |
| | |
| | | } |
| | | |
| | | 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, *) { |
| | |
| | | //侧滑 |
| | | 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 |
| | | } |