RemoveAdvertTableViewCell.swift
1.84 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
//
// RemoveAdvertTableViewCell.swift
// browser
//
// Created by Artem Talko on 01.10.2023.
//
//MARK: Checked
import UIKit
final class RemoveAdvertTableViewCell: UITableViewCell {
static let cellID = String(describing: RemoveAdvertTableViewCell.self)
let advantagesCellLabel: UILabel = {
let obj = UILabel()
obj.font = FontConstants.regularFont_14
return obj
}()
private let advantagesCellImage: UIImageView = {
let obj = UIImageView()
let checkmarkImg = UIImage(systemName: "checkmark")?.withTintColor(.blue, renderingMode: .alwaysOriginal)
obj.image = checkmarkImg
obj.contentMode = .scaleToFill
return obj
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setup()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private func setup() {
backgroundColor = .clear
contentView.addSubview(advantagesCellLabel)
contentView.addSubview(advantagesCellImage)
setupConstraints()
}
private func setupConstraints() {
advantagesCellImage.snp.makeConstraints { make in
make.top.equalToSuperview().inset(5.sizeH)
make.leading.equalToSuperview()
make.bottom.equalToSuperview().inset(5.sizeH)
make.trailing.equalTo(advantagesCellLabel.snp.leading).offset(-8.sizeW)
}
advantagesCellLabel.snp.makeConstraints { make in
make.top.equalToSuperview().inset(5.sizeH)
make.leading.equalTo(advantagesCellImage.snp.trailing)
make.bottom.equalToSuperview().inset(5.sizeH)
make.trailing.equalToSuperview()
}
}
}