Skip to content

Commit 845d193

Browse files
authored
Merge pull request #8 from lauramarson/viewChanges
View changes
2 parents 4577e94 + 7497f8b commit 845d193

6 files changed

Lines changed: 964 additions & 16 deletions

File tree

AnimalsApp/AnimalsApp.xcodeproj/project.pbxproj.orig

Lines changed: 927 additions & 0 deletions
Large diffs are not rendered by default.

AnimalsApp/AnimalsApp/Assets.xcassets/Icons/addFavorite.imageset/Contents.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"version" : 1
2222
},
2323
"properties" : {
24+
"localizable" : true,
2425
"template-rendering-intent" : "original"
2526
}
2627
}

AnimalsApp/AnimalsApp/Views/DetailViewController/DetailViewController.swift

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,23 @@ class DetailViewController: UIViewController {
1111

1212
override func viewDidLoad() {
1313
super.viewDidLoad()
14-
14+
15+
setNavigationItems()
1516
}
1617

17-
func setupNavBar() {
18+
private func setNavigationItems() {
19+
title = "Detalhes"
20+
1821
let appearance = UINavigationBarAppearance()
1922
appearance.configureWithOpaqueBackground()
23+
appearance.titleTextAttributes = [
24+
NSAttributedString.Key.foregroundColor: UIColor.blueTextColor ?? UIColor.blue,
25+
NSAttributedString.Key.font: UIFont(name: "OpenSans", size: 20) ?? UIFont.systemFont(ofSize: 20)]
2026
navigationController?.navigationBar.standardAppearance = appearance
2127
navigationController?.navigationBar.scrollEdgeAppearance = navigationController?.navigationBar.standardAppearance
28+
29+
navigationController?.navigationBar.tintColor = UIColor.blueTextColor
30+
2231
}
2332

2433
}

AnimalsApp/AnimalsApp/Views/FavoritesViewController/FavoritesViewController.swift

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,19 @@ class FavoritesViewController: UIViewController {
1212
override func viewDidLoad() {
1313
super.viewDidLoad()
1414

15-
view.backgroundColor = .blue
15+
setNavigationItems()
1616
}
1717

18-
19-
/*
20-
// MARK: - Navigation
21-
22-
// In a storyboard-based application, you will often want to do a little preparation before navigation
23-
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
24-
// Get the new view controller using segue.destination.
25-
// Pass the selected object to the new view controller.
18+
private func setNavigationItems() {
19+
title = "Favoritos"
20+
21+
let appearance = UINavigationBarAppearance()
22+
appearance.configureWithOpaqueBackground()
23+
appearance.titleTextAttributes = [
24+
NSAttributedString.Key.foregroundColor: UIColor.blueTextColor ?? UIColor.blue,
25+
NSAttributedString.Key.font: UIFont(name: "OpenSans", size: 20) ?? UIFont.systemFont(ofSize: 20)]
26+
navigationController?.navigationBar.standardAppearance = appearance
27+
navigationController?.navigationBar.scrollEdgeAppearance = navigationController?.navigationBar.standardAppearance
2628
}
27-
*/
2829

2930
}

AnimalsApp/AnimalsApp/Views/HomeViewController/HomeViewController.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ class HomeViewController: UIViewController {
3737
NSAttributedString.Key.font: UIFont(name: "OpenSans", size: 20) ?? UIFont.systemFont(ofSize: 20)]
3838
navigationController?.navigationBar.standardAppearance = appearance
3939
navigationController?.navigationBar.scrollEdgeAppearance = navigationController?.navigationBar.standardAppearance
40+
41+
navigationItem.backButtonTitle = ""
4042
}
4143

4244
private func populateTableView() {
@@ -70,12 +72,13 @@ extension HomeViewController: UITableViewDataSource {
7072
extension HomeViewController: UITableViewDelegate {
7173

7274
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
73-
print("entrou")
7475
let detailVC = DetailViewController(nibName: "DetailViewController", bundle: nil)
7576

7677
//continuar
7778

7879
navigationController?.pushViewController(detailVC, animated: true)
80+
81+
tableView.deselectRow(at: indexPath, animated: true)
7982
}
8083

8184
}

AnimalsApp/AnimalsApp/Views/RegisterViewController/RegisterViewController.swift

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class RegisterViewController: UIViewController {
3131
override func viewDidLoad() {
3232
super.viewDidLoad()
3333
setupUI()
34-
setNavigationItens()
34+
setNavigationItems()
3535
delegateTextField()
3636
}
3737

@@ -42,9 +42,16 @@ class RegisterViewController: UIViewController {
4242
}
4343

4444
// MARK: Methods
45-
private func setNavigationItens() {
45+
private func setNavigationItems() {
4646
title = "Cadastrar"
47-
navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor(named: "blueTabBarColor") ?? ""]
47+
48+
let appearance = UINavigationBarAppearance()
49+
appearance.configureWithOpaqueBackground()
50+
appearance.titleTextAttributes = [
51+
NSAttributedString.Key.foregroundColor: UIColor.blueTextColor ?? UIColor.blue,
52+
NSAttributedString.Key.font: UIFont(name: "OpenSans", size: 20) ?? UIFont.systemFont(ofSize: 20)]
53+
navigationController?.navigationBar.standardAppearance = appearance
54+
navigationController?.navigationBar.scrollEdgeAppearance = navigationController?.navigationBar.standardAppearance
4855
}
4956

5057
private func setupUI() {

0 commit comments

Comments
 (0)