         ) -> UIViewControllerAnimatedTransitioning?
     {
         let animationController = self.animationController()
-        animationController.isDismissing = false
+        animationController.isPresenting = true
         return animationController
     }
     
     func animationControllerForDismissedController(dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
         let animationController = self.animationController()
-        animationController.isDismissing = true
+        animationController.isPresenting = false
         return animationController
     }
     

    }
    
    @objc func animateTransition(transitionContext: UIViewControllerContextTransitioning) {
        if !isDismissing {
            if let containerView = transitionContext.containerView(),
                let presentedViewController = transitionContext.viewControllerForKey(UITransitionContextToViewControllerKey),
                let presentedView = presentedViewController.view
            {
                containerView.addSubview(presentedView)
                let sideMenuWidth = containerView.frame.size.width - rightInset
                presentedView.frame = CGRect(
                    x: -sideMenuWidth,
                    y: 0.0,
                    width: sideMenuWidth,
                    height: containerView.frame.size.height
                )
                UIView.animateWithDuration(
                    duration,
                    delay: 0.0,
                    options: UIViewAnimationOptions.CurveEaseInOut,
                    animations: {
                        presentedView.frame.origin.x = 0.0
                    }
                    )
                { finished in
                    transitionContext.completeTransition(true)
                }
            }
        } else {
            if let presentedViewController = transitionContext.viewControllerForKey(UITransitionContextFromViewControllerKey),
                let presentedView = presentedViewController.view
            {
                UIView.animateWithDuration(
                    duration,
                    delay: 0.0,
                    options: UIViewAnimationOptions.CurveEaseInOut,
                    animations: {
                        presentedView.frame.origin.x = -presentedView.frame.size.width
                    }
                    )
                { finished in
                    transitionContext.completeTransition(true)
                    presentedView.removeFromSuperview()
                }
            }
        }
    }
    
}

extension UIViewController {

    // MARK: - Variables
    
    @IBInspectable var duration: Double = 0.3
    @IBInspectable var rightInset: CGFloat = 44.0
    
    // MARK: - Init

