         }
 
         // Hide the left items
-        visibleViewController.navigationItem.leftBarButtonItem?.customView?.alpha = alpha
-        if let leftItems = visibleViewController.navigationItem.leftBarButtonItems {
+        navigationItem.leftBarButtonItem?.customView?.alpha = alpha
+        if let leftItems = navigationItem.leftBarButtonItems {
             leftItems.forEach { $0.customView?.alpha = alpha }
         }
 
         // Hide the right items
-        visibleViewController.navigationItem.rightBarButtonItem?.customView?.alpha = alpha
-        if let leftItems = visibleViewController.navigationItem.rightBarButtonItems {
+        navigationItem.rightBarButtonItem?.customView?.alpha = alpha
+        if let leftItems = navigationItem.rightBarButtonItems {
             leftItems.forEach { $0.customView?.alpha = alpha }
         }
     }

        let alpha = (frame.origin.y + deltaLimit()) / frame.size.height

        // Hide all the possible titles
        visibleViewController.navigationItem.titleView?.alpha = alpha
        navigationBar.tintColor = navigationBar.tintColor.colorWithAlphaComponent(alpha)
        if let titleColor = navigationBar.titleTextAttributes?[NSForegroundColorAttributeName] as? UIColor {
            navigationBar.titleTextAttributes?[NSForegroundColorAttributeName] = titleColor.colorWithAlphaComponent(alpha)

    }

    func updateNavbarAlpha() {
        guard let navigationItem = visibleViewController?.navigationItem else {
            return
        }

