From 8bfa24601252cff56d785f7f63ed40b0eba576f3 Mon Sep 17 00:00:00 2001 From: Dominic Go Date: Mon, 30 Sep 2024 07:05:17 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20Fix:=20`.dismissingViaGesture`?= =?UTF-8?q?=20State=20(Again)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: * Fix `ModalSheetPresentationStateMachine` handling of `ModalSheetState.dismissingViaGesture`. --- ios/Temp/ModalSheetPresentationStateMachine.swift | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ios/Temp/ModalSheetPresentationStateMachine.swift b/ios/Temp/ModalSheetPresentationStateMachine.swift index ed0d57dd..83610b8d 100644 --- a/ios/Temp/ModalSheetPresentationStateMachine.swift +++ b/ios/Temp/ModalSheetPresentationStateMachine.swift @@ -45,12 +45,11 @@ public class ModalSheetPresentationStateMachine { let prevState = self.prevState; let currentState = self.currentState; - - print( - "setStateExplicit", - "\n - state: \(prevState?.rawValue ?? "N/A") -> \(currentState.rawValue) -> \(nextState.rawValue)", - "\n" - ); + // print( + // "setStateExplicit", + // "\n - state: \(prevState?.rawValue ?? "N/A") -> \(currentState.rawValue) -> \(nextState.rawValue)", + // "\n" + // ); #if DEBUG if Self._debugShouldLog { @@ -300,6 +299,10 @@ extension ModalSheetPresentationStateMachine: ModalSheetViewControllerEventsNoti sender: UIViewController, panGesture: UIPanGestureRecognizer ) { + guard sender.isBeingDismissed else { + return; + }; + switch panGesture.state { case .began, .changed: self.isSheetPanGestureActive = true;