 //MARK: Private properties
     fileprivate(set) var _state: Presenting {
         willSet(newState) {
-            if newState != self._state {
-                self.performTransition(to: newState)
-                self.delegate?.sideController(self, willChangeTo: newState)
+            self.performTransition(to: newState)
+            self.delegate?.sideController(self, willChangeTo: newState)
+        }
+        didSet {
+            switch self._state {
+            case .front:
+                self.disableTapGesture()
+            case .side:
+                self.enablePanGesture()
+            default:
+                break
             }
         }
     }

        self.view.bringSubview(toFront: self.sideContainerView)
        self.sideContainerView.hideShadow(animation: 0.0)
        
        ///
        switch self.background {
        case .translucent:
            self.sideContainerView.backgroundColor = UIColor(white: 1.0, alpha: 0.3)
            let blurEffect = UIBlurEffect(style: .light)
            self.blurView = UIVisualEffectView(effect: blurEffect)
            let vibrancyEffect = UIVibrancyEffect(blurEffect: blurEffect)
            self.vibrancyView = UIVisualEffectView(effect: vibrancyEffect)
            self.sideContainerView.insertSubview(self.blurView!, at: 0)
            self.pinIntoSideContainer(view: self.blurView!)
            self.addChildViewController(self.sideController)
            self.vibrancyView?.contentView.addSubview(self.sideController.view)
            self.pinIntoSuperView(view: self.sideController.view)
            self.sideController.didMove(toParentViewController: self)
            blurView?.contentView.addSubview(vibrancyView!)
        case .opaque(_, _):
            self.addChildViewController(self.sideController)
            self.sideContainerView.addSubview(self.sideController.view)
            self.pinIntoSideContainer(view: self.sideController.view)
            self.sideController.didMove(toParentViewController: self)
        }
    }
}


        self.sideController = sideController
        self.sideContainerWidth = sideContainerWidth
        self.background = background
        self._state = .front
    
        super.init(nibName: nil, bundle: nil)
