     }
     
     fileprivate func setNeedsNavigationBackground(alpha: CGFloat) {
-        
         let barBackgroundView = navigationBar.subviews[0]
-        
         let valueForKey = barBackgroundView.value(forKey:)
         
         if let shadowView = valueForKey("_shadowView") as? UIView {

        return topViewController?.preferredStatusBarStyle ?? .default
    }
    
    static let _onceToken = UUID().uuidString
    
    open override class func initialize(){
        
        if self == UINavigationController.self {
            
            DispatchQueue.once(token: _onceToken) {
                let needSwizzleSelectorArr = [
                    NSSelectorFromString("_updateInteractiveTransition:"),
                    #selector(popToViewController),
                    #selector(popToRootViewController)
                ]
                
                for selector in needSwizzleSelectorArr {
                    
                    let str = ("et_" + selector.description).replacingOccurrences(of: "__", with: "_")
                    /*
                     popToRootViewControllerAnimated: et_popToRootViewControllerAnimated:*/
                    
                    let originalMethod = class_getInstanceMethod(self, selector)
                    let swizzledMethod = class_getInstanceMethod(self, Selector(str))
                    method_exchangeImplementations(originalMethod, swizzledMethod)
                }
            }
        }
    }
    
    func et_updateInteractiveTransition(_ percentComplete: CGFloat) {
        
        guard let topVC = topViewController, let coor = topVC.transitionCoordinator else {
            et_updateInteractiveTransition(percentComplete)
            return
        }
        
        let fromVC = coor.viewController(forKey: .from)
        let toVC = coor.viewController(forKey: .to)
        
        //Bg Alpha
        let fromAlpha = fromVC?.navBarBgAlpha ?? 0
        let toAlpha = toVC?.navBarBgAlpha ?? 0
        let nowAlpha = fromAlpha + (toAlpha - fromAlpha) * percentComplete
        
        setNeedsNavigationBackground(alpha: nowAlpha)
        
        //tintColor
        let fromColor = fromVC?.navBarTintColor ?? .blue
        let toColor = toVC?.navBarTintColor ?? .blue
        let nowColor = averageColor(fromColor: fromColor, toColor: toColor, percent: percentComplete)
        navigationBar.tintColor = nowColor
        et_updateInteractiveTransition(percentComplete)
    }
    
    //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
        fromColor.getRed(&fromRed, green: &fromGreen, blue: &fromBlue, alpha: &fromAlpha)
        
        var toRed: CGFloat = 0.0
        var toGreen: CGFloat = 0.0
        var toBlue: CGFloat = 0.0
        var toAlpha: CGFloat = 0.0
        toColor.getRed(&toRed, green: &toGreen, blue: &toBlue, alpha: &toAlpha)
        
        let nowRed = fromRed + (toRed - fromRed) * percent

        }
        
        if context.isCancelled {
            let cancelDuration: TimeInterval = context.transitionDuration * Double(context.percentComplete)
            UIView.animate(withDuration: cancelDuration) {
                animations(.from)
            }
        } else {
            let finishDuration: TimeInterval = context.transitionDuration * Double(1 - context.percentComplete)
            UIView.animate(withDuration: finishDuration) {
                animations(.to)
            }
        }
    }
}
