// // OrderAddressCell.swift // ADHTuanCan // // Created by 敖德亨 on 2023/11/4. // import UIKit class OrderAddressCell: UITableViewCell { @IBOutlet weak var isDefualLab: UILabel! @IBOutlet weak var selectBtn: UIButton! @IBOutlet weak var nameLab: UILabel! @IBOutlet weak var phoneLab: UILabel! @IBOutlet weak var addressLab: UILabel! @IBOutlet weak var postCodeLab: UILabel! var addressModel : AddressModel? var selectBlock : (()->Void)? var editBlock : (()->Void)? override func awakeFromNib() { super.awakeFromNib() // Initialization code } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } func configModel(model : AddressModel){ self.addressModel = model self.nameLab.text = "\(model.receiving ?? "")" self.phoneLab.text = "\(model.phoneNum ?? "")" if model.isDefault == "1"{ self.isDefualLab.isHidden = false self.selectBtn.isSelected = true }else{ self.isDefualLab.isHidden = true self.selectBtn.isSelected = false } self.addressLab.text = "\(model.street ?? "")\(model.detailAddress ?? "")" self.postCodeLab.text = "\(model.postcode ?? "")" } @IBAction func editAction(_ sender: UIButton) { if self.editBlock != nil{ self.editBlock!() } } @IBAction func selectAction(_ sender: UIButton) { } }