CNLiveHangYeFirCell.swift
1.83 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
63
64
65
66
67
68
69
70
//
// CNLiveHangYeFirCell.swift
// metaCode
//
// Created by zx on 2024/7/23.
//
import Foundation
import SnapKit
class CNLiveHangYeFirCell:UITableViewCell{
var _authModel : MineAuthenticationsChildModel?
var authModel : MineAuthenticationsChildModel? {
get{
_authModel
}
set{
_authModel = newValue!
setupNewUI(model: _authModel!)
}
}
var _isSelect = false
var isSelect:Bool{
get{
_isSelect
}
set{
_isSelect = newValue
if _isSelect == true{
self.nameLabel.textColor = HexColor("#1961FE")
self.nameLabel.backgroundColor = .white
}else{
self.nameLabel.textColor = HexColor("#999999")
self.nameLabel.backgroundColor = HexColor("#F6F7FB")
}
}
}
lazy var nameLabel: UILabel = {
let titleLabel = UILabel()
titleLabel.textColor = HexColor("#1961FE")
titleLabel.text = "名称名称"
titleLabel.font = BoldFont_14
titleLabel.textAlignment = .center
titleLabel.adjustsFontSizeToFitWidth = true
return titleLabel
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
self.selectionStyle = .none
self.initUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func initUI(){
self.contentView.addSubview(self.nameLabel)
self.nameLabel.snp.makeConstraints { make in
make.top.bottom.left.right.equalToSuperview()
}
}
func setupNewUI(model:MineAuthenticationsChildModel){
self.nameLabel.text = model.name
}
}