// // CouponBoxTableViewCell.swift // GME Remit // // Created by Jeongbae Kong on 03/12/2019. // Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved. // import UIKit class CouponBoxTableViewCell: UITableViewCell { @IBOutlet weak var couponNameLabel: UILabel! @IBOutlet weak var couponExpiryStartDateLabel: UILabel! @IBOutlet weak var couponExpiryEndDateLabel: UILabel! @IBOutlet weak var discountValueLabel: UILabel! @IBOutlet weak var cellContentView: UIView! override func awakeFromNib() { super.awakeFromNib() // Initialization code } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) } func couponBoxModel(with model: CouponBoxModel?) { guard let model = model else { return } cellContentView.layer.borderWidth = 1 cellContentView.layer.borderColor = UIColor.gray.cgColor cellContentView.layer.cornerRadius = 5 couponNameLabel.font = UIFont.sanfrancisco(.medium, size: 17) couponNameLabel.text = model.couponName couponExpiryStartDateLabel.font = UIFont.sanfrancisco(.medium, size: 17) couponExpiryStartDateLabel.text = model.buyDate couponExpiryEndDateLabel.font = UIFont.sanfrancisco(.medium, size: 17) couponExpiryEndDateLabel.text = model.expireDate discountValueLabel.font = UIFont.sanfrancisco(.medium, size: 17) if model.discountType == "1" { discountValueLabel.text = "\(model.discountValue ?? "")%" } else { discountValueLabel.text = "\(model.discountValue ?? "")KRW" } } }