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

        }

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

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

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

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