                 }
 
                 interactionController?.finish()
-
             } else {
                 interactionController?.cancel()
             }

}

@objcMembers
class ZoomInAnimator: ZoomAnimator { }

extension ZoomInAnimator: UIViewControllerAnimatedTransitioning {

    func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
        return 0.5

    }
}

class ZoomOutAnimator: ZoomAnimator, UIViewControllerAnimatedTransitioning {

    private var animatorForCurrentTransition: UIViewImplicitlyAnimating?

    func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
        return 0.25
    }

    @available(iOS 10.0, *)
    func interruptibleAnimator(using transitionContext: UIViewControllerContextTransitioning) -> UIViewImplicitlyAnimating {
        let params = animationParams(using: transitionContext)

        let animator = UIViewPropertyAnimator(duration: params.0, curve: .linear, animations: params.1)
        animator.addCompletion(params.2)
        animatorForCurrentTransition = animator

        return animator
    }

    private func animationParams(using transitionContext: UIViewControllerContextTransitioning) -> (TimeInterval, () -> (), (Any) -> ()) {
        let toViewController: UIViewController = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.to)!

        guard let fromViewController = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.from) as? FullScreenSlideshowViewController else {
            fatalError("Transition not used with FullScreenSlideshowViewController")
        }

        let containerView = transitionContext.containerView
