Created
October 18, 2020 09:02
-
-
Save IsaAliev/e784ae96690a5afae983b049ed82c7e7 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 NamedImageCell: UICollectionViewCell, ViewRepresentable { | |
private weak var imageView: UIImageView! | |
private weak var nameLabel: UILabel! | |
var model: NamedImageCellModel! { | |
didSet { | |
setupViewModel() | |
} | |
} | |
override init(frame: CGRect) { | |
super.init(frame: frame) | |
setupViews() | |
} | |
required init?(coder: NSCoder) { | |
fatalError("init(coder:) has not been implemented") | |
} | |
func bindWithModel() { | |
imageView.image = UIImage(contentsOfFile: model.imageFilePath) | |
nameLabel.text = model.name | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment