From 94b2b75cd3fdeeb24e7f34639a6464fc40da8584 Mon Sep 17 00:00:00 2001 From: sooakim Date: Fri, 7 Oct 2022 18:27:22 +0900 Subject: [PATCH] #190 fix bug: adjust presentedView origin in PanContainerView --- PanModal/View/PanContainerView.swift | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) 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 {