Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private extension HomeView {

func configureSubviewsConstraints() {
NSLayoutConstraint.activate([
accountSummaryView.topAnchor.constraint(equalTo: safeAreaLayoutGuide.topAnchor),
accountSummaryView.topAnchor.constraint(equalTo: safeAreaLayoutGuide.topAnchor, constant: 16),
accountSummaryView.leadingAnchor.constraint(equalTo: safeAreaLayoutGuide.leadingAnchor, constant: 16),
accountSummaryView.trailingAnchor.constraint(equalTo: safeAreaLayoutGuide.trailingAnchor, constant: -16),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class HomeViewController: UIViewController {
}()

override func viewDidLoad() {
navigationItem.title = "Finance App 💰"
navigationController?.navigationBar.prefersLargeTitles = true
customNavBar()
profilePictureNavBar()

service.fetchHomeData { homeData in
guard let homeData = homeData else {
Expand All @@ -36,4 +36,23 @@ class HomeViewController: UIViewController {
override func loadView() {
self.view = homeView
}

private func customNavBar() {
let configNavBar = UINavigationBarAppearance()
configNavBar.backgroundColor = UIColor.systemBackground
navigationController?.navigationBar.standardAppearance = configNavBar
navigationController?.navigationBar.scrollEdgeAppearance = configNavBar
}

private func profilePictureNavBar() {
let profilePicture = UIView(frame: CGRect(x: 0, y: 0, width: 40, height: 40))
let image = UIImageView(frame: CGRect(x: 0, y: 0, width: 40, height: 40))
image.image = UIImage(named: "avatar-placeholder")
image.contentMode = .scaleAspectFit
image.layer.cornerRadius = 22.5
image.layer.masksToBounds = true
profilePicture.addSubview(image)
let rightBarButton = UIBarButtonItem(customView: profilePicture)
navigationItem.rightBarButtonItem = rightBarButton
}
}