From 9d5624da6de736c4565d137dc6f540889334567d Mon Sep 17 00:00:00 2001 From: Dominic Go Date: Fri, 27 Sep 2024 10:00:14 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20Fix:=20`ModalSheetViewController?= =?UTF-8?q?LifecycleNotifier.sheetGesture`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Temp/ModalSheetViewControllerLifecycleNotifier.swift | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ios/Temp/ModalSheetViewControllerLifecycleNotifier.swift b/ios/Temp/ModalSheetViewControllerLifecycleNotifier.swift index 2c365cd3..9e4ffe6c 100644 --- a/ios/Temp/ModalSheetViewControllerLifecycleNotifier.swift +++ b/ios/Temp/ModalSheetViewControllerLifecycleNotifier.swift @@ -39,6 +39,7 @@ open class ModalSheetViewControllerLifecycleNotifier: ViewControllerLifecycleNot public override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated); + self.setupSheetGestureIfNeeded(); }; // MARK: - Setup @@ -55,14 +56,14 @@ open class ModalSheetViewControllerLifecycleNotifier: ViewControllerLifecycleNot self.presentationControllerDelegateProxy = self; }; - self._setupSheetGesture(); - presentationController.delegate = self; self._didSetup = true; }; - private func _setupSheetGesture(){ - guard let closestSheetPanGesture = self.closestSheetPanGesture else { + public func setupSheetGestureIfNeeded(){ + guard self.sheetGesture == nil, + let closestSheetPanGesture = self.closestSheetPanGesture + else { return; };