Last active
February 13, 2018 08:35
-
-
Save damijanracel/4e2a2410e6c67c632da40025e1e4adc4 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
func set(with user: User) { | |
leftTitleLabel.text = user.name | |
leftSubtitleLabel.text = "Nick: " + user.nickname | |
hideImage() | |
} | |
func set(with pet: Pet) { | |
leftTitleLabel.text = pet.name | |
leftSubtitleLabel.text = "Owner: " + pet.owner | |
rightTitleLabel.text = pet.breed | |
rightSubtitleLabel.text = pet.weight.description | |
iconImageView.image = pet.avatar | |
showImage() | |
} | |
private func showImage() { | |
iconWidthConstraint.constant = 50 | |
iconLeftConstraint.constant = 8 | |
} | |
private func hideImage() { | |
iconWidthConstraint.constant = 0 | |
iconLeftConstraint.constant = 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment