PanModal Portrait to Landscape Issue (#53)

* Fix issue where transitioning from portrait to landscape would cause a PanModal's view to disappear if its height was short

* improve transitioning to landscape fix
This commit is contained in:
Santos 2019-10-04 14:45:16 -04:00 committed by Stephen Sowole
parent 6b1edd1dfb
commit 9d73db3919
1 changed files with 6 additions and 1 deletions

View File

@ -226,7 +226,6 @@ public class PanModalPresentationController: UIPresentationController {
else { return }
self.adjustPresentedViewFrame()
if presentable.shouldRoundTopCorners {
self.addRoundedCorners(to: self.presentedView)
}
@ -367,7 +366,13 @@ private extension PanModalPresentationController {
else { return }
let adjustedSize = CGSize(width: frame.size.width, height: frame.size.height - anchoredYPosition)
let panFrame = panContainerView.frame
panContainerView.frame.size = frame.size
if ![shortFormYPosition, longFormYPosition].contains(panFrame.origin.y) {
adjust(toYPosition: panFrame.origin.y - panFrame.height + frame.height)
}
panContainerView.frame.origin.x = frame.origin.x
presentedViewController.view.frame = CGRect(origin: .zero, size: adjustedSize)
}