Created
April 3, 2021 16:44
-
-
Save lammertw/f3b4534e34bedcfd28ebbed9bf62b204 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
class CountViewController: UIViewController { | |
private let countLabel = UILabel() | |
var count = 0 { | |
didSet { | |
countLabel.text = "Current count: \(count)" | |
} | |
} | |
init() { | |
super.init(nibName: nil, bundle: nil) | |
} | |
required init?(coder: NSCoder) { | |
fatalError("init(coder:) has not been implemented") | |
} | |
override func viewDidLoad() { | |
count = 0 | |
view.addSubview(countLabel) | |
// add contrainsts for positioning ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment