Files
Woka_Native_iOS/WOKA/Cart/View/CouponCell.swift
BilalKhanWDI bb68fa1e3c - Completed Apply Coupon Functionality
- Made a selection for the coupon selected, also added no coupon found when coupon is not there
- Added Masila view in more section
- Added Play trailer from Manila in more section
- Gave other connectivity
2024-07-24 19:59:08 +05:30

41 lines
1.2 KiB
Swift

//
// CouponCell.swift
// WOKA
//
// Created by MacBook Pro on 23/07/24.
//
import UIKit
class CouponCell: UITableViewCell {
@IBOutlet weak var couponText: LocalisedElementsLabel!
@IBOutlet weak var couponStack: UIStackView!
override func awakeFromNib() {
super.awakeFromNib()
self.backgroundColor = .clear
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
}
func setData(data : CouponListDM.ResultData , isSelected : Bool){
// let double = data.discountValue?.toDouble()
if isSelected{
couponStack.backgroundColor = #colorLiteral(red: 0.7176470588, green: 0.937254902, blue: 0.9960784314, alpha: 1)
}else{
couponStack.backgroundColor = .white
}
if data.discountType == 1{ // Percentage
self.couponText.text = (data.discountValue ?? "0.0") + "% Off with Coupon Code: " + (data.couponCode ?? "NA")
}else{ // Amount
self.couponText.text = K.ConstantString.rupeeSign + " " + (data.discountValue ?? "0.0") + " Off with Coupon Code: " + (data.couponCode ?? "NA")
}
}
}