   func handle(backButton: UIButton) {
     popViewController(animated: true)
   }
+  
+  /**
+   Prepares back button of the navigation item in navigation bar.
+   - Parameter for item: A UINavigationItem.
+   - Parameter in navigationBar: A UINavigationBar.
+   */
+  func prepareBackButton(for item: UINavigationItem, in navigationBar: UINavigationBar) {
+    guard let v = navigationBar as? NavigationBar else {
+      return
+    }
+    
+    if nil == item.backButton.image && nil == item.backButton.title {
+      item.backButton.image = v.backButtonImage
+    }
+    
+    if !item.backButton.isHidden && !item.leftViews.contains(item.backButton) {
+      item.leftViews.insert(item.backButton, at: 0)
+    }
+    
+    item.backButton.addTarget(self, action: #selector(handle(backButton:)), for: .touchUpInside)
+    
+    item.hidesBackButton = false
+    item.setHidesBackButton(true, animated: false)
+    
+    v.layoutNavigationItem(item: item)
+  }
+  
+  /**
+   Removes back button of the navigation item.
+   - Parameter from item: A UINavigationItem.
+   */
+  func removeBackButton(from item: UINavigationItem) {
+    if let index = item.leftViews.index(of: item.backButton) {
+      item.leftViews.remove(at: index)
+    }
+    
+    item.backButton.removeTarget(self, action: #selector(handle(backButton:)), for: .touchUpInside)
+  }
 }
 
 extension NavigationController: UIGestureRecognizerDelegate {

    navigationBar.setNeedsLayout()
    navigationBar.layoutIfNeeded()
  }
}

extension NavigationController: UINavigationBarDelegate {

   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)
  }
}

