Dimitris Togias

add analysis more table view cell

...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
26 1EBF5F072840E13F00B8B17F /* SwiftEventBus in Frameworks */ = {isa = PBXBuildFile; productRef = 1EBF5F062840E13F00B8B17F /* SwiftEventBus */; }; 26 1EBF5F072840E13F00B8B17F /* SwiftEventBus in Frameworks */ = {isa = PBXBuildFile; productRef = 1EBF5F062840E13F00B8B17F /* SwiftEventBus */; };
27 7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0D5F56DD4E5371A50AD2D87 /* Pods_SwiftWarplyFramework.framework */; }; 27 7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0D5F56DD4E5371A50AD2D87 /* Pods_SwiftWarplyFramework.framework */; };
28 A02F34052882B6E60086465F /* TelcoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A02F34042882B6E60086465F /* TelcoViewController.swift */; }; 28 A02F34052882B6E60086465F /* TelcoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A02F34042882B6E60086465F /* TelcoViewController.swift */; };
29 + A030E61128D79FA400788E05 /* AnalysisMoreViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A030E60F28D79FA400788E05 /* AnalysisMoreViewCell.swift */; };
29 A04D31DE288FF670000E43B5 /* HistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A04D31DD288FF670000E43B5 /* HistoryViewController.swift */; }; 30 A04D31DE288FF670000E43B5 /* HistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A04D31DD288FF670000E43B5 /* HistoryViewController.swift */; };
30 A079366E2885D07700064122 /* AnalysisChildViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A079366D2885D07700064122 /* AnalysisChildViewController.swift */; }; 31 A079366E2885D07700064122 /* AnalysisChildViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A079366D2885D07700064122 /* AnalysisChildViewController.swift */; };
31 A07936702885D95600064122 /* AnalysisItemViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A079366F2885D95600064122 /* AnalysisItemViewCell.swift */; }; 32 A07936702885D95600064122 /* AnalysisItemViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A079366F2885D95600064122 /* AnalysisItemViewCell.swift */; };
...@@ -180,6 +181,7 @@ ...@@ -180,6 +181,7 @@
180 1EB5F4C9285370C90016F36E /* LoyaltyAnalysisViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoyaltyAnalysisViewController.swift; sourceTree = "<group>"; }; 181 1EB5F4C9285370C90016F36E /* LoyaltyAnalysisViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoyaltyAnalysisViewController.swift; sourceTree = "<group>"; };
181 1EBE97202865EE460080EFF7 /* MFYInboxTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MFYInboxTableViewCell.swift; sourceTree = "<group>"; }; 182 1EBE97202865EE460080EFF7 /* MFYInboxTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MFYInboxTableViewCell.swift; sourceTree = "<group>"; };
182 A02F34042882B6E60086465F /* TelcoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TelcoViewController.swift; sourceTree = "<group>"; }; 183 A02F34042882B6E60086465F /* TelcoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TelcoViewController.swift; sourceTree = "<group>"; };
184 + A030E60F28D79FA400788E05 /* AnalysisMoreViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisMoreViewCell.swift; sourceTree = "<group>"; };
183 A04D31DD288FF670000E43B5 /* HistoryViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HistoryViewController.swift; sourceTree = "<group>"; }; 185 A04D31DD288FF670000E43B5 /* HistoryViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HistoryViewController.swift; sourceTree = "<group>"; };
184 A079366D2885D07700064122 /* AnalysisChildViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisChildViewController.swift; sourceTree = "<group>"; }; 186 A079366D2885D07700064122 /* AnalysisChildViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisChildViewController.swift; sourceTree = "<group>"; };
185 A079366F2885D95600064122 /* AnalysisItemViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisItemViewCell.swift; sourceTree = "<group>"; }; 187 A079366F2885D95600064122 /* AnalysisItemViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisItemViewCell.swift; sourceTree = "<group>"; };
...@@ -396,6 +398,7 @@ ...@@ -396,6 +398,7 @@
396 A079366F2885D95600064122 /* AnalysisItemViewCell.swift */, 398 A079366F2885D95600064122 /* AnalysisItemViewCell.swift */,
397 A079367B2885F2F500064122 /* AnalysisHeaderViewCell.swift */, 399 A079367B2885F2F500064122 /* AnalysisHeaderViewCell.swift */,
398 A079367D2885F60A00064122 /* AnalysisHeaderMessageViewCell.swift */, 400 A079367D2885F60A00064122 /* AnalysisHeaderMessageViewCell.swift */,
401 + A030E60F28D79FA400788E05 /* AnalysisMoreViewCell.swift */,
399 ); 402 );
400 name = cells; 403 name = cells;
401 sourceTree = "<group>"; 404 sourceTree = "<group>";
...@@ -888,6 +891,7 @@ ...@@ -888,6 +891,7 @@
888 A09DBCAE2888BA8100DD50B0 /* SharingHistoryViewController.swift in Sources */, 891 A09DBCAE2888BA8100DD50B0 /* SharingHistoryViewController.swift in Sources */,
889 E6A778F2282933E60045BBA8 /* WLNativeAdCollectionViewCell.m in Sources */, 892 E6A778F2282933E60045BBA8 /* WLNativeAdCollectionViewCell.m in Sources */,
890 E6A77904282933E60045BBA8 /* WLEvent.m in Sources */, 893 E6A77904282933E60045BBA8 /* WLEvent.m in Sources */,
894 + A030E61128D79FA400788E05 /* AnalysisMoreViewCell.swift in Sources */,
891 E6A77927282933E70045BBA8 /* UIRefreshControl+AFNetworking.m in Sources */, 895 E6A77927282933E70045BBA8 /* UIRefreshControl+AFNetworking.m in Sources */,
892 E6A77955282933E70045BBA8 /* ViewControllerExtensions.swift in Sources */, 896 E6A77955282933E70045BBA8 /* ViewControllerExtensions.swift in Sources */,
893 A07936762885E9CC00064122 /* UIColorExtensions.swift in Sources */, 897 A07936762885E9CC00064122 /* UIColorExtensions.swift in Sources */,
......
1 +//
2 +// AnalysisMoreViewCell.swift
3 +// SwiftWarplyFramework
4 +//
5 +// Created by Manos Chorianopoulos on 18/9/22.
6 +//
7 +
8 +import UIKit
9 +
10 +class AnalysisMoreViewCell: UITableViewCell {
11 +
12 + @IBOutlet weak var titleLabel: UILabel!
13 +
14 + // lifecycle
15 + override func awakeFromNib() {
16 + super.awakeFromNib()
17 +
18 + // title
19 + titleLabel.textColor = UIColor(rgb: 0x435563)
20 + titleLabel.text = "Δες Περισσότερα"
21 + }
22 +}
...@@ -11,6 +11,7 @@ class HistoryViewController: AnalysisChildViewController { ...@@ -11,6 +11,7 @@ class HistoryViewController: AnalysisChildViewController {
11 11
12 var loading: Bool = false 12 var loading: Bool = false
13 var items: Array<swiftApi.CouponItemModel> = swiftApi().getOldCouponList() 13 var items: Array<swiftApi.CouponItemModel> = swiftApi().getOldCouponList()
14 + var showMore = true
14 15
15 // TODO: remove this when configuring model 16 // TODO: remove this when configuring model
16 let hasMessage = true 17 let hasMessage = true
...@@ -63,6 +64,7 @@ class HistoryViewController: AnalysisChildViewController { ...@@ -63,6 +64,7 @@ class HistoryViewController: AnalysisChildViewController {
63 func responseCallback (_ data: Array<swiftApi.CouponItemModel>?) -> Void { 64 func responseCallback (_ data: Array<swiftApi.CouponItemModel>?) -> Void {
64 65
65 self.items = data! 66 self.items = data!
67 + self.showMore = (self.items.count > 3)
66 showContent() 68 showContent()
67 DispatchQueue.main.async { 69 DispatchQueue.main.async {
68 self.tableView.reloadData() 70 self.tableView.reloadData()
...@@ -81,9 +83,12 @@ class HistoryViewController: AnalysisChildViewController { ...@@ -81,9 +83,12 @@ class HistoryViewController: AnalysisChildViewController {
81 83
82 override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 84 override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
83 if (section == 0) { 85 if (section == 0) {
84 - return 1; 86 + return 1
85 } 87 }
86 88
89 + if (self.showMore) {
90 + return 4
91 + }
87 return items.count 92 return items.count
88 } 93 }
89 94
...@@ -108,9 +113,25 @@ class HistoryViewController: AnalysisChildViewController { ...@@ -108,9 +113,25 @@ class HistoryViewController: AnalysisChildViewController {
108 return tableView.dequeueReusableCell(withIdentifier: "AnalysisHeaderViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisHeaderViewCell 113 return tableView.dequeueReusableCell(withIdentifier: "AnalysisHeaderViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisHeaderViewCell
109 } 114 }
110 115
116 + if (self.showMore && indexPath.row == 3) {
117 + let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisMoreViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisItemViewCell
118 + return cell
119 + }
120 +
111 let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisItemViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisItemViewCell 121 let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisItemViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisItemViewCell
112 cell.configureCell(item: items[indexPath.row]) 122 cell.configureCell(item: items[indexPath.row])
113 123
114 return cell 124 return cell
115 } 125 }
126 +
127 + override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
128 + if (indexPath.section == 0) {
129 + return
130 + }
131 +
132 + if (self.showMore && indexPath.row == 3) {
133 + self.showMore = false
134 + self.tableView.reloadData()
135 + }
136 + }
116 } 137 }
......
...@@ -11,6 +11,7 @@ class SharingHistoryViewController: AnalysisChildViewController { ...@@ -11,6 +11,7 @@ class SharingHistoryViewController: AnalysisChildViewController {
11 11
12 var loading: Bool = false 12 var loading: Bool = false
13 var items: Array<swiftApi.SharingCouponModel> = Array() 13 var items: Array<swiftApi.SharingCouponModel> = Array()
14 + var showMore = true
14 15
15 // TODO: remove this when configuring model 16 // TODO: remove this when configuring model
16 let hasMessage = false 17 let hasMessage = false
...@@ -61,6 +62,7 @@ class SharingHistoryViewController: AnalysisChildViewController { ...@@ -61,6 +62,7 @@ class SharingHistoryViewController: AnalysisChildViewController {
61 func responseCallback (_ data: Array<swiftApi.SharingCouponModel>?) -> Void { 62 func responseCallback (_ data: Array<swiftApi.SharingCouponModel>?) -> Void {
62 63
63 self.items = data! 64 self.items = data!
65 + self.showMore = (self.items.count > 3)
64 showContent() 66 showContent()
65 DispatchQueue.main.async { 67 DispatchQueue.main.async {
66 self.tableView.reloadData() 68 self.tableView.reloadData()
...@@ -82,6 +84,9 @@ class SharingHistoryViewController: AnalysisChildViewController { ...@@ -82,6 +84,9 @@ class SharingHistoryViewController: AnalysisChildViewController {
82 return 1; 84 return 1;
83 } 85 }
84 86
87 + if (self.showMore) {
88 + return 4
89 + }
85 return items.count 90 return items.count
86 } 91 }
87 92
...@@ -106,9 +111,25 @@ class SharingHistoryViewController: AnalysisChildViewController { ...@@ -106,9 +111,25 @@ class SharingHistoryViewController: AnalysisChildViewController {
106 return cell 111 return cell
107 } 112 }
108 113
114 + if (self.showMore && indexPath.row == 3) {
115 + let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisMoreViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisItemViewCell
116 + return cell
117 + }
118 +
109 let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisItemViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisItemViewCell 119 let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisItemViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisItemViewCell
110 cell.configureCell(item: items[indexPath.row]) 120 cell.configureCell(item: items[indexPath.row])
111 121
112 return cell 122 return cell
113 } 123 }
124 +
125 + override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
126 + if (indexPath.section == 0) {
127 + return
128 + }
129 +
130 + if (self.showMore && indexPath.row == 3) {
131 + self.showMore = false
132 + self.tableView.reloadData()
133 + }
134 + }
114 } 135 }
......