     container.depthPreset = .none
     container.isHidden = true
   }
+  
+  /**
+   A method to update rootViewController dim value
+  */
+  fileprivate func updateDim() {
+    if isDimEnabled {
+      if isOpened {
+        self.rootViewController.view.alpha = 1.0
+      } else {
+        self.rootViewController.view.alpha = self.dimAmount
+      }
+      return
+    }
+    self.rootViewController.view.alpha = 1.0
+  }
 }
 
 extension NavigationDrawerController {

                        
                        v.bounds.size.width = width
                        v.layer.position.x = width / 2
                        if isDimEnabled { self.rootViewController.view.alpha = 0.5 }
                        
        }) { [weak self, v = v] _ in
          guard let `self` = self else {

   */
  open var isDimEnabled = true {
    didSet {
      self.updateDim()
    }
  }
  
  /**
   The alpha value of the rootViewController when left/right drawer
   is presented, the value should be between 0.0 - 1.0. Defaults is 0.5
  */
  open var dimAmount: CGFloat = 0.5 {
    didSet {
      if dimAmount < 0.0 || dimAmount > 1.0 {
        dimAmount = 0.5
      }
      self.updateDim()
    }
  }
  
