-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathLockedListsView.swift
66 lines (53 loc) · 1.65 KB
/
LockedListsView.swift
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
//
// LockedListsView.swift
// Lockdown
//
// Created by Aliaksandr Dvoineu on 10.05.23.
// Copyright © 2023 Confirmed Inc. All rights reserved.
//
import UIKit
final class LockedListsView: UIView {
// MARK: - Properties
private lazy var image: UIImageView = {
let image = UIImageView()
image.image = UIImage(named: "icn_lock")
image.contentMode = .scaleAspectFit
image.layer.masksToBounds = true
return image
}()
private lazy var descriptionLabel: UILabel = {
let label = UILabel()
label.text = "Upgrade to unlock lists"
label.textColor = .lightGray
label.textAlignment = .center
label.font = fontBold13
label.textAlignment = .center
return label
}()
private lazy var stackView: UIStackView = {
let stackView = UIStackView()
stackView.addArrangedSubview(image)
stackView.addArrangedSubview(descriptionLabel)
stackView.axis = .vertical
stackView.distribution = .fillEqually
stackView.alignment = .center
stackView.spacing = 4
return stackView
}()
// MARK: - Initializer
override init(frame: CGRect) {
super.init(frame: frame)
configure()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
// MARK: Configure UI
func configure() {
addSubview(stackView)
stackView.anchors.top.marginsPin()
stackView.anchors.bottom.marginsPin()
stackView.anchors.leading.marginsPin()
stackView.anchors.trailing.marginsPin()
}
}