Skip to content

Commit 159e7b3

Browse files
added fixes for iOS-26
- picked code from PR - Fix ios 17.1+ issue slackhq#204 - Update PanModalPresentationDelegate.swift slackhq#209
1 parent b2f5bd7 commit 159e7b3

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

PanModal/Controller/PanModalPresentationController.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ open class PanModalPresentationController: UIPresentationController {
177177
guard let containerView = containerView
178178
else { return }
179179

180+
if self.panContainerView.frame == .zero {
181+
self.adjustPresentedViewFrame()
182+
}
183+
180184
layoutBackgroundView(in: containerView)
181185
layoutPresentedView(in: containerView)
182186
configureScrollViewInsets()

PanModal/Delegate/PanModalPresentationDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ extension PanModalPresentationDelegate: UIViewControllerTransitioningDelegate {
5252
Changes in size class during presentation are handled via the adaptive presentation delegate
5353
*/
5454
public func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? {
55-
let controller = PanModalPresentationController(presentedViewController: presented, presenting: presenting)
55+
let controller = PanModalPresentationController(presentedViewController: presented, presenting: presenting ?? source)
5656
controller.delegate = self
5757
return controller
5858
}

0 commit comments

Comments
 (0)