     navigationBar.setNeedsLayout()
     navigationBar.layoutIfNeeded()
   }
+  
+  /**
+   Sets whether the navigation bar is hidden.
+   - Parameter _ hidden: Specify true to hide the navigation bar or false to show it.
+   - Parameter animated: Specify true if you want to animate the change in visibility or false if you want the navigation bar to appear immediately.
+   */
+  open override func setNavigationBarHidden(_ hidden: Bool, animated: Bool) {
+    super.setNavigationBarHidden(hidden, animated: animated)
+    guard let items = navigationBar.items, items.count > 1 else {
+      return
+    }
+    
+    items.forEach {
+      prepareBackButton(for: $0, in: navigationBar)
+    }
+  }
 }
 
 extension NavigationController: UINavigationBarDelegate {

  func handle(backButton: UIButton) {
    popViewController(animated: true)
  }
}

extension NavigationController: UIGestureRecognizerDelegate {

   True is yes, false is no.
   */
  public func navigationBar(_ navigationBar: UINavigationBar, shouldPush item: UINavigationItem) -> Bool {
    prepareBackButton(for: item, in: navigationBar)
    return true
  }
  
  public func navigationBar(_ navigationBar: UINavigationBar, didPop item: UINavigationItem) {
    removeBackButton(from: item)
  }
}

