 
 fileprivate extension UIViewController {
     
-    func center() {
+    func updateFrame(with direction: AnimationDirection, reverse: Bool = false) {
+        switch direction {
+        case .top:    reverse ? bottom() : top()
+        case .left:   reverse ? right()  : left()
+        case .bottom: reverse ? top()    : bottom()
+        case .right:  reverse ? left()   : right()
+        }
+    }
+    
+    private func center() {
         view.frame.origin = .zero
     }
     
-    func top() {
+    private func top() {
         view.frame.origin.y -= view.frame.size.height
     }
     
-    func left() {
+    private func left() {
         view.frame.origin.x -= view.frame.size.width
     }
     
-    func bottom() {
+    private func bottom() {
         view.frame.origin.y += view.frame.size.height
     }
     
-    func right() {
+    private func right() {
         view.frame.origin.x += view.frame.size.width
     }
 }

        let (fromViewController, toViewController) = configure(using: transitionContext)
        
        UIView.animate(withDuration: duration, delay: 0, options: options.option, animations: {
            switch self.direction {
            case .top:
                fromViewController.top()
            case .left:
                fromViewController.left()
            case .bottom:
                fromViewController.bottom()
            case .right:
                fromViewController.right()
            }
            toViewController.center()
        }) { _ in
            transitionContext.completeTransition(true)

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