Skip to content

Commit b5259ed

Browse files
Juliane FerreiraJulianeGF
authored andcommitted
Cria PropertyDetailsFactory
1 parent 5f15c77 commit b5259ed

4 files changed

Lines changed: 109 additions & 0 deletions

File tree

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

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,22 @@
1818
54C4595928077D03004DD3DF /* UIViewController+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54C4595828077D03004DD3DF /* UIViewController+Extensions.swift */; };
1919
54E204C92804EB8C009FFEDC /* AccountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54E204C82804EB8C009FFEDC /* AccountView.swift */; };
2020
54E204CB28051E0A009FFEDC /* AccountViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54E204CA28051E0A009FFEDC /* AccountViewModel.swift */; };
21+
<<<<<<< Updated upstream
2122
8B5548A728061AB400714870 /* LoginModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B5548A628061AB400714870 /* LoginModel.swift */; };
2223
8B5548A928061B8000714870 /* LoginAPIClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B5548A828061B8000714870 /* LoginAPIClient.swift */; };
2324
8BD13BF3281868DF001756F4 /* PropertyInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BD13BF2281868DF001756F4 /* PropertyInfoView.swift */; };
25+
=======
26+
<<<<<<< Updated upstream
27+
=======
28+
<<<<<<< Updated upstream
29+
8B5548A728061AB400714870 /* LoginModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B5548A628061AB400714870 /* LoginModel.swift */; };
30+
8B5548A928061B8000714870 /* LoginAPIClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B5548A828061B8000714870 /* LoginAPIClient.swift */; };
31+
8BD13BF3281868DF001756F4 /* PropertyInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BD13BF2281868DF001756F4 /* PropertyInfoView.swift */; };
32+
=======
33+
8BD13BF528189CE6001756F4 /* PropertyDetailsFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BD13BF428189CE6001756F4 /* PropertyDetailsFactory.swift */; };
34+
>>>>>>> Stashed changes
35+
>>>>>>> Stashed changes
36+
>>>>>>> Stashed changes
2437
980789CB275E8FAF00CED39A /* SettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 980789CA275E8FAF00CED39A /* SettingsViewController.swift */; };
2538
980789CE275E943D00CED39A /* FavoritesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 980789CD275E943C00CED39A /* FavoritesViewController.swift */; };
2639
980789D9275EA3C900CED39A /* AccountViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 980789D8275EA3C900CED39A /* AccountViewController.swift */; };
@@ -72,9 +85,22 @@
7285
54C4595828077D03004DD3DF /* UIViewController+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+Extensions.swift"; sourceTree = "<group>"; };
7386
54E204C82804EB8C009FFEDC /* AccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountView.swift; sourceTree = "<group>"; };
7487
54E204CA28051E0A009FFEDC /* AccountViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountViewModel.swift; sourceTree = "<group>"; };
88+
<<<<<<< Updated upstream
89+
8B5548A628061AB400714870 /* LoginModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginModel.swift; sourceTree = "<group>"; };
90+
8B5548A828061B8000714870 /* LoginAPIClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginAPIClient.swift; sourceTree = "<group>"; };
91+
8BD13BF2281868DF001756F4 /* PropertyInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PropertyInfoView.swift; sourceTree = "<group>"; };
92+
=======
93+
<<<<<<< Updated upstream
94+
=======
95+
<<<<<<< Updated upstream
7596
8B5548A628061AB400714870 /* LoginModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginModel.swift; sourceTree = "<group>"; };
7697
8B5548A828061B8000714870 /* LoginAPIClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginAPIClient.swift; sourceTree = "<group>"; };
7798
8BD13BF2281868DF001756F4 /* PropertyInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PropertyInfoView.swift; sourceTree = "<group>"; };
99+
=======
100+
8BD13BF428189CE6001756F4 /* PropertyDetailsFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PropertyDetailsFactory.swift; sourceTree = "<group>"; };
101+
>>>>>>> Stashed changes
102+
>>>>>>> Stashed changes
103+
>>>>>>> Stashed changes
78104
980789CA275E8FAF00CED39A /* SettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewController.swift; sourceTree = "<group>"; };
79105
980789CD275E943C00CED39A /* FavoritesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FavoritesViewController.swift; sourceTree = "<group>"; };
80106
980789D8275EA3C900CED39A /* AccountViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountViewController.swift; sourceTree = "<group>"; };
@@ -223,6 +249,7 @@
223249
980C0C1B2704F23E00F8100A /* PropertyDetailsViewController.swift */,
224250
A50AC4052808BEC000873216 /* PropertyImageView.swift */,
225251
548DA1EF280D2819000CFFAC /* PropertyDetailsView.swift */,
252+
8BD13BF428189CE6001756F4 /* PropertyDetailsFactory.swift */,
226253
);
227254
path = PropertyDetails;
228255
sourceTree = "<group>";
@@ -455,6 +482,18 @@
455482
543091752811D30F00BDC903 /* DesignSystem.swift in Sources */,
456483
986153D42704EE2B00838CA6 /* PropertyListViewController.swift in Sources */,
457484
984DAACC27EE4A66002F3E8A /* PropertyListView.swift in Sources */,
485+
<<<<<<< Updated upstream
486+
=======
487+
<<<<<<< Updated upstream
488+
5498E3B72815B088002BD1C4 /* MapLocationView.swift in Sources */,
489+
=======
490+
<<<<<<< Updated upstream
491+
=======
492+
5498E3B72815B088002BD1C4 /* MapLocationView.swift in Sources */,
493+
8BD13BF528189CE6001756F4 /* PropertyDetailsFactory.swift in Sources */,
494+
>>>>>>> Stashed changes
495+
>>>>>>> Stashed changes
496+
>>>>>>> Stashed changes
458497
548DA1F0280D2819000CFFAC /* PropertyDetailsView.swift in Sources */,
459498
52E289FA28072CAC009030B3 /* PropertyTableViewCell.swift in Sources */,
460499
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: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,54 @@ extension PropertyListView: UITableViewDataSource {
8282
return self.listItems.count
8383
}
8484

85+
<<<<<<< Updated upstream
8586
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
8687

8788
let cell = tableView.dequeueReusableCell(withIdentifier: PropertyTableViewCell.identifier)!
8889
// cell.textLabel?.text = self.listItems[indexPath.row]
8990
return cell
91+
=======
92+
<<<<<<< Updated upstream
93+
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
94+
guard let propertyCell = tableView.dequeueReusableCell(withIdentifier: PropertyTableViewCell.identifier, for: indexPath) as? PropertyTableViewCell else { return UITableViewCell() }
95+
96+
propertyCell.setup(property: listItems[indexPath.row])
97+
98+
return propertyCell
99+
}
100+
101+
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
102+
tableView.deselectRow(at: indexPath, animated: true)
103+
=======
104+
<<<<<<< Updated upstream
105+
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
106+
107+
let cell = tableView.dequeueReusableCell(withIdentifier: PropertyTableViewCell.identifier)!
108+
// cell.textLabel?.text = self.listItems[indexPath.row]
109+
return cell
110+
=======
111+
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
112+
guard let propertyCell = tableView.dequeueReusableCell(withIdentifier: PropertyTableViewCell.identifier, for: indexPath) as? PropertyTableViewCell else { return UITableViewCell() }
113+
114+
propertyCell.setup(property: listItems[indexPath.row])
115+
116+
return propertyCell
117+
}
118+
}
119+
120+
extension PropertyListView: UITableViewDelegate {
121+
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
122+
let itens = listItems[indexPath.row]
123+
let propertyDetailsFactory = PropertyDetailsFactory.createPropertyDetails()
124+
125+
//TODO: - row do indexpath
126+
//obter o item da listitems na posicao row
127+
//chamar o factory da propertydetails e se nao tiver, criar
128+
//no factory chamar metodo setup obtendo a viewcontroller
129+
//em seguida fazer push nessa viewcontroller e passar o item da listitens para a prox view controller
130+
//na proxima vc preencher a view com o resultado
131+
>>>>>>> Stashed changes
132+
>>>>>>> Stashed changes
133+
>>>>>>> Stashed changes
90134
}
91135
}

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,22 @@ class PropertyListViewController: UIViewController {
1111

1212
let propertyListView: PropertyListView = {
1313

14+
<<<<<<< Updated upstream
15+
=======
16+
<<<<<<< Updated upstream
17+
private let viewModel: PropertyListViewModelProtocol
18+
19+
private let propertyListView: PropertyListView = {
20+
=======
21+
<<<<<<< Updated upstream
22+
=======
23+
private let viewModel: PropertyListViewModelProtocol
24+
private let
25+
26+
private let propertyListView: PropertyListView = {
27+
>>>>>>> Stashed changes
28+
>>>>>>> Stashed changes
29+
>>>>>>> Stashed changes
1430
let propertyListView = PropertyListView()
1531
return propertyListView
1632
}()

0 commit comments

Comments
 (0)