Showing
8 changed files
with
183 additions
and
18 deletions
... | @@ -28,6 +28,7 @@ | ... | @@ -28,6 +28,7 @@ |
28 | 1ECA079428D9E53F00D2BDE0 /* MapsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ECA079228D9E53F00D2BDE0 /* MapsViewController.swift */; }; | 28 | 1ECA079428D9E53F00D2BDE0 /* MapsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ECA079228D9E53F00D2BDE0 /* MapsViewController.swift */; }; |
29 | 1ECA079528D9E53F00D2BDE0 /* MapsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1ECA079328D9E53F00D2BDE0 /* MapsViewController.xib */; }; | 29 | 1ECA079528D9E53F00D2BDE0 /* MapsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1ECA079328D9E53F00D2BDE0 /* MapsViewController.xib */; }; |
30 | 1ECA079728D9E66200D2BDE0 /* MerchantAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ECA079628D9E66200D2BDE0 /* MerchantAnnotation.swift */; }; | 30 | 1ECA079728D9E66200D2BDE0 /* MerchantAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ECA079628D9E66200D2BDE0 /* MerchantAnnotation.swift */; }; |
31 | + 1EDCDFAC28DB29E8002ED8F0 /* AnalysisMoreViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EDCDFAB28DB29E8002ED8F0 /* AnalysisMoreViewCell.swift */; }; | ||
31 | 7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0D5F56DD4E5371A50AD2D87 /* Pods_SwiftWarplyFramework.framework */; }; | 32 | 7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0D5F56DD4E5371A50AD2D87 /* Pods_SwiftWarplyFramework.framework */; }; |
32 | A02F34052882B6E60086465F /* TelcoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A02F34042882B6E60086465F /* TelcoViewController.swift */; }; | 33 | A02F34052882B6E60086465F /* TelcoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A02F34042882B6E60086465F /* TelcoViewController.swift */; }; |
33 | A04D31DE288FF670000E43B5 /* HistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A04D31DD288FF670000E43B5 /* HistoryViewController.swift */; }; | 34 | A04D31DE288FF670000E43B5 /* HistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A04D31DD288FF670000E43B5 /* HistoryViewController.swift */; }; |
... | @@ -187,6 +188,7 @@ | ... | @@ -187,6 +188,7 @@ |
187 | 1ECA079228D9E53F00D2BDE0 /* MapsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapsViewController.swift; sourceTree = "<group>"; }; | 188 | 1ECA079228D9E53F00D2BDE0 /* MapsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapsViewController.swift; sourceTree = "<group>"; }; |
188 | 1ECA079328D9E53F00D2BDE0 /* MapsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MapsViewController.xib; sourceTree = "<group>"; }; | 189 | 1ECA079328D9E53F00D2BDE0 /* MapsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MapsViewController.xib; sourceTree = "<group>"; }; |
189 | 1ECA079628D9E66200D2BDE0 /* MerchantAnnotation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MerchantAnnotation.swift; sourceTree = "<group>"; }; | 190 | 1ECA079628D9E66200D2BDE0 /* MerchantAnnotation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MerchantAnnotation.swift; sourceTree = "<group>"; }; |
191 | + 1EDCDFAB28DB29E8002ED8F0 /* AnalysisMoreViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisMoreViewCell.swift; sourceTree = "<group>"; }; | ||
190 | A02F34042882B6E60086465F /* TelcoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TelcoViewController.swift; sourceTree = "<group>"; }; | 192 | A02F34042882B6E60086465F /* TelcoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TelcoViewController.swift; sourceTree = "<group>"; }; |
191 | A04D31DD288FF670000E43B5 /* HistoryViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HistoryViewController.swift; sourceTree = "<group>"; }; | 193 | A04D31DD288FF670000E43B5 /* HistoryViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HistoryViewController.swift; sourceTree = "<group>"; }; |
192 | A079366D2885D07700064122 /* AnalysisChildViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisChildViewController.swift; sourceTree = "<group>"; }; | 194 | A079366D2885D07700064122 /* AnalysisChildViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisChildViewController.swift; sourceTree = "<group>"; }; |
... | @@ -460,6 +462,7 @@ | ... | @@ -460,6 +462,7 @@ |
460 | E6A77A35282BB4CB0045BBA8 /* MakeItAPresentViewController.swift */, | 462 | E6A77A35282BB4CB0045BBA8 /* MakeItAPresentViewController.swift */, |
461 | E6A7785A282933E40045BBA8 /* Helpers */, | 463 | E6A7785A282933E40045BBA8 /* Helpers */, |
462 | E6A77861282933E50045BBA8 /* Main.storyboard */, | 464 | E6A77861282933E50045BBA8 /* Main.storyboard */, |
465 | + 1EDCDFAB28DB29E8002ED8F0 /* AnalysisMoreViewCell.swift */, | ||
463 | 1E87A9EE28C2021200C79F90 /* ContextualViewController.swift */, | 466 | 1E87A9EE28C2021200C79F90 /* ContextualViewController.swift */, |
464 | 1EB236AA28816B680063777A /* ShareViewController.swift */, | 467 | 1EB236AA28816B680063777A /* ShareViewController.swift */, |
465 | 1EB236AC28816C560063777A /* NumberPopupViewController.swift */, | 468 | 1EB236AC28816C560063777A /* NumberPopupViewController.swift */, |
... | @@ -958,6 +961,7 @@ | ... | @@ -958,6 +961,7 @@ |
958 | E6A778E3282933E60045BBA8 /* WalletViewController.swift in Sources */, | 961 | E6A778E3282933E60045BBA8 /* WalletViewController.swift in Sources */, |
959 | E6A7790C282933E60045BBA8 /* WLBeaconManager.m in Sources */, | 962 | E6A7790C282933E60045BBA8 /* WLBeaconManager.m in Sources */, |
960 | E6A77940282933E70045BBA8 /* AFURLSessionManager.m in Sources */, | 963 | E6A77940282933E70045BBA8 /* AFURLSessionManager.m in Sources */, |
964 | + 1EDCDFAC28DB29E8002ED8F0 /* AnalysisMoreViewCell.swift in Sources */, | ||
961 | ); | 965 | ); |
962 | runOnlyForDeploymentPostprocessing = 0; | 966 | runOnlyForDeploymentPostprocessing = 0; |
963 | }; | 967 | }; | ... | ... |
No preview for this file type
1 | +// | ||
2 | +// AnalysisMoreViewCell.swift | ||
3 | +// SwiftWarplyFramework | ||
4 | +// | ||
5 | +// Created by Manos Chorianopoulos on 21/9/22. | ||
6 | +// | ||
7 | + | ||
8 | +import UIKit | ||
9 | + | ||
10 | +@objc public class AnalysisMoreViewCell: UITableViewCell { | ||
11 | + @IBOutlet weak var titleLabel: UILabel! | ||
12 | + | ||
13 | + // lifecycle | ||
14 | + public override func awakeFromNib() { | ||
15 | + super.awakeFromNib() | ||
16 | + | ||
17 | + // title | ||
18 | + titleLabel.font = UIFont(name: "PFSquareSansPro-Medium", size: 16) | ||
19 | + titleLabel.textColor = UIColor(rgb: 0x415564) | ||
20 | + titleLabel.text = "Δες Περισσότερα" | ||
21 | + } | ||
22 | +} |
... | @@ -26,7 +26,7 @@ import UIKit | ... | @@ -26,7 +26,7 @@ import UIKit |
26 | 26 | ||
27 | private extension CSMButton { | 27 | private extension CSMButton { |
28 | func configure() { | 28 | func configure() { |
29 | - setImage(UIImage(named: "directions"), for: .normal) | 29 | + setImage(UIImage(named: "ic_directions", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil), for: .normal) |
30 | titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 18) | 30 | titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 18) |
31 | setTitleColor(.white, for: .normal) | 31 | setTitleColor(.white, for: .normal) |
32 | backgroundColor = UIColor(rgb: 0x79BF14) | 32 | backgroundColor = UIColor(rgb: 0x79BF14) | ... | ... |
... | @@ -8,9 +8,9 @@ | ... | @@ -8,9 +8,9 @@ |
8 | import UIKit | 8 | import UIKit |
9 | 9 | ||
10 | class HistoryViewController: AnalysisChildViewController { | 10 | class HistoryViewController: AnalysisChildViewController { |
11 | - | ||
12 | var loading: Bool = false | 11 | var loading: Bool = false |
13 | var items: Array<swiftApi.CouponItemModel> = swiftApi().getOldCouponList() | 12 | var items: Array<swiftApi.CouponItemModel> = swiftApi().getOldCouponList() |
13 | + var showMore = false | ||
14 | 14 | ||
15 | // TODO: remove this when configuring model | 15 | // TODO: remove this when configuring model |
16 | let hasMessage = true | 16 | let hasMessage = true |
... | @@ -20,6 +20,9 @@ class HistoryViewController: AnalysisChildViewController { | ... | @@ -20,6 +20,9 @@ class HistoryViewController: AnalysisChildViewController { |
20 | 20 | ||
21 | super.viewDidLoad() | 21 | super.viewDidLoad() |
22 | 22 | ||
23 | + self.tableView.delegate = self | ||
24 | + self.tableView.dataSource = self | ||
25 | + | ||
23 | self.refreshControl = UIRefreshControl() | 26 | self.refreshControl = UIRefreshControl() |
24 | self.refreshControl?.addTarget(self, action: #selector(handleRefresh(_:)), for: .valueChanged) | 27 | self.refreshControl?.addTarget(self, action: #selector(handleRefresh(_:)), for: .valueChanged) |
25 | 28 | ||
... | @@ -36,6 +39,13 @@ class HistoryViewController: AnalysisChildViewController { | ... | @@ -36,6 +39,13 @@ class HistoryViewController: AnalysisChildViewController { |
36 | showLoading() | 39 | showLoading() |
37 | 40 | ||
38 | items = swiftApi().getOldCouponList() | 41 | items = swiftApi().getOldCouponList() |
42 | + | ||
43 | + self.showMore = (self.items.count > 3) | ||
44 | + | ||
45 | + if (self.showMore == true) { | ||
46 | + self.items = Array(self.items[0...2]) | ||
47 | + } | ||
48 | + | ||
39 | showContent() | 49 | showContent() |
40 | self.tableView.reloadData() | 50 | self.tableView.reloadData() |
41 | } | 51 | } |
... | @@ -63,6 +73,11 @@ class HistoryViewController: AnalysisChildViewController { | ... | @@ -63,6 +73,11 @@ class HistoryViewController: AnalysisChildViewController { |
63 | func responseCallback (_ data: Array<swiftApi.CouponItemModel>?) -> Void { | 73 | func responseCallback (_ data: Array<swiftApi.CouponItemModel>?) -> Void { |
64 | 74 | ||
65 | self.items = data! | 75 | self.items = data! |
76 | + self.showMore = (self.items.count > 3) | ||
77 | + | ||
78 | + if (self.showMore == true) { | ||
79 | + self.items = Array(self.items[0...2]) | ||
80 | + } | ||
66 | showContent() | 81 | showContent() |
67 | DispatchQueue.main.async { | 82 | DispatchQueue.main.async { |
68 | self.tableView.reloadData() | 83 | self.tableView.reloadData() |
... | @@ -81,9 +96,12 @@ class HistoryViewController: AnalysisChildViewController { | ... | @@ -81,9 +96,12 @@ class HistoryViewController: AnalysisChildViewController { |
81 | 96 | ||
82 | override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | 97 | override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { |
83 | if (section == 0) { | 98 | if (section == 0) { |
84 | - return 1; | 99 | + return 1 |
85 | } | 100 | } |
86 | 101 | ||
102 | + if (self.showMore == true) { | ||
103 | + return 4 | ||
104 | + } | ||
87 | return items.count | 105 | return items.count |
88 | } | 106 | } |
89 | 107 | ||
... | @@ -94,7 +112,6 @@ class HistoryViewController: AnalysisChildViewController { | ... | @@ -94,7 +112,6 @@ class HistoryViewController: AnalysisChildViewController { |
94 | 112 | ||
95 | return 140.0 | 113 | return 140.0 |
96 | } | 114 | } |
97 | - | ||
98 | override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | 115 | override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
99 | 116 | ||
100 | // header | 117 | // header |
... | @@ -108,9 +125,26 @@ class HistoryViewController: AnalysisChildViewController { | ... | @@ -108,9 +125,26 @@ class HistoryViewController: AnalysisChildViewController { |
108 | return tableView.dequeueReusableCell(withIdentifier: "AnalysisHeaderViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisHeaderViewCell | 125 | return tableView.dequeueReusableCell(withIdentifier: "AnalysisHeaderViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisHeaderViewCell |
109 | } | 126 | } |
110 | 127 | ||
128 | + if (self.showMore && indexPath.row == 3) { | ||
129 | + let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisMoreViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisMoreViewCell | ||
130 | + return cell | ||
131 | + } | ||
132 | + | ||
111 | let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisItemViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisItemViewCell | 133 | let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisItemViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisItemViewCell |
112 | cell.configureCell(item: items[indexPath.row]) | 134 | cell.configureCell(item: items[indexPath.row]) |
113 | 135 | ||
114 | return cell | 136 | return cell |
115 | } | 137 | } |
138 | + | ||
139 | + override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | ||
140 | + if (indexPath.section == 0) { | ||
141 | + return | ||
142 | + } | ||
143 | + | ||
144 | + if (self.showMore && indexPath.row == 3) { | ||
145 | + self.items = swiftApi().getOldCouponList() | ||
146 | + self.showMore = false | ||
147 | + self.tableView.reloadData() | ||
148 | + } | ||
149 | + } | ||
116 | } | 150 | } | ... | ... |
... | @@ -517,14 +517,51 @@ | ... | @@ -517,14 +517,51 @@ |
517 | <scene sceneID="Yng-iu-80u"> | 517 | <scene sceneID="Yng-iu-80u"> |
518 | <objects> | 518 | <objects> |
519 | <tableViewController storyboardIdentifier="SharingHistoryViewController" hidesBottomBarWhenPushed="YES" id="xOZ-Af-1Nw" customClass="SharingHistoryViewController" customModule="SwiftWarplyFramework" customModuleProvider="target" sceneMemberID="viewController"> | 519 | <tableViewController storyboardIdentifier="SharingHistoryViewController" hidesBottomBarWhenPushed="YES" id="xOZ-Af-1Nw" customClass="SharingHistoryViewController" customModule="SwiftWarplyFramework" customModuleProvider="target" sceneMemberID="viewController"> |
520 | - <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" allowsSelection="NO" rowHeight="-1" estimatedRowHeight="160" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" id="IAk-m8-ZIC"> | 520 | + <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="160" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" id="IAk-m8-ZIC"> |
521 | <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> | 521 | <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> |
522 | <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | 522 | <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
523 | <color key="backgroundColor" systemColor="systemBackgroundColor"/> | 523 | <color key="backgroundColor" systemColor="systemBackgroundColor"/> |
524 | <prototypes> | 524 | <prototypes> |
525 | - <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="default" indentationWidth="10" reuseIdentifier="AnalysisItemViewCell" rowHeight="160" id="iNx-Id-iLB" customClass="AnalysisItemViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target"> | 525 | + <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="AnalysisMoreViewCell" rowHeight="160" id="rpm-JS-xpJ" customClass="AnalysisMoreViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target"> |
526 | <rect key="frame" x="0.0" y="44.5" width="414" height="160"/> | 526 | <rect key="frame" x="0.0" y="44.5" width="414" height="160"/> |
527 | <autoresizingMask key="autoresizingMask"/> | 527 | <autoresizingMask key="autoresizingMask"/> |
528 | + <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="rpm-JS-xpJ" id="4bk-NG-9CV"> | ||
529 | + <rect key="frame" x="0.0" y="0.0" width="414" height="160"/> | ||
530 | + <autoresizingMask key="autoresizingMask"/> | ||
531 | + <subviews> | ||
532 | + <stackView opaque="NO" contentMode="scaleToFill" spacing="7" translatesAutoresizingMaskIntoConstraints="NO" id="Ujy-Ns-gSY"> | ||
533 | + <rect key="frame" x="142.5" y="65" width="129" height="30"/> | ||
534 | + <subviews> | ||
535 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Δες Περισσότερα" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jD8-wg-76D"> | ||
536 | + <rect key="frame" x="0.0" y="0.0" width="112" height="30"/> | ||
537 | + <fontDescription key="fontDescription" type="system" pointSize="14"/> | ||
538 | + <nil key="textColor"/> | ||
539 | + <nil key="highlightedColor"/> | ||
540 | + </label> | ||
541 | + <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_down_dark" translatesAutoresizingMaskIntoConstraints="NO" id="w3t-uo-L5p"> | ||
542 | + <rect key="frame" x="119" y="0.0" width="10" height="30"/> | ||
543 | + <constraints> | ||
544 | + <constraint firstAttribute="width" constant="10" id="Vle-mG-72l"/> | ||
545 | + </constraints> | ||
546 | + </imageView> | ||
547 | + </subviews> | ||
548 | + <constraints> | ||
549 | + <constraint firstAttribute="height" constant="30" id="pZA-sa-b2o"/> | ||
550 | + </constraints> | ||
551 | + </stackView> | ||
552 | + </subviews> | ||
553 | + <constraints> | ||
554 | + <constraint firstItem="Ujy-Ns-gSY" firstAttribute="centerY" secondItem="4bk-NG-9CV" secondAttribute="centerY" id="tjs-LH-AbK"/> | ||
555 | + <constraint firstItem="Ujy-Ns-gSY" firstAttribute="centerX" secondItem="4bk-NG-9CV" secondAttribute="centerX" id="zOh-rM-dnO"/> | ||
556 | + </constraints> | ||
557 | + </tableViewCellContentView> | ||
558 | + <connections> | ||
559 | + <outlet property="titleLabel" destination="jD8-wg-76D" id="K6c-qT-EMs"/> | ||
560 | + </connections> | ||
561 | + </tableViewCell> | ||
562 | + <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="none" indentationWidth="10" reuseIdentifier="AnalysisItemViewCell" rowHeight="160" id="iNx-Id-iLB" customClass="AnalysisItemViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target"> | ||
563 | + <rect key="frame" x="0.0" y="204.5" width="414" height="160"/> | ||
564 | + <autoresizingMask key="autoresizingMask"/> | ||
528 | <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="iNx-Id-iLB" id="X28-3l-fcy"> | 565 | <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="iNx-Id-iLB" id="X28-3l-fcy"> |
529 | <rect key="frame" x="0.0" y="0.0" width="414" height="160"/> | 566 | <rect key="frame" x="0.0" y="0.0" width="414" height="160"/> |
530 | <autoresizingMask key="autoresizingMask"/> | 567 | <autoresizingMask key="autoresizingMask"/> |
... | @@ -591,8 +628,8 @@ | ... | @@ -591,8 +628,8 @@ |
591 | <outlet property="titleLabel" destination="hqA-F6-n9s" id="zlL-DU-81T"/> | 628 | <outlet property="titleLabel" destination="hqA-F6-n9s" id="zlL-DU-81T"/> |
592 | </connections> | 629 | </connections> |
593 | </tableViewCell> | 630 | </tableViewCell> |
594 | - <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="AnalysisHeaderViewCell" rowHeight="280" id="HMC-zK-06F" customClass="AnalysisHeaderViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target"> | 631 | + <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="AnalysisHeaderViewCell" rowHeight="280" id="HMC-zK-06F" customClass="AnalysisHeaderViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target"> |
595 | - <rect key="frame" x="0.0" y="204.5" width="414" height="280"/> | 632 | + <rect key="frame" x="0.0" y="364.5" width="414" height="280"/> |
596 | <autoresizingMask key="autoresizingMask"/> | 633 | <autoresizingMask key="autoresizingMask"/> |
597 | <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="HMC-zK-06F" id="RtV-Li-Dnj"> | 634 | <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="HMC-zK-06F" id="RtV-Li-Dnj"> |
598 | <rect key="frame" x="0.0" y="0.0" width="414" height="280"/> | 635 | <rect key="frame" x="0.0" y="0.0" width="414" height="280"/> |
... | @@ -638,8 +675,8 @@ | ... | @@ -638,8 +675,8 @@ |
638 | <outlet property="titleLabel" destination="LKw-8l-mRY" id="2Nl-uC-2aJ"/> | 675 | <outlet property="titleLabel" destination="LKw-8l-mRY" id="2Nl-uC-2aJ"/> |
639 | </connections> | 676 | </connections> |
640 | </tableViewCell> | 677 | </tableViewCell> |
641 | - <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="AnalysisHeaderMessageViewCell" rowHeight="380" id="oPh-jz-GSZ" customClass="AnalysisHeaderMessageViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target"> | 678 | + <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="AnalysisHeaderMessageViewCell" rowHeight="380" id="oPh-jz-GSZ" customClass="AnalysisHeaderMessageViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target"> |
642 | - <rect key="frame" x="0.0" y="484.5" width="414" height="380"/> | 679 | + <rect key="frame" x="0.0" y="644.5" width="414" height="380"/> |
643 | <autoresizingMask key="autoresizingMask"/> | 680 | <autoresizingMask key="autoresizingMask"/> |
644 | <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="oPh-jz-GSZ" id="8oK-tI-pLa"> | 681 | <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="oPh-jz-GSZ" id="8oK-tI-pLa"> |
645 | <rect key="frame" x="0.0" y="0.0" width="414" height="380"/> | 682 | <rect key="frame" x="0.0" y="0.0" width="414" height="380"/> |
... | @@ -2147,14 +2184,51 @@ | ... | @@ -2147,14 +2184,51 @@ |
2147 | <scene sceneID="KER-Da-ryV"> | 2184 | <scene sceneID="KER-Da-ryV"> |
2148 | <objects> | 2185 | <objects> |
2149 | <tableViewController storyboardIdentifier="HistoryViewController" hidesBottomBarWhenPushed="YES" id="ze6-Kr-Io4" customClass="HistoryViewController" customModule="SwiftWarplyFramework" customModuleProvider="target" sceneMemberID="viewController"> | 2186 | <tableViewController storyboardIdentifier="HistoryViewController" hidesBottomBarWhenPushed="YES" id="ze6-Kr-Io4" customClass="HistoryViewController" customModule="SwiftWarplyFramework" customModuleProvider="target" sceneMemberID="viewController"> |
2150 | - <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" allowsSelection="NO" rowHeight="-1" estimatedRowHeight="160" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" id="qD1-U4-LYx"> | 2187 | + <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="160" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" id="qD1-U4-LYx"> |
2151 | <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> | 2188 | <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> |
2152 | <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | 2189 | <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
2153 | <color key="backgroundColor" systemColor="systemBackgroundColor"/> | 2190 | <color key="backgroundColor" systemColor="systemBackgroundColor"/> |
2154 | <prototypes> | 2191 | <prototypes> |
2155 | - <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="default" indentationWidth="10" reuseIdentifier="AnalysisItemViewCell" rowHeight="160" id="mwO-Y9-Whd" customClass="AnalysisItemViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target"> | 2192 | + <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="AnalysisMoreViewCell" rowHeight="160" id="y9v-uo-691" customClass="AnalysisMoreViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target"> |
2156 | <rect key="frame" x="0.0" y="44.5" width="414" height="160"/> | 2193 | <rect key="frame" x="0.0" y="44.5" width="414" height="160"/> |
2157 | <autoresizingMask key="autoresizingMask"/> | 2194 | <autoresizingMask key="autoresizingMask"/> |
2195 | + <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="y9v-uo-691" id="fs3-oQ-Zcn"> | ||
2196 | + <rect key="frame" x="0.0" y="0.0" width="414" height="160"/> | ||
2197 | + <autoresizingMask key="autoresizingMask"/> | ||
2198 | + <subviews> | ||
2199 | + <stackView opaque="NO" contentMode="scaleToFill" spacing="7" translatesAutoresizingMaskIntoConstraints="NO" id="0nn-Oo-hdD"> | ||
2200 | + <rect key="frame" x="142.5" y="65" width="129" height="30"/> | ||
2201 | + <subviews> | ||
2202 | + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Δες Περισσότερα" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Cnm-Dr-B1b"> | ||
2203 | + <rect key="frame" x="0.0" y="0.0" width="112" height="30"/> | ||
2204 | + <fontDescription key="fontDescription" type="system" pointSize="14"/> | ||
2205 | + <nil key="textColor"/> | ||
2206 | + <nil key="highlightedColor"/> | ||
2207 | + </label> | ||
2208 | + <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_down_dark" translatesAutoresizingMaskIntoConstraints="NO" id="eaQ-bR-n13"> | ||
2209 | + <rect key="frame" x="119" y="0.0" width="10" height="30"/> | ||
2210 | + <constraints> | ||
2211 | + <constraint firstAttribute="width" constant="10" id="ZyY-sN-Rx1"/> | ||
2212 | + </constraints> | ||
2213 | + </imageView> | ||
2214 | + </subviews> | ||
2215 | + <constraints> | ||
2216 | + <constraint firstAttribute="height" constant="30" id="83c-wF-2Vx"/> | ||
2217 | + </constraints> | ||
2218 | + </stackView> | ||
2219 | + </subviews> | ||
2220 | + <constraints> | ||
2221 | + <constraint firstItem="0nn-Oo-hdD" firstAttribute="centerY" secondItem="fs3-oQ-Zcn" secondAttribute="centerY" id="YfN-di-oHM"/> | ||
2222 | + <constraint firstItem="0nn-Oo-hdD" firstAttribute="centerX" secondItem="fs3-oQ-Zcn" secondAttribute="centerX" id="d2b-fG-qxB"/> | ||
2223 | + </constraints> | ||
2224 | + </tableViewCellContentView> | ||
2225 | + <connections> | ||
2226 | + <outlet property="titleLabel" destination="Cnm-Dr-B1b" id="ArG-JS-SA8"/> | ||
2227 | + </connections> | ||
2228 | + </tableViewCell> | ||
2229 | + <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="none" indentationWidth="10" reuseIdentifier="AnalysisItemViewCell" rowHeight="160" id="mwO-Y9-Whd" customClass="AnalysisItemViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target"> | ||
2230 | + <rect key="frame" x="0.0" y="204.5" width="414" height="160"/> | ||
2231 | + <autoresizingMask key="autoresizingMask"/> | ||
2158 | <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="mwO-Y9-Whd" id="4Lb-Ez-2D5"> | 2232 | <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="mwO-Y9-Whd" id="4Lb-Ez-2D5"> |
2159 | <rect key="frame" x="0.0" y="0.0" width="414" height="160"/> | 2233 | <rect key="frame" x="0.0" y="0.0" width="414" height="160"/> |
2160 | <autoresizingMask key="autoresizingMask"/> | 2234 | <autoresizingMask key="autoresizingMask"/> |
... | @@ -2221,8 +2295,8 @@ | ... | @@ -2221,8 +2295,8 @@ |
2221 | <outlet property="titleLabel" destination="9Ag-Sp-uXt" id="FN2-u8-I6a"/> | 2295 | <outlet property="titleLabel" destination="9Ag-Sp-uXt" id="FN2-u8-I6a"/> |
2222 | </connections> | 2296 | </connections> |
2223 | </tableViewCell> | 2297 | </tableViewCell> |
2224 | - <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="AnalysisHeaderViewCell" rowHeight="280" id="TXv-Qw-94X" customClass="AnalysisHeaderViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target"> | 2298 | + <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="AnalysisHeaderViewCell" rowHeight="280" id="TXv-Qw-94X" customClass="AnalysisHeaderViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target"> |
2225 | - <rect key="frame" x="0.0" y="204.5" width="414" height="280"/> | 2299 | + <rect key="frame" x="0.0" y="364.5" width="414" height="280"/> |
2226 | <autoresizingMask key="autoresizingMask"/> | 2300 | <autoresizingMask key="autoresizingMask"/> |
2227 | <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="TXv-Qw-94X" id="fmq-OF-USg"> | 2301 | <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="TXv-Qw-94X" id="fmq-OF-USg"> |
2228 | <rect key="frame" x="0.0" y="0.0" width="414" height="280"/> | 2302 | <rect key="frame" x="0.0" y="0.0" width="414" height="280"/> |
... | @@ -2257,8 +2331,8 @@ | ... | @@ -2257,8 +2331,8 @@ |
2257 | <outlet property="titleLabel" destination="XjQ-Dg-ucn" id="1uG-vu-ajJ"/> | 2331 | <outlet property="titleLabel" destination="XjQ-Dg-ucn" id="1uG-vu-ajJ"/> |
2258 | </connections> | 2332 | </connections> |
2259 | </tableViewCell> | 2333 | </tableViewCell> |
2260 | - <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="AnalysisHeaderMessageViewCell" rowHeight="380" id="9cE-DQ-oc7" customClass="AnalysisHeaderMessageViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target"> | 2334 | + <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="AnalysisHeaderMessageViewCell" rowHeight="380" id="9cE-DQ-oc7" customClass="AnalysisHeaderMessageViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target"> |
2261 | - <rect key="frame" x="0.0" y="484.5" width="414" height="380"/> | 2335 | + <rect key="frame" x="0.0" y="644.5" width="414" height="380"/> |
2262 | <autoresizingMask key="autoresizingMask"/> | 2336 | <autoresizingMask key="autoresizingMask"/> |
2263 | <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="9cE-DQ-oc7" id="Kcf-Zv-eMe"> | 2337 | <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="9cE-DQ-oc7" id="Kcf-Zv-eMe"> |
2264 | <rect key="frame" x="0.0" y="0.0" width="414" height="380"/> | 2338 | <rect key="frame" x="0.0" y="0.0" width="414" height="380"/> | ... | ... |
... | @@ -43,7 +43,7 @@ import MapKit | ... | @@ -43,7 +43,7 @@ import MapKit |
43 | setBackButton() | 43 | setBackButton() |
44 | setNavigationTitle("Καταστήματα") | 44 | setNavigationTitle("Καταστήματα") |
45 | 45 | ||
46 | - backgroundImage.image = UIImage(named: "coupons_scrollview_white") | 46 | + backgroundImage.image = UIImage(named: "coupons_scrollview_white", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil) |
47 | 47 | ||
48 | mapView.delegate = self | 48 | mapView.delegate = self |
49 | mapView.centerToLocation(initialLocation, regionRadius: 1000000) | 49 | mapView.centerToLocation(initialLocation, regionRadius: 1000000) |
... | @@ -72,7 +72,7 @@ import MapKit | ... | @@ -72,7 +72,7 @@ import MapKit |
72 | 72 | ||
73 | //directionsButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 16) | 73 | //directionsButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 16) |
74 | directionsButton.setTitle("Οδηγίες", for: .normal) | 74 | directionsButton.setTitle("Οδηγίες", for: .normal) |
75 | - directionsButton.setImage(UIImage(named: "ic_directions"), for: .normal) | 75 | + directionsButton.setImage(UIImage(named: "ic_directions", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil), for: .normal) |
76 | 76 | ||
77 | // directionsButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 5); | 77 | // directionsButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 5); |
78 | // directionsButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0); | 78 | // directionsButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0); | ... | ... |
... | @@ -11,6 +11,8 @@ class SharingHistoryViewController: AnalysisChildViewController { | ... | @@ -11,6 +11,8 @@ 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 allItems: Array<swiftApi.SharingCouponModel> = Array() | ||
15 | + var showMore = false | ||
14 | 16 | ||
15 | // TODO: remove this when configuring model | 17 | // TODO: remove this when configuring model |
16 | let hasMessage = false | 18 | let hasMessage = false |
... | @@ -20,6 +22,9 @@ class SharingHistoryViewController: AnalysisChildViewController { | ... | @@ -20,6 +22,9 @@ class SharingHistoryViewController: AnalysisChildViewController { |
20 | 22 | ||
21 | super.viewDidLoad() | 23 | super.viewDidLoad() |
22 | 24 | ||
25 | + self.tableView.delegate = self | ||
26 | + self.tableView.dataSource = self | ||
27 | + | ||
23 | self.refreshControl = UIRefreshControl() | 28 | self.refreshControl = UIRefreshControl() |
24 | self.refreshControl?.addTarget(self, action: #selector(handleRefresh(_:)), for: .valueChanged) | 29 | self.refreshControl?.addTarget(self, action: #selector(handleRefresh(_:)), for: .valueChanged) |
25 | 30 | ||
... | @@ -61,6 +66,12 @@ class SharingHistoryViewController: AnalysisChildViewController { | ... | @@ -61,6 +66,12 @@ class SharingHistoryViewController: AnalysisChildViewController { |
61 | func responseCallback (_ data: Array<swiftApi.SharingCouponModel>?) -> Void { | 66 | func responseCallback (_ data: Array<swiftApi.SharingCouponModel>?) -> Void { |
62 | 67 | ||
63 | self.items = data! | 68 | self.items = data! |
69 | + self.allItems = data! | ||
70 | + self.showMore = (self.items.count > 3) | ||
71 | + | ||
72 | + if (self.showMore == true) { | ||
73 | + self.items = Array(self.items[0...2]) | ||
74 | + } | ||
64 | showContent() | 75 | showContent() |
65 | DispatchQueue.main.async { | 76 | DispatchQueue.main.async { |
66 | self.tableView.reloadData() | 77 | self.tableView.reloadData() |
... | @@ -82,6 +93,9 @@ class SharingHistoryViewController: AnalysisChildViewController { | ... | @@ -82,6 +93,9 @@ class SharingHistoryViewController: AnalysisChildViewController { |
82 | return 1; | 93 | return 1; |
83 | } | 94 | } |
84 | 95 | ||
96 | + if (self.showMore == true) { | ||
97 | + return 4 | ||
98 | + } | ||
85 | return items.count | 99 | return items.count |
86 | } | 100 | } |
87 | 101 | ||
... | @@ -106,9 +120,26 @@ class SharingHistoryViewController: AnalysisChildViewController { | ... | @@ -106,9 +120,26 @@ class SharingHistoryViewController: AnalysisChildViewController { |
106 | return cell | 120 | return cell |
107 | } | 121 | } |
108 | 122 | ||
123 | + if ((self.showMore == true) && (indexPath.row == 3)) { | ||
124 | + let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisMoreViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisMoreViewCell | ||
125 | + return cell | ||
126 | + } | ||
127 | + | ||
109 | let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisItemViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisItemViewCell | 128 | let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisItemViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisItemViewCell |
110 | cell.configureCell(item: items[indexPath.row]) | 129 | cell.configureCell(item: items[indexPath.row]) |
111 | 130 | ||
112 | return cell | 131 | return cell |
113 | } | 132 | } |
133 | + | ||
134 | + override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | ||
135 | + if (indexPath.section == 0) { | ||
136 | + return | ||
137 | + } | ||
138 | + | ||
139 | + if ((self.showMore == true) && (indexPath.row == 3)) { | ||
140 | + self.items = self.allItems | ||
141 | + self.showMore = false | ||
142 | + self.tableView.reloadData() | ||
143 | + } | ||
144 | + } | ||
114 | } | 145 | } | ... | ... |
-
Please register or login to post a comment