Manos Chorianopoulos

added PopupMerchantsViewController

......@@ -7,7 +7,7 @@
<key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>0</integer>
</dict>
</dict>
</dict>
......
......@@ -26,6 +26,8 @@
1E46B4C12BEBBDD800D5B488 /* WalletActiveCouponCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E46B4C02BEBBDD800D5B488 /* WalletActiveCouponCollectionViewCell.swift */; };
1E479FB329DD948B00C38193 /* WalletBadgesTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E479FB229DD948B00C38193 /* WalletBadgesTableViewCell.swift */; };
1E51678E2AE6934100FE66C3 /* WalletVouchersBannerTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E51678D2AE6934100FE66C3 /* WalletVouchersBannerTableViewCell.swift */; };
1E56DF732CC249B300F71882 /* MerchantTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E56DF722CC249B300F71882 /* MerchantTableViewCell.swift */; };
1E56DF752CC2620000F71882 /* PopupMerchantsFooterTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E56DF742CC2620000F71882 /* PopupMerchantsFooterTableViewCell.swift */; };
1E64E8FD2B8DE457001BA46E /* WalletQuestionnaireBannerTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E64E8FC2B8DE457001BA46E /* WalletQuestionnaireBannerTableViewCell.swift */; };
1E64E8FF2B8DE487001BA46E /* WalletHistoryBannerTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E64E8FE2B8DE487001BA46E /* WalletHistoryBannerTableViewCell.swift */; };
1E64E9012B8DE4AC001BA46E /* WalletEmptyViewTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E64E9002B8DE4AC001BA46E /* WalletEmptyViewTableViewCell.swift */; };
......@@ -62,6 +64,7 @@
1EDCDFAC28DB29E8002ED8F0 /* AnalysisMoreViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EDCDFAB28DB29E8002ED8F0 /* AnalysisMoreViewCell.swift */; };
1EDD4F892AE937AA00A6B5A6 /* LoyaltyHistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EDD4F882AE937AA00A6B5A6 /* LoyaltyHistoryViewController.swift */; };
1EE67DA32AE2AF2B0057C8CC /* UnifiedCouponsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EE67DA22AE2AF2B0057C8CC /* UnifiedCouponsViewController.swift */; };
1EEC5C582CC15C4600CF3CAC /* PopupMerchantsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EEC5C572CC15C4600CF3CAC /* PopupMerchantsViewController.swift */; };
7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0D5F56DD4E5371A50AD2D87 /* Pods_SwiftWarplyFramework.framework */; };
A02F34052882B6E60086465F /* TelcoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A02F34042882B6E60086465F /* TelcoViewController.swift */; };
A04D31DE288FF670000E43B5 /* HistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A04D31DD288FF670000E43B5 /* HistoryViewController.swift */; };
......@@ -220,6 +223,8 @@
1E46B4C02BEBBDD800D5B488 /* WalletActiveCouponCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletActiveCouponCollectionViewCell.swift; sourceTree = "<group>"; };
1E479FB229DD948B00C38193 /* WalletBadgesTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletBadgesTableViewCell.swift; sourceTree = "<group>"; };
1E51678D2AE6934100FE66C3 /* WalletVouchersBannerTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletVouchersBannerTableViewCell.swift; sourceTree = "<group>"; };
1E56DF722CC249B300F71882 /* MerchantTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MerchantTableViewCell.swift; sourceTree = "<group>"; };
1E56DF742CC2620000F71882 /* PopupMerchantsFooterTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PopupMerchantsFooterTableViewCell.swift; sourceTree = "<group>"; };
1E64E8FC2B8DE457001BA46E /* WalletQuestionnaireBannerTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletQuestionnaireBannerTableViewCell.swift; sourceTree = "<group>"; };
1E64E8FE2B8DE487001BA46E /* WalletHistoryBannerTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletHistoryBannerTableViewCell.swift; sourceTree = "<group>"; };
1E64E9002B8DE4AC001BA46E /* WalletEmptyViewTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletEmptyViewTableViewCell.swift; sourceTree = "<group>"; };
......@@ -255,6 +260,7 @@
1EDCDFAB28DB29E8002ED8F0 /* AnalysisMoreViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisMoreViewCell.swift; sourceTree = "<group>"; };
1EDD4F882AE937AA00A6B5A6 /* LoyaltyHistoryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoyaltyHistoryViewController.swift; sourceTree = "<group>"; };
1EE67DA22AE2AF2B0057C8CC /* UnifiedCouponsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnifiedCouponsViewController.swift; sourceTree = "<group>"; };
1EEC5C572CC15C4600CF3CAC /* PopupMerchantsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PopupMerchantsViewController.swift; sourceTree = "<group>"; };
A02F34042882B6E60086465F /* TelcoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TelcoViewController.swift; sourceTree = "<group>"; };
A04D31DD288FF670000E43B5 /* HistoryViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HistoryViewController.swift; sourceTree = "<group>"; };
A079366D2885D07700064122 /* AnalysisChildViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisChildViewController.swift; sourceTree = "<group>"; };
......@@ -567,6 +573,9 @@
1EB236AE28816CAB0063777A /* NumbersTableViewCell.swift */,
1EB5F4C728536FD60016F36E /* StepsViewController.swift */,
1E36E43C2CBFDD5100A60198 /* PopupInfoViewController.swift */,
1EEC5C572CC15C4600CF3CAC /* PopupMerchantsViewController.swift */,
1E56DF722CC249B300F71882 /* MerchantTableViewCell.swift */,
1E56DF742CC2620000F71882 /* PopupMerchantsFooterTableViewCell.swift */,
E6A77860282933E40045BBA8 /* MyApi.h */,
E6A778DC282933E60045BBA8 /* MyApi.m */,
E6A77862282933E50045BBA8 /* MyEmptyClass.swift */,
......@@ -993,6 +1002,7 @@
E6A77901282933E60045BBA8 /* WLBaseItem.m in Sources */,
1EE67DA32AE2AF2B0057C8CC /* UnifiedCouponsViewController.swift in Sources */,
1E74838D28378AF40042A589 /* CouponBarcodeViewController.swift in Sources */,
1E56DF732CC249B300F71882 /* MerchantTableViewCell.swift in Sources */,
1E479FB329DD948B00C38193 /* WalletBadgesTableViewCell.swift in Sources */,
1E151F1829DAE48500951FA0 /* UnifiedCouponsTableViewCell.swift in Sources */,
E6A778F0282933E60045BBA8 /* WLNativeAdsCollectionMode.m in Sources */,
......@@ -1059,6 +1069,7 @@
E6A77947282933E70045BBA8 /* FMDatabaseQueue.m in Sources */,
E6A77922282933E60045BBA8 /* NSData+SSToolkitAdditions.m in Sources */,
1EA771AC290977CA0030924C /* CopyableLabel.swift in Sources */,
1E56DF752CC2620000F71882 /* PopupMerchantsFooterTableViewCell.swift in Sources */,
1EB236AB28816B680063777A /* ShareViewController.swift in Sources */,
E6A778E7282933E60045BBA8 /* DetailsViewController.swift in Sources */,
1EB5F4CA285370C90016F36E /* LoyaltyAnalysisViewController.swift in Sources */,
......@@ -1087,6 +1098,7 @@
A04D31DE288FF670000E43B5 /* HistoryViewController.swift in Sources */,
E6A7792A282933E70045BBA8 /* AFNetworkActivityIndicatorManager.m in Sources */,
E6A77914282933E60045BBA8 /* WLUserManager.m in Sources */,
1EEC5C582CC15C4600CF3CAC /* PopupMerchantsViewController.swift in Sources */,
1EB236AF28816CAC0063777A /* NumbersTableViewCell.swift in Sources */,
E6A7794F282933E70045BBA8 /* FMDatabasePool.m in Sources */,
1EB236AD28816C560063777A /* NumberPopupViewController.swift in Sources */,
......
......@@ -7,7 +7,7 @@
<key>SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>1</integer>
</dict>
</dict>
</dict>
......
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "30A67F8F-7993-41EC-813B-55466ABD0520"
type = "0"
version = "2.0">
</Bucket>
......@@ -640,7 +640,18 @@ import AVFoundation
@IBAction func redeemButtomAction(_ sender: Any) {
if (isSMCoupon == true) {
// TODO: Open popup
let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
if let popupVC = storyboard.instantiateViewController(withIdentifier: "PopupMerchantsViewController") as? SwiftWarplyFramework.PopupMerchantsViewController {
popupVC.modalPresentationStyle = .overCurrentContext
popupVC.modalTransitionStyle = .crossDissolve
popupVC.coupon = coupon
// popupVC.headerText = "Βρες το προϊον στα supermarket"
// popupVC.buttonTitle = "Βρες το"
popupVC.buttonIcon = "shopping_cart"
// popupVC.footerText = "Η διαθεσιμότητα ενδέχεται να διαφέρει ανάλογα με την τοποθεσία."
self.present(popupVC, animated: true, completion: nil)
}
} else {
let couponSetData: swiftApi.CouponSetItemModel? = self.coupon?.couponset_data
......
......@@ -6309,6 +6309,286 @@
</objects>
<point key="canvasLocation" x="4654" y="-555"/>
</scene>
<!--Popup Merchants View Controller-->
<scene sceneID="8JJ-l6-YRO">
<objects>
<viewController storyboardIdentifier="PopupMerchantsViewController" hidesBottomBarWhenPushed="YES" id="iwV-Nc-oRp" customClass="PopupMerchantsViewController" customModule="SwiftWarplyFramework" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="sJG-DH-ZB3">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="iUx-aw-MaF" userLabel="Main View">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<subviews>
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="cSR-WK-qb0">
<rect key="frame" x="0.0" y="255.5" width="414" height="596.5"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="MNf-7L-OWL" userLabel="Header View">
<rect key="frame" x="20" y="15" width="374" height="20"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Βρες το προϊον στα supermarket" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kH9-FC-wgF">
<rect key="frame" x="0.0" y="0.0" width="324" height="20"/>
<fontDescription key="fontDescription" name="BTCosmo-Bold" family="BTCosmo" pointSize="17"/>
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="DHk-2H-5fK">
<rect key="frame" x="344" y="-5" width="30" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="fGV-ew-xRf"/>
<constraint firstAttribute="width" constant="30" id="mwr-jl-UUv"/>
</constraints>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" image="ic_close_2"/>
<connections>
<action selector="closeButtonAction:" destination="iwV-Nc-oRp" eventType="touchUpInside" id="Sxb-z3-ktu"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="DHk-2H-5fK" firstAttribute="centerY" secondItem="MNf-7L-OWL" secondAttribute="centerY" id="77O-kU-a9D"/>
<constraint firstItem="DHk-2H-5fK" firstAttribute="leading" secondItem="kH9-FC-wgF" secondAttribute="trailing" constant="20" id="8VK-Ez-Tuj"/>
<constraint firstItem="kH9-FC-wgF" firstAttribute="top" secondItem="MNf-7L-OWL" secondAttribute="top" id="FqK-9R-gFv"/>
<constraint firstAttribute="trailing" secondItem="DHk-2H-5fK" secondAttribute="trailing" id="Rdr-eb-HWU"/>
<constraint firstItem="kH9-FC-wgF" firstAttribute="leading" secondItem="MNf-7L-OWL" secondAttribute="leading" id="Xz6-BB-gZA"/>
<constraint firstAttribute="bottom" secondItem="kH9-FC-wgF" secondAttribute="bottom" id="cNA-DV-1fn"/>
</constraints>
</view>
<tableView clipsSubviews="YES" contentMode="scaleToFill" ambiguous="YES" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="vet-Po-Bmf" customClass="DynamicSizeTableView" customModule="SwiftWarplyFramework" customModuleProvider="target">
<rect key="frame" x="0.0" y="49.5" width="414" height="547"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="separatorColor" red="0.68235294120000001" green="0.68235294120000001" blue="0.68235294120000001" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
<inset key="separatorInset" minX="10" minY="0.0" maxX="10" maxY="0.0"/>
<color key="sectionIndexBackgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="MerchantTableViewCellId" id="fym-iB-q6x" customClass="MerchantTableViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target">
<rect key="frame" x="0.0" y="50" width="414" height="56"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="fym-iB-q6x" id="jOZ-KL-eu1">
<rect key="frame" x="0.0" y="0.0" width="414" height="56"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="TQn-b5-U6q">
<rect key="frame" x="18" y="0.0" width="378" height="56"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Ldh-p8-Z1j">
<rect key="frame" x="30" y="10" width="129" height="36"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="36" id="p6j-w9-UR3"/>
</constraints>
</imageView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4sH-ua-n19">
<rect key="frame" x="219" y="10" width="150" height="36"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Βρες το" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hcY-Gy-D9a">
<rect key="frame" x="51.5" y="10" width="47.5" height="16"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" name="PeridotPE-SBold" family="Peridot PE" pointSize="13"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="nxs-7H-oUv">
<rect key="frame" x="125" y="10.5" width="15" height="15"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="15" id="ai2-dj-onP"/>
<constraint firstAttribute="height" constant="15" id="cpx-AJ-aLJ"/>
</constraints>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="2mY-Jh-47W">
<rect key="frame" x="0.0" y="0.0" width="150" height="36"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Button">
<color key="titleColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
</button>
</subviews>
<color key="backgroundColor" red="0.054901960784313725" green="0.65098039215686276" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="2mY-Jh-47W" secondAttribute="bottom" id="4j7-Vv-2rZ"/>
<constraint firstItem="hcY-Gy-D9a" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="4sH-ua-n19" secondAttribute="leading" id="5Os-5f-b82"/>
<constraint firstAttribute="width" constant="150" id="81s-Vg-PV8"/>
<constraint firstItem="nxs-7H-oUv" firstAttribute="centerY" secondItem="4sH-ua-n19" secondAttribute="centerY" id="B7g-f4-ZCn"/>
<constraint firstAttribute="height" constant="36" id="Baf-Z8-F8w"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="hcY-Gy-D9a" secondAttribute="trailing" id="WfX-gY-3Om"/>
<constraint firstAttribute="trailing" secondItem="2mY-Jh-47W" secondAttribute="trailing" id="Z2L-P1-r52"/>
<constraint firstItem="hcY-Gy-D9a" firstAttribute="centerX" secondItem="4sH-ua-n19" secondAttribute="centerX" id="ZNJ-fc-Cwf"/>
<constraint firstAttribute="trailing" secondItem="nxs-7H-oUv" secondAttribute="trailing" constant="10" id="hTm-fO-Jha"/>
<constraint firstItem="2mY-Jh-47W" firstAttribute="leading" secondItem="4sH-ua-n19" secondAttribute="leading" id="hkl-wW-fWS"/>
<constraint firstItem="hcY-Gy-D9a" firstAttribute="centerY" secondItem="4sH-ua-n19" secondAttribute="centerY" id="kFW-z2-WvV"/>
<constraint firstItem="2mY-Jh-47W" firstAttribute="top" secondItem="4sH-ua-n19" secondAttribute="top" id="q7p-qJ-aFh"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" red="0.94901960784313721" green="0.94901960784313721" blue="0.95294117647058818" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="Ldh-p8-Z1j" firstAttribute="leading" secondItem="TQn-b5-U6q" secondAttribute="leading" constant="30" id="2aw-gT-BVN"/>
<constraint firstAttribute="height" constant="56" id="Xyd-6p-fo2"/>
<constraint firstAttribute="trailing" secondItem="4sH-ua-n19" secondAttribute="trailing" constant="9" id="lbe-QE-jiR"/>
<constraint firstItem="4sH-ua-n19" firstAttribute="centerY" secondItem="TQn-b5-U6q" secondAttribute="centerY" id="wGb-H6-wLJ"/>
<constraint firstItem="4sH-ua-n19" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Ldh-p8-Z1j" secondAttribute="trailing" constant="40" id="yXs-PY-sxL"/>
<constraint firstItem="Ldh-p8-Z1j" firstAttribute="centerY" secondItem="TQn-b5-U6q" secondAttribute="centerY" id="zmN-GO-87t"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="TQn-b5-U6q" secondAttribute="bottom" id="DlG-eC-Miw"/>
<constraint firstItem="TQn-b5-U6q" firstAttribute="top" secondItem="jOZ-KL-eu1" secondAttribute="top" id="Znl-Kn-l4H"/>
<constraint firstItem="TQn-b5-U6q" firstAttribute="leading" secondItem="jOZ-KL-eu1" secondAttribute="leading" constant="18" id="dsI-sU-JVJ"/>
<constraint firstAttribute="trailing" secondItem="TQn-b5-U6q" secondAttribute="trailing" constant="18" id="prx-5Z-TVo"/>
</constraints>
</tableViewCellContentView>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<connections>
<outlet property="actionButton" destination="2mY-Jh-47W" id="Jk6-1P-gPc"/>
<outlet property="buttonIconImage" destination="nxs-7H-oUv" id="UoM-BD-83C"/>
<outlet property="buttonTitleLable" destination="hcY-Gy-D9a" id="B1r-cj-fhu"/>
<outlet property="buttonView" destination="4sH-ua-n19" id="dZf-hZ-kkY"/>
<outlet property="mainView" destination="TQn-b5-U6q" id="Zqn-LV-39i"/>
<outlet property="merchantImage" destination="Ldh-p8-Z1j" id="seH-g2-g1N"/>
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="PopupMerchantsFooterTableViewCellId" id="f5f-VE-AbI" customClass="PopupMerchantsFooterTableViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target">
<rect key="frame" x="0.0" y="106" width="414" height="100"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="f5f-VE-AbI" id="YhO-v9-8eO">
<rect key="frame" x="0.0" y="0.0" width="414" height="100"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Sqn-ZO-eeZ">
<rect key="frame" x="0.0" y="0.0" width="414" height="100"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Η διαθεσιμότητα ενδέχεται να διαφέρει ανάλογα με την τοποθεσία." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vxR-zz-pSz">
<rect key="frame" x="85" y="34" width="244" height="32"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" name="PeridotPE-Regular" family="Peridot PE" pointSize="13"/>
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="vxR-zz-pSz" secondAttribute="trailing" constant="85" id="OWO-u7-WWF"/>
<constraint firstAttribute="height" constant="100" id="eZl-5f-t1k"/>
<constraint firstItem="vxR-zz-pSz" firstAttribute="centerY" secondItem="Sqn-ZO-eeZ" secondAttribute="centerY" id="r24-9D-0zA"/>
<constraint firstItem="vxR-zz-pSz" firstAttribute="leading" secondItem="Sqn-ZO-eeZ" secondAttribute="leading" constant="85" id="vEI-wS-wEv"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="Sqn-ZO-eeZ" firstAttribute="top" secondItem="YhO-v9-8eO" secondAttribute="top" id="QAC-bq-RbO"/>
<constraint firstAttribute="trailing" secondItem="Sqn-ZO-eeZ" secondAttribute="trailing" id="RFj-Z0-5Gz"/>
<constraint firstItem="Sqn-ZO-eeZ" firstAttribute="leading" secondItem="YhO-v9-8eO" secondAttribute="leading" id="orr-aV-LnY"/>
<constraint firstAttribute="bottom" secondItem="Sqn-ZO-eeZ" secondAttribute="bottom" id="zvg-YA-KpH"/>
</constraints>
</tableViewCellContentView>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<connections>
<outlet property="footerLabel" destination="vxR-zz-pSz" id="oSQ-LA-sH2"/>
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="none" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="NumbersTableViewCellId" id="7th-XY-id2" customClass="NumbersTableViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target">
<rect key="frame" x="0.0" y="206" width="414" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="7th-XY-id2" id="sba-cW-aLa">
<rect key="frame" x="0.0" y="0.0" width="414" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="3FX-pw-igJ">
<rect key="frame" x="10" y="0.0" width="394" height="44"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eIQ-GE-tmI">
<rect key="frame" x="10" y="12" width="374" height="20"/>
<fontDescription key="fontDescription" name="PeridotPE-Regular" family="Peridot PE" pointSize="16"/>
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="PfS-DC-sxg" userLabel="Border View">
<rect key="frame" x="0.0" y="43" width="394" height="1"/>
<color key="backgroundColor" red="0.90196078430000004" green="0.90196078430000004" blue="0.90196078430000004" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="wBF-j6-hGT"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="PfS-DC-sxg" secondAttribute="bottom" id="Ysf-0V-igf"/>
<constraint firstAttribute="trailing" secondItem="eIQ-GE-tmI" secondAttribute="trailing" constant="10" id="c1S-rd-eWA"/>
<constraint firstItem="PfS-DC-sxg" firstAttribute="leading" secondItem="3FX-pw-igJ" secondAttribute="leading" id="kRg-gz-p0i"/>
<constraint firstItem="eIQ-GE-tmI" firstAttribute="centerY" secondItem="3FX-pw-igJ" secondAttribute="centerY" id="nG7-2j-fz5"/>
<constraint firstAttribute="trailing" secondItem="PfS-DC-sxg" secondAttribute="trailing" id="umr-gL-thZ"/>
<constraint firstItem="eIQ-GE-tmI" firstAttribute="leading" secondItem="3FX-pw-igJ" secondAttribute="leading" constant="10" id="zmM-cd-EhC"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="3FX-pw-igJ" secondAttribute="trailing" constant="10" id="8DT-AO-Tzj"/>
<constraint firstAttribute="bottom" secondItem="3FX-pw-igJ" secondAttribute="bottom" id="JZa-Rk-uxO"/>
<constraint firstItem="3FX-pw-igJ" firstAttribute="leading" secondItem="sba-cW-aLa" secondAttribute="leading" constant="10" id="K7T-Ef-xdA"/>
<constraint firstItem="3FX-pw-igJ" firstAttribute="top" secondItem="sba-cW-aLa" secondAttribute="top" id="l62-qG-UFb"/>
</constraints>
</tableViewCellContentView>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<connections>
<outlet property="borderView" destination="PfS-DC-sxg" id="0DO-qJ-s7g"/>
<outlet property="numberLabel" destination="eIQ-GE-tmI" id="oY8-xU-kJM"/>
</connections>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="iwV-Nc-oRp" id="KIC-jh-szB"/>
<outlet property="delegate" destination="iwV-Nc-oRp" id="KHM-ru-jOc"/>
</connections>
</tableView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="MNf-7L-OWL" firstAttribute="leading" secondItem="cSR-WK-qb0" secondAttribute="leading" constant="20" id="0UF-Fk-tDs"/>
<constraint firstAttribute="trailing" secondItem="MNf-7L-OWL" secondAttribute="trailing" constant="20" id="3aK-Rx-22N"/>
<constraint firstAttribute="bottom" secondItem="vet-Po-Bmf" secondAttribute="bottom" constant="30" id="B03-fG-aC2"/>
<constraint firstItem="vet-Po-Bmf" firstAttribute="leading" secondItem="cSR-WK-qb0" secondAttribute="leading" id="F8e-cg-wdq"/>
<constraint firstItem="MNf-7L-OWL" firstAttribute="top" secondItem="cSR-WK-qb0" secondAttribute="top" constant="15" id="N8O-in-CB3"/>
<constraint firstItem="vet-Po-Bmf" firstAttribute="top" secondItem="MNf-7L-OWL" secondAttribute="bottom" constant="15" id="hl9-87-bJ7"/>
<constraint firstAttribute="trailing" secondItem="vet-Po-Bmf" secondAttribute="trailing" id="lgN-8i-jJk"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" red="0.1529411765" green="0.1529411765" blue="0.1529411765" alpha="0.57999999999999996" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="cSR-WK-qb0" secondAttribute="trailing" id="G7t-Dj-L0z"/>
<constraint firstItem="cSR-WK-qb0" firstAttribute="leading" secondItem="iUx-aw-MaF" secondAttribute="leading" id="WuY-gU-rja"/>
<constraint firstItem="cSR-WK-qb0" firstAttribute="height" relation="lessThanOrEqual" secondItem="iUx-aw-MaF" secondAttribute="height" multiplier="0.7" id="ZRT-Sj-HhH"/>
<constraint firstAttribute="bottom" secondItem="cSR-WK-qb0" secondAttribute="bottom" id="cN3-Su-boG"/>
</constraints>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="qkT-Tz-8VP"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="iUx-aw-MaF" firstAttribute="top" secondItem="sJG-DH-ZB3" secondAttribute="top" id="isi-la-Ymv"/>
<constraint firstAttribute="trailing" secondItem="iUx-aw-MaF" secondAttribute="trailing" id="qzZ-Wp-CrI"/>
<constraint firstAttribute="bottom" secondItem="iUx-aw-MaF" secondAttribute="bottom" id="ryq-2v-g8u"/>
<constraint firstItem="iUx-aw-MaF" firstAttribute="leading" secondItem="sJG-DH-ZB3" secondAttribute="leading" id="yCy-8t-atP"/>
</constraints>
</view>
<connections>
<outlet property="closeButton" destination="DHk-2H-5fK" id="TUl-tB-Qnf"/>
<outlet property="headerLabel" destination="kH9-FC-wgF" id="qn9-iq-voR"/>
<outlet property="popupView" destination="cSR-WK-qb0" id="Hy8-rg-2pw"/>
<outlet property="tableView" destination="vet-Po-Bmf" id="eXq-4j-cNU"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="hLa-dm-IDF" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="5412" y="-555"/>
</scene>
<!--Coupon View Controller-->
<scene sceneID="yGm-Im-aAN">
<objects>
......
{
"images" : [
{
"filename" : "shopping_cart.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "shopping_cart 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "shopping_cart 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
//
// MerchantTableViewCell.swift
// SwiftWarplyFramework
//
// Created by Manos Chorianopoulos on 18/10/24.
//
import UIKit
// Define a protocol (if using delegation)
protocol MerchantTableViewCellDelegate: AnyObject {
func didTapButton(in cell: MerchantTableViewCell)
}
class MerchantTableViewCell: UITableViewCell {
@IBOutlet weak var mainView: UIView!
@IBOutlet weak var merchantImage: UIImageView!
@IBOutlet weak var buttonView: UIView!
@IBOutlet weak var buttonTitleLable: UILabel!
@IBOutlet weak var buttonIconImage: UIImageView!
@IBOutlet weak var actionButton: UIButton!
// Delegate variable
weak var delegate: MerchantTableViewCellDelegate?
var postImageURL: String? {
didSet {
if let url = postImageURL {
self.merchantImage.image = UIImage() // UIImage(named: "loading")
UIImage.loadImageUsingCacheWithUrlString(url) { image in
// set the image only when we are still displaying the content for the image we finished downloading
if url == self.postImageURL {
self.merchantImage.image = image
}
}
}
else {
self.merchantImage.image = nil
}
}
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
mainView.backgroundColor = UIColor(rgb: 0xF2F2F3)
mainView.layer.cornerRadius = 20.0
buttonTitleLable.font = UIFont(name: "PeridotPE-SBold", size: 13)
buttonTitleLable.textColor = UIColor(rgb: 0xFFFFFF)
buttonView.backgroundColor = UIColor(rgb: 0x0EA600)
buttonView.layer.cornerRadius = 12.0
// Add action for button tap
actionButton.addTarget(self, action: #selector(buttonTapped), for: .touchUpInside)
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
public override func layoutSubviews() {
super.layoutSubviews()
//set the values for top,left,bottom,right margins
let margins = UIEdgeInsets(top: 0, left: 0, bottom: 32, right: 0)
contentView.frame = contentView.frame.inset(by: margins)
}
func configureCell(merchant: swiftApi.MerchantModel, buttonTitle: String, iconImage: String?) {
self.postImageURL = merchant._img_preview
buttonTitleLable.text = buttonTitle
if let iconImage {
self.buttonIconImage.image = UIImage(named: iconImage)
self.buttonIconImage.isHidden = false
} else {
self.buttonIconImage.isHidden = true
}
}
@objc private func buttonTapped() {
// Notify the delegate when button is tapped
delegate?.didTapButton(in: self)
}
}
//
// PopupMerchantsFooterTableViewCell.swift
// SwiftWarplyFramework
//
// Created by Manos Chorianopoulos on 18/10/24.
//
import UIKit
class PopupMerchantsFooterTableViewCell: UITableViewCell {
@IBOutlet weak var footerLabel: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
footerLabel.font = UIFont(name: "PeridotPE-Regular", size: 13)
footerLabel.textColor = UIColor(rgb: 0x000000)
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
func configureCell(title: String) {
footerLabel.text = title
}
}
//
// PopupSMMerchantsViewController.swift
// SwiftWarplyFramework
//
// Created by Manos Chorianopoulos on 17/10/24.
//
import UIKit
class PopupMerchantsViewController: UIViewController {
@IBOutlet weak var popupView: UIView!
@IBOutlet weak var headerLabel: UILabel!
@IBOutlet weak var closeButton: UIButton!
@IBOutlet weak var tableView: DynamicSizeTableView!
public var coupon: swiftApi.CouponItemModel?
public var headerText: String? = "Βρες το προϊον στα supermarket"
public var buttonTitle: String? = "Βρες το"
public var buttonIcon: String?
public var footerText: String? = "Η διαθεσιμότητα ενδέχεται να διαφέρει ανάλογα με την τοποθεσία."
let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList()
override func viewDidLoad() {
super.viewDidLoad()
tableView.delegate = self
tableView.dataSource = self
tableView.contentInset.top = 75
popupView.clipsToBounds = true
popupView.layer.cornerRadius = 16
popupView.layer.maskedCorners = [ .layerMinXMinYCorner, .layerMaxXMinYCorner] // Top left, right corner radius
closeButton.setImage(UIImage(named: "ic_close_3.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
closeButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
// self.tableView.reloadData()
self.tableView.invalidateIntrinsicContentSize()
self.headerLabel.text = self.headerText
headerLabel.font = UIFont(name: "BTCosmo-Bold", size: 18)
headerLabel.textColor = UIColor(rgb: 0x000000)
}
// MARK: - UIButton Actions
@IBAction func closeButtonAction(_ sender: Any) {
}
}
// MARK: - TableView
extension PopupMerchantsViewController: UITableViewDelegate, UITableViewDataSource{
public func numberOfSections(in tableView: UITableView) -> Int {
return 2
}
public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if (section == 0) {
return self.merchantList.count
} else if (section == 1) {
return 1
} else {
return 0
}
}
public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if (indexPath.section == 0) {
return 56.0 + 32.0
// return UITableViewAutomaticDimension
} else if (indexPath.section == 1) {
return 100.0
} else {
return 0.0
}
// return UITableViewAutomaticDimension
}
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if (indexPath.section == 0) {
let cell = tableView.dequeueReusableCell(withIdentifier: "MerchantTableViewCellId", for: indexPath) as! MerchantTableViewCell
cell.configureCell(merchant: merchantList[indexPath.row], buttonTitle: self.buttonTitle ?? "Βρες το", iconImage: buttonIcon)
return cell
} else {
let cell = tableView.dequeueReusableCell(withIdentifier: "PopupMerchantsFooterTableViewCellId", for: indexPath) as! PopupMerchantsFooterTableViewCell
cell.configureCell(title: self.footerText ?? "Η διαθεσιμότητα ενδέχεται να διαφέρει ανάλογα με την τοποθεσία.")
return cell
}
}
public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
// self.dismiss(animated: true, completion: {})
// TODO: DELETE LOGS
print(" didSelectRowAt Button tapped in row \(indexPath.row)")
// TODO: Open merchant url
// Logs
// let couponSetData: swiftApi.CouponSetItemModel? = coupons[indexPath.row].couponset_data
// print("Coupon clicked: " + (coupons[indexPath.row].coupon ?? ""))
// print("Coupon Name clicked: " + (couponSetData?.name ?? ""))
// print("Coupon Description clicked: " + (couponSetData?.short_description ?? ""))
// print("Coupon Expiration clicked: " + (coupons[indexPath.row].expiration ?? ""))
}
public func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return nil
}
public func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 0.0
}
public func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
// return CGFloat.leastNormalMagnitude
return 0.0
}
public func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return nil
}
}
// MARK: - MerchantTableViewCellDelegate
extension PopupMerchantsViewController: MerchantTableViewCellDelegate {
func didTapButton(in cell: MerchantTableViewCell) {
// Find the index path of the cell where the button was tapped
if let indexPath = tableView.indexPath(for: cell) {
// TODO: DELETE LOGS
print("Button tapped in row \(indexPath.row)")
print("Button tapped cell: \(cell)")
// Handle the button tap action here
}
}
}