EditInfoView.swift
2.5 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
71
72
73
74
75
76
77
78
79
80
81
82
//
// EditInfoView.swift
// InterQR-Internship
//
// Created by Дмитрий Тимофеев on 08.06.2022.
//
import UIKit
class EditInfoView: UIView {
var editImage: UIImageView = {
var obj = UIImageView()
obj.image = UIImage(named: "Edit")
obj.contentMode = .scaleAspectFill
return obj
}()
var titleLabel: UILabel = {
var obj = UILabel()
obj.text = "Edit residents"
obj.textColor = UIColor(red: 0.196, green: 0.216, blue: 0.333, alpha: 1)
obj.font = .skModernist(type: .bold, ofSize: 16)
return obj
}()
var descriptionLabel: UILabel = {
var obj = UILabel()
obj.text = "Edit the residents and their information"
obj.textColor = UIColor(red: 0.725, green: 0.725, blue: 0.725, alpha: 1)
obj.font = .skModernist(type: .regular, ofSize: 14)
return obj
}()
var editButton: UIButton = {
var obj = UIButton()
obj.setImage(UIImage(named: "NextPointer"), for: .normal)
return obj
}()
var dividingLineView: UIView = {
var view = UIView()
view.backgroundColor = UIColor(red: 246/255, green: 246/255, blue: 246/255, alpha: 1)
return view
}()
override init(frame: CGRect) {
super.init(frame: frame)
layout()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func layout() {
addSubview(editImage)
addSubview(titleLabel)
addSubview(descriptionLabel)
addSubview(editButton)
addSubview(dividingLineView)
editImage.snp.makeConstraints {
$0.top.equalTo(snp.top).offset(26)
$0.leading.equalTo(snp.leading).offset(32)
$0.height.width.equalTo(18)
}
titleLabel.snp.makeConstraints {
$0.top.equalTo(snp.top).offset(26)
$0.leading.equalTo(editImage.snp.trailing).offset(15)
}
descriptionLabel.snp.makeConstraints {
$0.top.equalTo(titleLabel.snp.bottom).offset(5)
$0.leading.equalTo(titleLabel.snp.leading)
}
editButton.snp.makeConstraints {
$0.top.equalTo(snp.top).offset(38)
$0.trailing.equalTo(snp.trailing).offset(-28)
}
dividingLineView.snp.makeConstraints {
$0.height.equalTo(1)
$0.top.equalTo(descriptionLabel.snp.bottom).offset(22)
$0.trailing.leading.equalToSuperview().inset(32)
}
}
}