AnalysisHeaderViewCell.swift
1.7 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
//
// AnalysisHeaderViewCell.swift
// SwiftWarplyFramework
//
// Created by Manos Chorianopoulos on 18/7/22.
//
import UIKit
class AnalysisHeaderViewCell: UITableViewCell {
// attributes
@IBOutlet weak var itemImage: UIImageView!
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var emptyLabel: UILabel!
@IBOutlet weak var emptyLabelHeight: NSLayoutConstraint!
@IBOutlet weak var emptyLabelTopSpace: NSLayoutConstraint!
@IBOutlet weak var emptyLabelBottomSpace: NSLayoutConstraint!
// lifecycle
override func awakeFromNib() {
super.awakeFromNib()
// image
// itemImage.image = UIImage(named: "ic_gift_circle_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
// title
// titleLabel.textColor = UIColor(rgb: 0x435563)
// titleLabel.text = "Αναλυτικά:"
}
}
extension AnalysisHeaderViewCell {
func configureCell(isEmpty: Bool, isMarket: Bool) {
if (isEmpty == true) {
emptyLabel.isHidden = false
emptyLabelHeight.constant = 18.5
// emptyLabelTopSpace.constant = 30.0
emptyLabelBottomSpace.constant = 10.0
} else {
emptyLabel.isHidden = true
emptyLabelHeight.constant = 0.0
// emptyLabelTopSpace.constant = 0.0
emptyLabelBottomSpace.constant = 0.0
}
if (isMarket == true) {
itemImage.image = UIImage(named: "ic_history_market", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
} else {
itemImage.image = UIImage(named: "ic_gift_history", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
}
}
}