From 63c1a6c9c96d87a76a11412834030a52e49c1248 Mon Sep 17 00:00:00 2001 From: firvorski Date: Sun, 9 Aug 2020 18:40:28 +0100 Subject: [PATCH] use containerView height instead of UIScreen height this helps position the popup correctly in the iPad's split screen mode --- .../BottomPopupPresentationController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BottomPopup/BottomPopupController/BottomPopupPresentationController.swift b/BottomPopup/BottomPopupController/BottomPopupPresentationController.swift index d11965c..c830205 100644 --- a/BottomPopup/BottomPopupController/BottomPopupPresentationController.swift +++ b/BottomPopup/BottomPopupController/BottomPopupPresentationController.swift @@ -14,7 +14,7 @@ final class BottomPopupPresentationController: UIPresentationController { override var frameOfPresentedViewInContainerView: CGRect { get { - return CGRect(origin: CGPoint(x: 0, y: UIScreen.main.bounds.size.height - attributesDelegate.popupHeight), size: CGSize(width: presentedViewController.view.frame.size.width, height: attributesDelegate.popupHeight)) + return CGRect(origin: CGPoint(x: 0, y: containerView!.bounds.size.height - attributesDelegate.popupHeight), size: CGSize(width: presentedViewController.view.frame.size.width, height: attributesDelegate.popupHeight)) } }