WalletActiveCouponCollectionViewCell.swift
2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//
// WalletActiveCouponCollectionViewCell.swift
// SwiftWarplyFramework
//
// Created by Manos Chorianopoulos on 8/5/24.
//
import UIKit
@objc public class WalletActiveCouponCollectionViewCell: UICollectionViewCell {
@IBOutlet weak var badgeViewParent: UIView!
@IBOutlet weak var badgeView: UIView!
@IBOutlet weak var badgeImage: UIImageView!
@IBOutlet weak var badgeLabel: UILabel!
@IBOutlet weak var badgeCountView: UIView!
@IBOutlet weak var badgeCountLabel: UILabel!
public override func awakeFromNib() {
super.awakeFromNib()
// Badge Banner
// badgeViewParent.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1.00)
badgeViewParent.backgroundColor = .white
badgeViewParent.layer.cornerRadius = 16.0
badgeViewParent.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
badgeViewParent.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
badgeViewParent.layer.shadowOpacity = 1.0
badgeViewParent.layer.shadowRadius = 2.0
// badgeView.backgroundColor = UIColor(red: 0.46, green: 0.75, blue: 0.45, alpha: 0.05)
badgeView.backgroundColor = .white
badgeView.layer.cornerRadius = 16.0
badgeCountView.layer.cornerRadius = 4.0
badgeCountView.backgroundColor = UIColor(red: 0.92, green: 0.75, blue: 0.41, alpha: 1.00)
}
func configureCell(badgeId: String, badgeCount: Int) {
if (badgeId == "dfy") {
badgeImage.image = UIImage(named: "wallet_banner_dfy", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
badgeLabel.text = "DEALS FOR YOU"
badgeCountView.isHidden = false
} else if (badgeId == "sm") {
badgeImage.image = UIImage(named: "wallet_banner_sm", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
badgeLabel.text = "SUPERMARKET DEALS"
badgeCountView.isHidden = false
} else if (badgeId == "gfy") {
badgeImage.image = UIImage(named: "wallet_banner_gfy", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
badgeLabel.text = "FREE COUPONS"
badgeCountView.isHidden = false
} else if (badgeId == "box") {
badgeImage.image = UIImage(named: "wallet_banner_box", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
badgeLabel.text = "BOX"
badgeCountView.isHidden = true
}
badgeCountLabel.text = String(badgeCount)
}
}