Created
December 11, 2016 20:57
-
-
Save Eluss/f72bd4830a6f0a818281c468f666ee94 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 PersonView: UIView { | |
private var titleLabel: UILabel! | |
private var birthdayLabel: UILabel! | |
private var workButton: UIButton! | |
private var person: Person | |
private var dateFormatter = DateFormatter() | |
init(person: Person) { | |
self.person = person | |
super.init(frame: .zero) | |
setupView() | |
} | |
private func setupView() { | |
dateFormatter.dateStyle = .short | |
birthdayLabel.text = dateFormatter.string(from: person.birthday) | |
titleLabel.text = person.firstName + person.lastName | |
} | |
func workButtonTapped() { | |
// Some complicated logic | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment