                 }
                 
             case .changed:
+                guard let transitionContext = transitionContext else {
+                    fatalError("Invalid 'transitionContext' value. This property should not be nil")
+                }
                 if transitionStarted && (present && dx > 0 || !present && dx < 0) {
                     updateTransition(percentComplete: progress)
                     transitionContext.updateInteractiveTransition(progress)

    }

    private func updateTransition(percentComplete: CGFloat) {
        let containerView = transitionContext.containerView
        let screenWidth = containerView.frame.size.width
        
        let totalWidth = screenWidth - options.visibleContentWidth
        
        if present {


            
            case .cancelled, .ended:
                if transitionStarted {
                    guard let transitionContext = transitionContext else {
                        fatalError("Invalid 'transitionContext' value. This property should not be nil")
                    }
                    if progress > 0.4 && velocity >= 0 || progress > 0.01 && velocity > 100 {
                        finishTransition(currentPercentComplete: progress)
                        transitionContext.finishInteractiveTransition()
