Open churabou opened 6 years ago
使い方
final class ResultPopUpView: BasePopUpView {
// called after viewdidload
override func setUpView(parent: UIView) {
parent.backgroundColor = UIColor(white: 0, alpha: 0.3)
parent.addSubview(self)
backgroundColor = .blue
bounds.size = CGSize(width: 300, height: 400)
center = parent.center
addSubview(doneButton)
doneButton.frame = .init(x: 20, y: 300, width: 260, height: 80)
}
private lazy var doneButton: UIButton = {
let b = UIButton()
b.setTitle("完了", for: .normal)
b.setTitleColor(.white, for: .normal)
b.backgroundColor = .white
b.addTarget(self, action: #selector(actionClose), for: .touchUpInside)
return b
}()
@objc private func actionClose() {
controller?.dismiss(animated: true, completion: nil)
}
}
let c = PopUpController(contentView: ResultPopUpView())
present(c, animated: true, completion: nil)