             }
 
             contentSnapshotView = createSnapshotView(from: fromViewController.view)
+
+            guard let contentSnapshotView = self.contentSnapshotView else {
+                fatalError("Invalid 'contentSnapshotView' value. This property should not be nil")
+            }
+
             containerView.addSubview(contentSnapshotView)
 
             fromViewController.view.isHidden = true

            
            case .cancelled, .ended:
                if transitionStarted {
                    if progress > 0.4 && velocity >= 0 || progress > 0.01 && velocity > 100 {
                        finishTransition(currentPercentComplete: progress)
                        transitionContext.finishInteractiveTransition()

    
    private var transitionShouldStarted = false
    private var transitionStarted = false
    private var transitionContext: UIViewControllerContextTransitioning?
    private var contentSnapshotView: UIView?

    private var tapRecognizer: UITapGestureRecognizer?
    private var panRecognizer: UIPanGestureRecognizer?
    
    required init(presentAction: @escaping Action, dismissAction: @escaping Action) {

