Skip to content

Instantly share code, notes, and snippets.

@damijanracel
Last active February 13, 2018 08:35
Show Gist options
  • Save damijanracel/4e2a2410e6c67c632da40025e1e4adc4 to your computer and use it in GitHub Desktop.
Save damijanracel/4e2a2410e6c67c632da40025e1e4adc4 to your computer and use it in GitHub Desktop.
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