From ba4f12376492dd28fcd0e6052de1564c45e85beb Mon Sep 17 00:00:00 2001 From: Dominic Go Date: Tue, 8 Oct 2024 08:32:56 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20Fix:=20`RNIModalSheetViewControl?= =?UTF-8?q?ler.setupExitAnimation`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RNIModalSheetViewController.swift | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/ios/RNIModalSheetView/RNIModalSheetViewController.swift b/ios/RNIModalSheetView/RNIModalSheetViewController.swift index dc9f31a..073fe8f 100644 --- a/ios/RNIModalSheetView/RNIModalSheetViewController.swift +++ b/ios/RNIModalSheetView/RNIModalSheetViewController.swift @@ -156,8 +156,20 @@ open class RNIModalSheetViewController: ModalSheetViewControllerLifecycleNotifie let animationBlocks = bottomOverlayController.createExitAnimationBlocks(); animationBlocks.start(); - transitionCoordinator.animate { context in - animationBlocks.end(); + transitionCoordinator.animate { + if $0.isCancelled { + animationBlocks.start(); + + } else { + animationBlocks.end(); + }; + + } completion: { context in + guard context.isCancelled else { + return + }; + + animationBlocks.start(); }; }; };