AutoCat/AutoCat/Cells/VehiclePhotoCell.swift
2020-02-24 01:30:42 +03:00

23 lines
618 B
Swift

import UIKit
import MagazineLayout
import Kingfisher
class VehiclePhotoCell: MagazineLayoutCollectionViewCell {
@IBOutlet weak var photo: UIImageView!
@IBOutlet weak var model: UILabel!
@IBOutlet weak var date: UILabel!
override func prepareForReuse() {
super.prepareForReuse()
self.photo.kf.cancelDownloadTask()
}
func configure(with photoModel: VehiclePhoto) {
if let url = URL(string: photoModel.url) {
self.photo.kf.setImage(with: url)
}
self.model.text = "\(photoModel.brand ?? "") \(photoModel.model ?? "")"
}
}