diff --git a/PanModal/View/PanContainerView.swift b/PanModal/View/PanContainerView.swift index f5c2892b..b502c7bd 100644 --- a/PanModal/View/PanContainerView.swift +++ b/PanModal/View/PanContainerView.swift @@ -15,17 +15,23 @@ import UIKit having to do those changes directly on the view */ class PanContainerView: UIView { - - init(presentedView: UIView, frame: CGRect) { - super.init(frame: frame) - addSubview(presentedView) - } - - @available(*, unavailable) - required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - + private let presentedView: UIView + + init(presentedView: UIView, frame: CGRect) { + self.presentedView = presentedView + super.init(frame: frame) + addSubview(presentedView) + } + + @available(*, unavailable) + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func layoutSubviews() { + super.layoutSubviews() + self.presentedView.frame.origin = .zero + } } extension UIView {