Last active
January 21, 2019 17:18
-
-
Save sagaya/d1a4d88c804e430ab529fa53c1d4cd45 to your computer and use it in GitHub Desktop.
using_generic_controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestViewController: BaseController<OriginalView> { | |
} | |
class TestBaseView: BaseView { | |
public weak var buttonActionDelegate: MyViewActionDelegate? | |
private let button: UIButton = { | |
let button = UIButton(frame: .zero) | |
button.setTitle("View Works", for: .normal) | |
button.setTitleColor(.white, for: .normal) | |
button.setTitleColor(.gray, for: .highlighted) | |
button.backgroundColor = .black | |
button.translatesAutoresizingMaskIntoConstraints = false | |
return button | |
}() | |
override func setupView() { | |
super.setupView() | |
addSubview(button) | |
NSLayoutConstraint.activate([ | |
button.centerXAnchor.constraint(equalTo: centerXAnchor), | |
button.widthAnchor.constraint(equalToConstant: 100), | |
button.heightAnchor.constraint(equalToConstant: 50), | |
button.centerYAnchor.constraint(equalTo: centerYAnchor) | |
]) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment