Skip to content

Commit c5d9af6

Browse files
author
Cleber Silva dos Reis
committed
feat[ProfileHeaderView]: Correções PR
1 parent c9f1866 commit c5d9af6

File tree

2 files changed

+14
-24
lines changed

2 files changed

+14
-24
lines changed

solutions/devsprint-caio-santos-7/FinanceApp/Screens/UserProfile/UserProfileHeaderView.swift

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,8 @@
77

88
import UIKit
99

10-
final class UserProfileHeaderView: UIView {
11-
12-
private lazy var stackViewProfile: UIStackView = {
13-
let stack = UIStackView()
14-
stack.translatesAutoresizingMaskIntoConstraints = false
15-
stack.axis = .vertical
16-
stack.spacing = 8
17-
stack.alignment = .center
10+
final class UserProfileHeaderView: UIStackView {
1811

19-
return stack
20-
}()
21-
2212
private lazy var profileImage: UIImageView = {
2313
let image = UIImageView()
2414
image.translatesAutoresizingMaskIntoConstraints = false
@@ -77,33 +67,33 @@ final class UserProfileHeaderView: UIView {
7767
}
7868

7969
@available(*, unavailable)
80-
required init?(coder: NSCoder) {
70+
required init(coder: NSCoder) {
8171
fatalError("init(coder:) has not been implemented")
8272
}
73+
8374
}
8475

8576
extension UserProfileHeaderView: ViewCodable {
8677

8778
func buildHierarchy() {
88-
addSubview(stackViewProfile)
89-
stackViewProfile.addArrangedSubview(profileImage)
90-
stackViewProfile.addArrangedSubview(titleLabel)
91-
stackViewProfile.addArrangedSubview(agencyLabel)
92-
stackViewProfile.addArrangedSubview(accountLabel)
93-
stackViewProfile.addArrangedSubview(bankLabel)
79+
addArrangedSubview(profileImage)
80+
addArrangedSubview(titleLabel)
81+
addArrangedSubview(agencyLabel)
82+
addArrangedSubview(accountLabel)
83+
addArrangedSubview(bankLabel)
9484
}
9585

9686
func setupConstraints() {
9787
NSLayoutConstraint.activate([
98-
stackViewProfile.topAnchor.constraint(equalTo: safeAreaLayoutGuide.topAnchor, constant: 16),
99-
stackViewProfile.leadingAnchor.constraint(equalTo: safeAreaLayoutGuide.leadingAnchor),
100-
stackViewProfile.trailingAnchor.constraint(equalTo: safeAreaLayoutGuide.trailingAnchor),
101-
stackViewProfile.bottomAnchor.constraint(equalTo: safeAreaLayoutGuide.bottomAnchor, constant: -16),
102-
10388
profileImage.heightAnchor.constraint(equalToConstant: 80),
10489
profileImage.widthAnchor.constraint(equalToConstant: 80),
10590
])
10691
}
10792

108-
93+
func applyAdditionalChanges() {
94+
translatesAutoresizingMaskIntoConstraints = false
95+
axis = .vertical
96+
spacing = 8
97+
alignment = .center
98+
}
10999
}

0 commit comments

Comments
 (0)