         return topViewController?.preferredStatusBarStyle ?? .default
     }
     
+    static let _onceToken = UUID().uuidString
+    
     open override class func initialize(){
         
         if self == UINavigationController.self {
             
-            let needSwizzleSelectorArr = [["ori":NSSelectorFromString("_updateInteractiveTransition:"),"swi":NSSelectorFromString("et_updateInteractiveTransition:")],
-                ["ori":#selector(popToViewController(_:animated:)),"swi":#selector(et_popToViewController(_:animated:))],
-                ["ori":#selector(popToRootViewController(animated:)),"swi":#selector(et_popToRootViewController(animated:))]]
-            
-            for needSwizzleSelector in needSwizzleSelectorArr {
-                let originalSelector = needSwizzleSelector["ori"]
-                let swizzledSelector = needSwizzleSelector["swi"]
-                let originalMethod = class_getInstanceMethod(self.classForCoder(), originalSelector)
-                let swizzledMethod = class_getInstanceMethod(self.classForCoder(), swizzledSelector)
-                method_exchangeImplementations(originalMethod, swizzledMethod)
-            }
-            
-        }
-        
-    }
-    
-
+            DispatchQueue.once(token: _onceToken) {
+                let needSwizzleSelectorArr = [
+                    NSSelectorFromString("_updateInteractiveTransition:"),
+                    #selector(popToViewController),
+                    #selector(popToRootViewController)
+                ]
+                
+                for selector in needSwizzleSelectorArr {
+                    
+                    let str = ("et_" + selector.description).replacingOccurrences(of: "__", with: "_")
+                    let originalMethod = class_getInstanceMethod(self, selector)
+                    let swizzledMethod = class_getInstanceMethod(self, Selector(str))
+                    method_exchangeImplementations(originalMethod, swizzledMethod)
+                }
+            }
+        }
+    }
+    
+    
     func et_updateInteractiveTransition(_ percentComplete: CGFloat) {
         et_updateInteractiveTransition(percentComplete)
-        if let topVC = self.topViewController {
-            if let coor = topVC.transitionCoordinator {
-                //Bg Alpha
-                let fromAlpha = coor.viewController(forKey: .from)?.navBarBgAlpha
-                let toAlpha = coor.viewController(forKey: .to)?.navBarBgAlpha
-                let nowAlpha = fromAlpha! + (toAlpha!-fromAlpha!)*percentComplete
-                
-                self.setNeedsNavigationBackground(alpha: nowAlpha)
-                
-                //tintColor
-                let fromColor = coor.viewController(forKey: .from)?.navBarTintColor
-                let toColor = coor.viewController(forKey: .to)?.navBarTintColor
-                let nowColor = averageColor(fromColor: fromColor!, toColor: toColor!, percent: percentComplete)
-                self.navigationBar.tintColor = nowColor
-            }
-        }
+        guard let topVC = topViewController, let coor = topVC.transitionCoordinator else { return }
+        
+        //Bg Alpha
+        let fromAlpha = coor.viewController(forKey: .from)?.navBarBgAlpha ?? 0
+        let toAlpha = coor.viewController(forKey: .to)?.navBarBgAlpha ?? 0
+        let nowAlpha = fromAlpha + (toAlpha - fromAlpha) * percentComplete
+        
+        setNeedsNavigationBackground(alpha: nowAlpha)
+        
+        //tintColor
+        let fromColor = coor.viewController(forKey: .from)?.navBarTintColor ?? .blue
+        let toColor = coor.viewController(forKey: .to)?.navBarTintColor ?? .blue
+        let nowColor = averageColor(fromColor: fromColor, toColor: toColor, percent: percentComplete)
+        navigationBar.tintColor = nowColor
     }
     
     //Calculate the middle Color with translation percent
     private func averageColor(fromColor:UIColor, toColor:UIColor, percent:CGFloat) -> UIColor {
-        var fromRed :CGFloat = 0.0
-        var fromGreen :CGFloat = 0.0
-        var fromBlue :CGFloat = 0.0
-        var fromAlpha :CGFloat = 0.0
+        var fromRed: CGFloat = 0.0
+        var fromGreen: CGFloat = 0.0
+        var fromBlue: CGFloat = 0.0
+        var fromAlpha: CGFloat = 0.0
         fromColor.getRed(&fromRed, green: &fromGreen, blue: &fromBlue, alpha: &fromAlpha)
         
         var toRed :CGFloat = 0.0

            objc_setAssociatedObject(self, &AssociatedKeys.navBarTintColor, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
        }
    }
    
    
}

        
        if navigationBar.isTranslucent {
            if #available(iOS 10.0, *){
                guard navigationBar.backgroundImage(for: .default) == nil else {
                    return
                }
                
                if let backgroundEffectView = barBackgroundView.value(forKey: "_backgroundEffectView") as? UIView {
                    backgroundEffectView.alpha = alpha
                    return
                }
                
            }else{
                guard let adaptiveBackdrop = barBackgroundView.value(forKey: "_adaptiveBackdrop") as? UIView else {
                    return
                }
                
                if let backdropEffectView = adaptiveBackdrop.value(forKey: "_backdropEffectView") as? UIView {
                    backdropEffectView.alpha = alpha
                    return
                }
            }
        }
        
        barBackgroundView.alpha = alpha
    }
}

extension UINavigationController: UINavigationControllerDelegate,UINavigationBarDelegate {
    
    public func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) {
        guard let topVC = navigationController.topViewController, let coor = topVC.transitionCoordinator else {
            return
        }
        
        if #available(iOS 10.0, *) {
            coor.notifyWhenInteractionChanges({ (context) in
                self.dealInteractionChanges(context)
            })
        } else {
            coor.notifyWhenInteractionEnds({ (context) in
                self.dealInteractionChanges(context)
            })
        }
    }
    
    private func dealInteractionChanges(_ context: UIViewControllerTransitionCoordinatorContext) {
        let animations: (UITransitionContextViewControllerKey) -> () = {
            let nowAlpha = context.viewController(forKey: $0)?.navBarBgAlpha ?? 0
            self.setNeedsNavigationBackground(alpha: nowAlpha)
            
            self.navigationBar.tintColor = context.viewController(forKey: $0)?.navBarTintColor
        }
        
        if context.isCancelled {
            let cancellDuration: TimeInterval = context.transitionDuration * Double(context.percentComplete)
            UIView.animate(withDuration: cancellDuration, animations: {
                animations(.from)
            })
        } else {
            let finishDuration: TimeInterval = context.transitionDuration * Double(1 - context.percentComplete)
            UIView.animate(withDuration: finishDuration, animations: {
                animations(.to)
            })
        }
    }
    
    public func navigationBar(_ navigationBar: UINavigationBar, shouldPop item: UINavigationItem) -> Bool {
        if let topVC = topViewController, let coor = topVC.transitionCoordinator, coor.initiallyInteractive {
            return true
        }
        
        let itemCount = navigationBar.items?.count ?? 0
        let n = viewControllers.count >= itemCount ? 2 : 1
        let popToVC = viewControllers[viewControllers.count - n]
        
        popToViewController(popToVC, animated: true)
        
        return true
    }
    
    public func navigationBar(_ navigationBar: UINavigationBar, shouldPush item: UINavigationItem) -> Bool {
        setNeedsNavigationBackground(alpha: topViewController?.navBarBgAlpha ?? 0)
        navigationBar.tintColor = topViewController?.navBarTintColor
        return true
    }
}

extension UIViewController {
    
    fileprivate struct AssociatedKeys {
        static var navBarBgAlpha: CGFloat = 1.0
        static var navBarTintColor: UIColor = UIColor.defaultNavBarTintColor
    }
    
    open var navBarBgAlpha: CGFloat {
        get {
            
            guard let alpha = objc_getAssociatedObject(self, &AssociatedKeys.navBarBgAlpha) as? CGFloat else {
                return 1.0
            }
            return alpha
            
        }
        set {
