Skip to content

Commit

Permalink
💫 Update: UIViewController+ModalHelpers
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicstop committed Oct 5, 2024
1 parent ae91373 commit b78cc5e
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion ios/Temp/UIViewController+ModalHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand All @@ -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
Expand Down

0 comments on commit b78cc5e

Please sign in to comment.