From 3f3124ae37dde77c9a9a764be23fd00a851e50b2 Mon Sep 17 00:00:00 2001 From: Marco Cancellieri Date: Thu, 14 Mar 2019 21:38:02 +0100 Subject: [PATCH] pr comment --- PanModal/Presentable/PanModalPresentable+LayoutHelpers.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PanModal/Presentable/PanModalPresentable+LayoutHelpers.swift b/PanModal/Presentable/PanModalPresentable+LayoutHelpers.swift index d56a3ef..3c13b2a 100644 --- a/PanModal/Presentable/PanModalPresentable+LayoutHelpers.swift +++ b/PanModal/Presentable/PanModalPresentable+LayoutHelpers.swift @@ -92,7 +92,7 @@ extension PanModalPresentable where Self: UIViewController { return bottomYPos - height case .intrinsicHeight: view.layoutIfNeeded() - let targetSize = CGSize(width: (presentingViewController?.view.bounds ?? UIScreen.main.bounds).width, + let targetSize = CGSize(width: (presentedVC?.containerView?.bounds ?? UIScreen.main.bounds).width, height: UIView.layoutFittingCompressedSize.height) let intrinsicHeight = view.systemLayoutSizeFitting(targetSize).height return bottomYPos - (intrinsicHeight + bottomLayoutOffset)