Created
August 1, 2017 03:16
-
-
Save llinardos/6f56966dbb8cf070f0bf2b7380669f12 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 showUserPhoto(for user: User, on imageView: UIImageView, placeholderImage: UIImage? = nil) { | |
if let photoImage = user.photoImage else { | |
imageView.image = photoImage | |
} else if let photoUrl = user.photoUrl else { | |
imageView.sd_setImageWithURL(photoUrl, placeholderImage:placeholderImage) | |
} else { | |
imageView.image = placeholderImage | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment