Skip to content

Commit b0df2be

Browse files
Juliane FerreiraJulianeGF
authored andcommitted
Cria PropertyDetailsFactory
1 parent 2b51b2e commit b0df2be

4 files changed

Lines changed: 123 additions & 0 deletions

File tree

solutions/devsprint-andre-nogueira-1/RealEstateApp.xcodeproj/project.pbxproj

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,22 @@
2222
54C4595928077D03004DD3DF /* UIViewController+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54C4595828077D03004DD3DF /* UIViewController+Extensions.swift */; };
2323
54E204C92804EB8C009FFEDC /* AccountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54E204C82804EB8C009FFEDC /* AccountView.swift */; };
2424
54E204CB28051E0A009FFEDC /* AccountViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54E204CA28051E0A009FFEDC /* AccountViewModel.swift */; };
25+
<<<<<<< Updated upstream
2526
8B5548A728061AB400714870 /* LoginModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B5548A628061AB400714870 /* LoginModel.swift */; };
2627
8B5548A928061B8000714870 /* LoginAPIClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B5548A828061B8000714870 /* LoginAPIClient.swift */; };
2728
8BD13BF3281868DF001756F4 /* PropertyInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BD13BF2281868DF001756F4 /* PropertyInfoView.swift */; };
29+
=======
30+
<<<<<<< Updated upstream
31+
=======
32+
<<<<<<< Updated upstream
33+
8B5548A728061AB400714870 /* LoginModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B5548A628061AB400714870 /* LoginModel.swift */; };
34+
8B5548A928061B8000714870 /* LoginAPIClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B5548A828061B8000714870 /* LoginAPIClient.swift */; };
35+
8BD13BF3281868DF001756F4 /* PropertyInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BD13BF2281868DF001756F4 /* PropertyInfoView.swift */; };
36+
=======
37+
8BD13BF528189CE6001756F4 /* PropertyDetailsFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BD13BF428189CE6001756F4 /* PropertyDetailsFactory.swift */; };
38+
>>>>>>> Stashed changes
39+
>>>>>>> Stashed changes
40+
>>>>>>> Stashed changes
2841
980789CB275E8FAF00CED39A /* SettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 980789CA275E8FAF00CED39A /* SettingsViewController.swift */; };
2942
980789CE275E943D00CED39A /* FavoritesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 980789CD275E943C00CED39A /* FavoritesViewController.swift */; };
3043
980789D9275EA3C900CED39A /* AccountViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 980789D8275EA3C900CED39A /* AccountViewController.swift */; };
@@ -80,9 +93,22 @@
8093
54C4595828077D03004DD3DF /* UIViewController+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+Extensions.swift"; sourceTree = "<group>"; };
8194
54E204C82804EB8C009FFEDC /* AccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountView.swift; sourceTree = "<group>"; };
8295
54E204CA28051E0A009FFEDC /* AccountViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountViewModel.swift; sourceTree = "<group>"; };
96+
<<<<<<< Updated upstream
97+
8B5548A628061AB400714870 /* LoginModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginModel.swift; sourceTree = "<group>"; };
98+
8B5548A828061B8000714870 /* LoginAPIClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginAPIClient.swift; sourceTree = "<group>"; };
99+
8BD13BF2281868DF001756F4 /* PropertyInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PropertyInfoView.swift; sourceTree = "<group>"; };
100+
=======
101+
<<<<<<< Updated upstream
102+
=======
103+
<<<<<<< Updated upstream
83104
8B5548A628061AB400714870 /* LoginModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginModel.swift; sourceTree = "<group>"; };
84105
8B5548A828061B8000714870 /* LoginAPIClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginAPIClient.swift; sourceTree = "<group>"; };
85106
8BD13BF2281868DF001756F4 /* PropertyInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PropertyInfoView.swift; sourceTree = "<group>"; };
107+
=======
108+
8BD13BF428189CE6001756F4 /* PropertyDetailsFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PropertyDetailsFactory.swift; sourceTree = "<group>"; };
109+
>>>>>>> Stashed changes
110+
>>>>>>> Stashed changes
111+
>>>>>>> Stashed changes
86112
980789CA275E8FAF00CED39A /* SettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewController.swift; sourceTree = "<group>"; };
87113
980789CD275E943C00CED39A /* FavoritesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FavoritesViewController.swift; sourceTree = "<group>"; };
88114
980789D8275EA3C900CED39A /* AccountViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountViewController.swift; sourceTree = "<group>"; };
@@ -235,6 +261,7 @@
235261
980C0C1B2704F23E00F8100A /* PropertyDetailsViewController.swift */,
236262
A50AC4052808BEC000873216 /* PropertyImageView.swift */,
237263
548DA1EF280D2819000CFFAC /* PropertyDetailsView.swift */,
264+
8BD13BF428189CE6001756F4 /* PropertyDetailsFactory.swift */,
238265
);
239266
path = PropertyDetails;
240267
sourceTree = "<group>";
@@ -467,7 +494,22 @@
467494
543091752811D30F00BDC903 /* DesignSystem.swift in Sources */,
468495
986153D42704EE2B00838CA6 /* PropertyListViewController.swift in Sources */,
469496
984DAACC27EE4A66002F3E8A /* PropertyListView.swift in Sources */,
497+
<<<<<<< HEAD
498+
5498E3B72815B088002BD1C4 /* MapLocationView.swift in Sources */,
499+
=======
500+
<<<<<<< Updated upstream
501+
=======
502+
<<<<<<< Updated upstream
503+
5498E3B72815B088002BD1C4 /* MapLocationView.swift in Sources */,
504+
=======
505+
<<<<<<< Updated upstream
506+
=======
470507
5498E3B72815B088002BD1C4 /* MapLocationView.swift in Sources */,
508+
8BD13BF528189CE6001756F4 /* PropertyDetailsFactory.swift in Sources */,
509+
>>>>>>> Stashed changes
510+
>>>>>>> Stashed changes
511+
>>>>>>> Stashed changes
512+
>>>>>>> b5259ed (Cria PropertyDetailsFactory)
471513
548DA1F0280D2819000CFFAC /* PropertyDetailsView.swift in Sources */,
472514
52E289FA28072CAC009030B3 /* PropertyTableViewCell.swift in Sources */,
473515
B0EDEDC0280643F100B1AB1F /* FavoritesViewModel.swift in Sources */,
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import Foundation
2+
3+
struct PropertyDetailsFactory {
4+
static func createPropertyDetails() -> PropertyDetailsViewController {
5+
let managerUrl = ManagerGetURL()
6+
let apiClientProperty = RealEstateAPIClientProperty(url: managerUrl)
7+
let viewController = PropertyDetailsViewController()
8+
return viewController
9+
}
10+
}

solutions/devsprint-andre-nogueira-1/RealEstateApp/Screens/PropertyList/PropertyListView.swift

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ extension PropertyListView: UITableViewDataSource, UITableViewDelegate {
6060
return self.listItems.count
6161
}
6262

63+
<<<<<<< HEAD
6364
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
6465
guard let propertyCell = tableView.dequeueReusableCell(withIdentifier: PropertyTableViewCell.identifier, for: indexPath) as? PropertyTableViewCell else { return UITableViewCell() }
6566

@@ -70,5 +71,56 @@ extension PropertyListView: UITableViewDataSource, UITableViewDelegate {
7071

7172
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
7273
tableView.deselectRow(at: indexPath, animated: true)
74+
=======
75+
<<<<<<< Updated upstream
76+
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
77+
78+
let cell = tableView.dequeueReusableCell(withIdentifier: PropertyTableViewCell.identifier)!
79+
// cell.textLabel?.text = self.listItems[indexPath.row]
80+
return cell
81+
=======
82+
<<<<<<< Updated upstream
83+
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
84+
guard let propertyCell = tableView.dequeueReusableCell(withIdentifier: PropertyTableViewCell.identifier, for: indexPath) as? PropertyTableViewCell else { return UITableViewCell() }
85+
86+
propertyCell.setup(property: listItems[indexPath.row])
87+
88+
return propertyCell
89+
}
90+
91+
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
92+
tableView.deselectRow(at: indexPath, animated: true)
93+
=======
94+
<<<<<<< Updated upstream
95+
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
96+
97+
let cell = tableView.dequeueReusableCell(withIdentifier: PropertyTableViewCell.identifier)!
98+
// cell.textLabel?.text = self.listItems[indexPath.row]
99+
return cell
100+
=======
101+
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
102+
guard let propertyCell = tableView.dequeueReusableCell(withIdentifier: PropertyTableViewCell.identifier, for: indexPath) as? PropertyTableViewCell else { return UITableViewCell() }
103+
104+
propertyCell.setup(property: listItems[indexPath.row])
105+
106+
return propertyCell
107+
}
108+
}
109+
110+
extension PropertyListView: UITableViewDelegate {
111+
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
112+
let itens = listItems[indexPath.row]
113+
let propertyDetailsFactory = PropertyDetailsFactory.createPropertyDetails()
114+
115+
//TODO: - row do indexpath
116+
//obter o item da listitems na posicao row
117+
//chamar o factory da propertydetails e se nao tiver, criar
118+
//no factory chamar metodo setup obtendo a viewcontroller
119+
//em seguida fazer push nessa viewcontroller e passar o item da listitens para a prox view controller
120+
//na proxima vc preencher a view com o resultado
121+
>>>>>>> Stashed changes
122+
>>>>>>> Stashed changes
123+
>>>>>>> Stashed changes
124+
>>>>>>> b5259ed (Cria PropertyDetailsFactory)
73125
}
74126
}

solutions/devsprint-andre-nogueira-1/RealEstateApp/Screens/PropertyList/PropertyListViewController.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,28 @@ import UIKit
99

1010
class PropertyListViewController: UIViewController {
1111

12+
<<<<<<< HEAD
1213
private let viewModel: PropertyListViewModelProtocol
1314

1415
private let propertyListView: PropertyListView = {
16+
=======
17+
<<<<<<< Updated upstream
18+
=======
19+
<<<<<<< Updated upstream
20+
private let viewModel: PropertyListViewModelProtocol
21+
22+
private let propertyListView: PropertyListView = {
23+
=======
24+
<<<<<<< Updated upstream
25+
=======
26+
private let viewModel: PropertyListViewModelProtocol
27+
private let
28+
29+
private let propertyListView: PropertyListView = {
30+
>>>>>>> Stashed changes
31+
>>>>>>> Stashed changes
32+
>>>>>>> Stashed changes
33+
>>>>>>> b5259ed (Cria PropertyDetailsFactory)
1534
let propertyListView = PropertyListView()
1635
return propertyListView
1736
}()

0 commit comments

Comments
 (0)