         view.frame.origin.x += view.frame.size.width
     }
 }
+
+fileprivate extension UIViewControllerContextTransitioning {
+    
+    var completion: ((Bool) -> Swift.Void) {
+        return { _ in
+            self.completeTransition(true)
+        }
+    }
+}

        UIView.animate(withDuration: duration, delay: 0, options: options.option, animations: {
            fromViewController.updateFrame(with: self.direction, reverse: true)
            toViewController.center()
        }) { _ in
            transitionContext.completeTransition(true)
        }
    }
    
    private func dismiss(using transitionContext: UIViewControllerContextTransitioning) {
        let (fromViewController, toViewController) = configure(using: transitionContext)
        
        UIView.animate(withDuration: duration, delay: 0, options: options.option, animations: {
            fromViewController.updateFrame(with: self.direction)
            toViewController.center()
        }) { _ in
            transitionContext.completeTransition(true)
        }
    }
}



extension SlideTransitionAnimator: UIViewControllerAnimatedTransitioning {
    
    private typealias AnimateTransitionHandler = (UIViewControllerContextTransitioning) -> ()
    
    func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
        return duration
