Skip to content

Instantly share code, notes, and snippets.

@matdziu
Created February 27, 2019 09:17
Show Gist options
  • Select an option

  • Save matdziu/d36221320817f9c6db936ab8464c34cf to your computer and use it in GitHub Desktop.

Select an option

Save matdziu/d36221320817f9c6db936ab8464c34cf to your computer and use it in GitHub Desktop.
import UIKit
class CollectionGameCell: UITableViewCell {
@IBOutlet weak var gameNameLabel: UILabel!
@IBOutlet weak var yearPublishedLabel: UILabel!
@IBOutlet weak var gameImageView: UIImageView!
override func prepareForReuse() {
super.prepareForReuse()
gameImageView.cancel()
gameImageView.image = UIImage(named: Image.boardGamePlaceholder.rawValue)
}
func bind(game: CollectionGame) {
gameNameLabel.text = game.name
yearPublishedLabel.text = game.yearPublished
gameImageView.downloaded(from: game.imageUrl, placeHolder: UIImage(named: Image.boardGamePlaceholder.rawValue))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment