From 7864c9af2628f37a27fafbbd5dc7f192dc532232 Mon Sep 17 00:00:00 2001 From: racechao Date: Tue, 2 Apr 2024 18:37:20 +0800 Subject: [PATCH] Update PanModalPresentationDelegate.swift Fix https://github.com/slackhq/PanModal/pull/208 --- PanModal/Delegate/PanModalPresentationDelegate.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PanModal/Delegate/PanModalPresentationDelegate.swift b/PanModal/Delegate/PanModalPresentationDelegate.swift index 24264b74..18d7759f 100644 --- a/PanModal/Delegate/PanModalPresentationDelegate.swift +++ b/PanModal/Delegate/PanModalPresentationDelegate.swift @@ -52,7 +52,7 @@ extension PanModalPresentationDelegate: UIViewControllerTransitioningDelegate { Changes in size class during presentation are handled via the adaptive presentation delegate */ public func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? { - let controller = PanModalPresentationController(presentedViewController: presented, presenting: presenting) + let controller = PanModalPresentationController(presentedViewController: presented, presenting: presenting ?? source) controller.delegate = self return controller }