Skip to content

Commit b02cccc

Browse files
committed
PR adjustments
1 parent 795b872 commit b02cccc

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
lines changed

solutions/devsprint-caio-santos-7/FinanceApp/Screens/Home/HomeView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ private extension HomeView {
6363

6464
func configureSubviewsConstraints() {
6565
NSLayoutConstraint.activate([
66-
accountSummaryView.topAnchor.constraint(equalTo: safeAreaLayoutGuide.topAnchor),
66+
accountSummaryView.topAnchor.constraint(equalTo: safeAreaLayoutGuide.topAnchor, constant: 16),
6767
accountSummaryView.leadingAnchor.constraint(equalTo: safeAreaLayoutGuide.leadingAnchor, constant: 16),
6868
accountSummaryView.trailingAnchor.constraint(equalTo: safeAreaLayoutGuide.trailingAnchor, constant: -16),
6969

solutions/devsprint-caio-santos-7/FinanceApp/Screens/Home/HomeViewController.swift

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,6 @@ class HomeViewController: UIViewController {
1717
}()
1818

1919
override func viewDidLoad() {
20-
21-
func customNavBar(){
22-
let configNavBar = UINavigationBarAppearance()
23-
configNavBar.backgroundColor = UIColor.systemBackground
24-
navigationController?.navigationBar.standardAppearance = configNavBar
25-
navigationController?.navigationBar.scrollEdgeAppearance = configNavBar
26-
}
27-
28-
func profilePictureNavBar(){
29-
let profilePicture = UIView(frame: CGRect(x: 0, y: 0, width: 40, height: 40))
30-
let image = UIImageView(frame: CGRect(x: 0, y: 0, width: 40, height: 40))
31-
image.image = UIImage(named: "avatar-placeholder")
32-
image.contentMode = .scaleAspectFit
33-
image.layer.cornerRadius = 22.5
34-
image.layer.masksToBounds = true
35-
profilePicture.addSubview(image)
36-
let rightBarButton = UIBarButtonItem(customView: profilePicture)
37-
navigationItem.rightBarButtonItem = rightBarButton
38-
}
39-
4020
customNavBar()
4121
profilePictureNavBar()
4222

@@ -56,4 +36,23 @@ class HomeViewController: UIViewController {
5636
override func loadView() {
5737
self.view = homeView
5838
}
39+
40+
private func customNavBar() {
41+
let configNavBar = UINavigationBarAppearance()
42+
configNavBar.backgroundColor = UIColor.systemBackground
43+
navigationController?.navigationBar.standardAppearance = configNavBar
44+
navigationController?.navigationBar.scrollEdgeAppearance = configNavBar
45+
}
46+
47+
private func profilePictureNavBar() {
48+
let profilePicture = UIView(frame: CGRect(x: 0, y: 0, width: 40, height: 40))
49+
let image = UIImageView(frame: CGRect(x: 0, y: 0, width: 40, height: 40))
50+
image.image = UIImage(named: "avatar-placeholder")
51+
image.contentMode = .scaleAspectFit
52+
image.layer.cornerRadius = 22.5
53+
image.layer.masksToBounds = true
54+
profilePicture.addSubview(image)
55+
let rightBarButton = UIBarButtonItem(customView: profilePicture)
56+
navigationItem.rightBarButtonItem = rightBarButton
57+
}
5958
}

0 commit comments

Comments
 (0)