From b78cc5e8ab6fdd1b360d7b43cb4f9dae3646cfbc Mon Sep 17 00:00:00 2001 From: Dominic Go Date: Sun, 6 Oct 2024 07:59:01 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=AB=20Update:=20`UIViewController+Moda?= =?UTF-8?q?lHelpers`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Temp/UIViewController+ModalHelpers.swift | 24 +++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/ios/Temp/UIViewController+ModalHelpers.swift b/ios/Temp/UIViewController+ModalHelpers.swift index 4d1e740d..9a2a9f2b 100644 --- a/ios/Temp/UIViewController+ModalHelpers.swift +++ b/ios/Temp/UIViewController+ModalHelpers.swift @@ -49,7 +49,7 @@ extension UIViewController { return match; }; - public var closestSheetDropShadowView: UIView? { + public var closestSheetDropShadowViewViaClimbingAncestorViews: UIView? { guard let targetClassName = PrivateSymbolString.classNameForDropShadowView.decodedString else { return nil; }; @@ -59,6 +59,28 @@ extension UIViewController { }; }; + public var closestSheetDropShadowViewViaClimbingNextResponders: UIView? { + guard let targetClassName = PrivateSymbolString.classNameForDropShadowView.decodedString else { + return nil; + }; + + let match = self.recursivelyFindNextResponder { + $0.className == targetClassName; + }; + + return match as? UIView; + }; + + public var closestSheetDropShadowViewViaPresentationController: UIView? { + self.presentationController?.presentedView; + }; + + public var closestSheetDropShadowView: UIView? { + self.closestSheetDropShadowViewViaPresentationController + ?? self.closestSheetDropShadowViewViaClimbingAncestorViews + ?? self.closestSheetDropShadowViewViaClimbingNextResponders; + }; + public var closestSheetPanGestureViaClimbingParentView: UIPanGestureRecognizer? { guard let sheetDropShadowView = self.closestSheetDropShadowView, let gestureRecognizers = sheetDropShadowView.gestureRecognizers