Created
September 26, 2020 16:11
-
-
Save yabenatti/4ef62a5e67c44335ed5b932cf55fd252 to your computer and use it in GitHub Desktop.
ConstraintViewController
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
import UIKit | |
class ViewController: UIViewController { | |
let titleLabel: UILabel = { | |
let label = UILabel() | |
label.text = "Hello Constraints" | |
label.backgroundColor = .red | |
label.translatesAutoresizingMaskIntoConstraints = false | |
return label | |
}() | |
let hiButton: UIButton = { | |
let button = UIButton() | |
button.setTitle("Hi!", for: .normal) | |
button.backgroundColor = .blue | |
button.translatesAutoresizingMaskIntoConstraints = false | |
return button | |
}() | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
view.backgroundColor = .white | |
// CALL ONE OF THE SETUPS HERE | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment