Skip to content

Commit c1171f5

Browse files
committed
Ajustes de PR
1 parent 3f55b2e commit c1171f5

File tree

7 files changed

+26
-803
lines changed

7 files changed

+26
-803
lines changed

solutions/devsprint-caio-santos-7/FinanceApp.xcodeproj/project.pbxproj

Lines changed: 0 additions & 795 deletions
This file was deleted.

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +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 = UINavigationController(rootViewController: ContactListViewController())
19-
self.window?.rootViewController = ContactListViewController()
18+
self.window?.rootViewController = TabBarViewController()
2019
self.window?.windowScene = windowScene
2120
self.window?.makeKeyAndVisible()
2221
}

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,14 @@ struct HomeViewConfiguration {
1111
let homeData: HomeData
1212
}
1313

14+
protocol HomeViewDelegate: AnyObject {
15+
func didSelectActivity()
16+
}
17+
1418
final class HomeView: UIView {
1519
private var activities: [Activity] = []
16-
20+
var delegate: HomeViewDelegate?
21+
1722
private lazy var accountSummaryView: AccountSummaryView = {
1823
let element = AccountSummaryView()
1924
element.translatesAutoresizingMaskIntoConstraints = false
@@ -26,6 +31,7 @@ final class HomeView: UIView {
2631
tableView.register(ActivityCellView.self, forCellReuseIdentifier: ActivityCellView.reuseIdentifier)
2732
tableView.register(UITableViewCell.self, forCellReuseIdentifier: UITableViewCell.reuseIdentifier)
2833
tableView.dataSource = self
34+
tableView.delegate = self
2935
return tableView
3036
}()
3137

@@ -74,7 +80,7 @@ private extension HomeView {
7480
}
7581
}
7682

77-
extension HomeView: UITableViewDataSource {
83+
extension HomeView: UITableViewDataSource, UITableViewDelegate {
7884
public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
7985
return activities.count
8086
}
@@ -89,5 +95,10 @@ extension HomeView: UITableViewDataSource {
8995
cell.updateValues(activity: activities[indexPath.row])
9096
return cell
9197
}
98+
99+
100+
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
101+
delegate?.didSelectActivity()
102+
}
92103
}
93104

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

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

1919
override func viewDidLoad() {
20+
homeView.delegate = self
2021
customNavBar()
2122
profilePictureNavBar()
2223

@@ -56,3 +57,10 @@ class HomeViewController: UIViewController {
5657
navigationItem.rightBarButtonItem = rightBarButton
5758
}
5859
}
60+
61+
62+
extension HomeViewController: HomeViewDelegate {
63+
func didSelectActivity() {
64+
present(ContactListViewController(), animated: true)
65+
}
66+
}

solutions/devsprint-caio-santos-7/FinanceAppTests/Screens/ContactList/Cells/ContactListTableViewCellTests.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ final class ContactListTableViewCellTests: XCTestCase {
1717
// SnapshotTesting.isRecording = true
1818
}
1919

20-
21-
2220
private func testRenderView() {
2321
cell.backgroundColor = .white
24-
assertSnapshot(matching: cell, as: .image(size: CGSize(width: UIScreen.main.bounds.width, height: 64)))
22+
assertSnapshot(matching: cell, as: .image(size: CGSize(width: UIScreen.main.bounds.width,
23+
height: 64)))
2524
}
2625
}

solutions/devsprint-caio-santos-7/FinanceAppTests/Screens/ContactList/ContactListViewTests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ final class ContactListViewTests: XCTestCase {
1717

1818
private func testRenderView() {
1919
let component = ContactListView()
20-
assertSnapshot(matching: component, as: .image(size: CGSize(width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height)))
20+
assertSnapshot(matching: component, as: .image(size: CGSize(width: UIScreen.main.bounds.width,
21+
height: UIScreen.main.bounds.height)))
2122
}
2223
}

0 commit comments

Comments
 (0)