diff --git a/PanModal/Controller/PanModalPresentationController.swift b/PanModal/Controller/PanModalPresentationController.swift index ee70fe0..0f997b1 100644 --- a/PanModal/Controller/PanModalPresentationController.swift +++ b/PanModal/Controller/PanModalPresentationController.swift @@ -362,9 +362,12 @@ private extension PanModalPresentationController { Reduce height of presentedView so that it sits at the bottom of the screen */ func adjustPresentedViewFrame() { - let frame = containerView?.frame ?? .zero + + guard let frame = containerView?.frame + else { return } + let adjustedSize = CGSize(width: frame.size.width, height: frame.size.height - anchoredYPosition) - presentedView.frame.size = frame.size + panContainerView.frame.size = frame.size presentedViewController.view.frame = CGRect(origin: .zero, size: adjustedSize) }