Skip to content

Commit

Permalink
slackhq#190 fix bug: adjust presentedView origin in PanContainerView
Browse files Browse the repository at this point in the history
  • Loading branch information
sooakim committed Oct 7, 2022
1 parent b2f5bd7 commit 94b2b75
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions PanModal/View/PanContainerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 94b2b75

Please sign in to comment.