Skip to content

Commit 5882719

Browse files
HSTHST
authored andcommitted
Falta teste snapshot
1 parent d66f994 commit 5882719

File tree

3 files changed

+123
-2
lines changed

3 files changed

+123
-2
lines changed

solutions/devsprint-caio-santos-7/FinanceApp/AppDelegate/SceneDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
1515
guard let windowScene = (scene as? UIWindowScene) else { return }
1616

1717
self.window = UIWindow(frame: UIScreen.main.bounds)
18-
self.window?.rootViewController = TabBarViewController()
18+
self.window?.rootViewController = TransfersViewController()
1919
self.window?.windowScene = windowScene
2020
self.window?.makeKeyAndVisible()
2121
}

solutions/devsprint-caio-santos-7/FinanceApp/Screens/Transfers/TransfersView.swift

Lines changed: 121 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,125 @@
88
import UIKit
99

1010
class TransfersView: UIView {
11-
11+
12+
private lazy var stackViewPrincipal: UIStackView = {
13+
let sv = UIStackView()
14+
sv.translatesAutoresizingMaskIntoConstraints = false
15+
sv.alignment = .center
16+
sv.spacing = 10
17+
sv.axis = .vertical
18+
return sv
19+
}()
20+
21+
private lazy var stackViewSec: UIStackView = {
22+
let sv = UIStackView()
23+
sv.translatesAutoresizingMaskIntoConstraints = false
24+
sv.alignment = .center
25+
sv.spacing = 10
26+
sv.axis = .horizontal
27+
return sv
28+
}()
29+
30+
31+
lazy var centerLabel: UITextField = {
32+
var input = UITextField()
33+
input.translatesAutoresizingMaskIntoConstraints = false
34+
input.keyboardType = .numberPad
35+
input.font = UIFont.boldSystemFont(ofSize: 40)
36+
input.attributedPlaceholder = .init(
37+
string: "$0",
38+
attributes: [NSAttributedString.Key.foregroundColor: UIColor(red: 0.235, green: 0.235, blue: 0.263, alpha: 0.6)]
39+
)
40+
41+
return input
42+
}()
43+
44+
private lazy var to: UILabel = {
45+
let to = UILabel()
46+
to.translatesAutoresizingMaskIntoConstraints = false
47+
to.text = "To"
48+
to.textColor = UIColor(red: 0.235, green: 0.235, blue: 0.263, alpha: 0.6)
49+
to.font = UIFont.systemFont(ofSize: 12)
50+
return to
51+
}()
52+
53+
lazy var buttonContact: UIButton = {
54+
var button = UIButton()
55+
button.translatesAutoresizingMaskIntoConstraints = false
56+
button.backgroundColor = UIColor(red: 0.463, green: 0.463, blue: 0.502, alpha: 0.12)
57+
button.setTitle("Choose contact", for: .normal)
58+
button.titleLabel?.font = UIFont.boldSystemFont(ofSize: 12)
59+
button.setTitleColor(.black, for: .normal)
60+
button.layer.cornerRadius = 15
61+
return button
62+
}()
63+
64+
private lazy var iconGreen: UIView = {
65+
let view = UIView()
66+
view.translatesAutoresizingMaskIntoConstraints = false
67+
view.layer.cornerRadius = 4
68+
view.backgroundColor = .green
69+
return view
70+
}()
71+
72+
lazy var buttonTransfer: UIButton = {
73+
var button = UIButton()
74+
button.translatesAutoresizingMaskIntoConstraints = false
75+
button.backgroundColor = .systemBlue
76+
button.setTitle("Transfer", for: .normal)
77+
button.titleLabel?.font = UIFont.boldSystemFont(ofSize: 15)
78+
button.layer.cornerRadius = 10
79+
return button
80+
}()
81+
82+
83+
override init(frame: CGRect) {
84+
super.init(frame: frame)
85+
backgroundColor = .systemBackground
86+
self.configSetup()
87+
self.setUpContraints()
88+
}
89+
90+
private func configSetup(){
91+
addSubview(stackViewPrincipal)
92+
stackViewPrincipal.addArrangedSubview(centerLabel)
93+
stackViewPrincipal.addArrangedSubview(stackViewSec)
94+
stackViewSec.addArrangedSubview(to)
95+
stackViewSec.addArrangedSubview(buttonContact)
96+
buttonContact.addSubview(iconGreen)
97+
addSubview(buttonTransfer)
98+
99+
100+
}
101+
102+
required init?(coder: NSCoder) {
103+
fatalError("init(coder:) has not been implemented")
104+
}
105+
106+
private func setUpContraints(){
107+
NSLayoutConstraint.activate([
108+
109+
iconGreen.widthAnchor.constraint(equalToConstant: 10),
110+
iconGreen.heightAnchor.constraint(equalToConstant: 10),
111+
iconGreen.centerYAnchor.constraint(equalTo: buttonContact.centerYAnchor),
112+
iconGreen.leadingAnchor.constraint(equalTo: buttonContact.leadingAnchor, constant: 8),
113+
114+
buttonContact.widthAnchor.constraint(equalToConstant: 135),
115+
buttonContact.heightAnchor.constraint(equalToConstant: 30),
116+
117+
stackViewPrincipal.centerYAnchor.constraint(equalTo: safeAreaLayoutGuide.centerYAnchor),
118+
stackViewPrincipal.centerXAnchor.constraint(equalTo: safeAreaLayoutGuide.centerXAnchor),
119+
120+
121+
122+
buttonTransfer.bottomAnchor.constraint(equalTo: safeAreaLayoutGuide.bottomAnchor, constant: -45),
123+
buttonTransfer.heightAnchor.constraint(equalToConstant: 45),
124+
buttonTransfer.leadingAnchor.constraint(equalTo: safeAreaLayoutGuide.leadingAnchor, constant: 45),
125+
buttonTransfer.trailingAnchor.constraint(equalTo: safeAreaLayoutGuide.trailingAnchor, constant: -45),
126+
127+
128+
129+
])
130+
}
131+
12132
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 87d7c7e136caf6392738096dae0568355a0619e3

0 commit comments

Comments
 (0)