Created
October 2, 2018 21:19
-
-
Save ryanmeisters/ecdfc7e2146ce9acea8b85abf3a8e76c to your computer and use it in GitHub Desktop.
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
private lazy var actionButton: UIButton = UIButton.create { | |
// Do | |
$0.backgroundColor = .blue | |
$0.setTitle(.., for: .normal) | |
// maybe add own constraints? | |
constrainSquare($0, withSideLength: 40) | |
// Don't | |
self.view.addSubview($0) | |
$0.reactive.pressed = Action... | |
} | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Add subview and hook up actions at explicit time | |
view.addSubview(actionButton) | |
actionButton.reactive.pressed = ... | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment