HomeFoodItem.swift 688 B

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // HomeFoodItem.swift
  3. // ADHTuanCan
  4. //
  5. // Created by 敖德亨 on 2023/9/28.
  6. //
  7. import UIKit
  8. class HomeFoodItem: UICollectionViewCell {
  9. @IBOutlet weak var foodImg: UIImageView!
  10. @IBOutlet weak var nameLab: UILabel!
  11. @IBOutlet weak var priceLab: UILabel!
  12. override func awakeFromNib() {
  13. super.awakeFromNib()
  14. }
  15. func configData(dataModel : HomeFoodDetailModel){
  16. self.foodImg.sd_setImage(url: URL.init(string: dataModel.link ?? "") ,placeHolderImage: UIImage.init(named: "placeHolderImage"))
  17. self.nameLab.text = dataModel.name
  18. self.priceLab.text = "s$\(dataModel.price ?? "")"
  19. }
  20. }