Manos Chorianopoulos

added PopupMerchantsViewController

...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
7 <key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key> 7 <key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key>
8 <dict> 8 <dict>
9 <key>orderHint</key> 9 <key>orderHint</key>
10 - <integer>1</integer> 10 + <integer>0</integer>
11 </dict> 11 </dict>
12 </dict> 12 </dict>
13 </dict> 13 </dict>
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
26 1E46B4C12BEBBDD800D5B488 /* WalletActiveCouponCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E46B4C02BEBBDD800D5B488 /* WalletActiveCouponCollectionViewCell.swift */; }; 26 1E46B4C12BEBBDD800D5B488 /* WalletActiveCouponCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E46B4C02BEBBDD800D5B488 /* WalletActiveCouponCollectionViewCell.swift */; };
27 1E479FB329DD948B00C38193 /* WalletBadgesTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E479FB229DD948B00C38193 /* WalletBadgesTableViewCell.swift */; }; 27 1E479FB329DD948B00C38193 /* WalletBadgesTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E479FB229DD948B00C38193 /* WalletBadgesTableViewCell.swift */; };
28 1E51678E2AE6934100FE66C3 /* WalletVouchersBannerTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E51678D2AE6934100FE66C3 /* WalletVouchersBannerTableViewCell.swift */; }; 28 1E51678E2AE6934100FE66C3 /* WalletVouchersBannerTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E51678D2AE6934100FE66C3 /* WalletVouchersBannerTableViewCell.swift */; };
29 + 1E56DF732CC249B300F71882 /* MerchantTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E56DF722CC249B300F71882 /* MerchantTableViewCell.swift */; };
30 + 1E56DF752CC2620000F71882 /* PopupMerchantsFooterTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E56DF742CC2620000F71882 /* PopupMerchantsFooterTableViewCell.swift */; };
29 1E64E8FD2B8DE457001BA46E /* WalletQuestionnaireBannerTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E64E8FC2B8DE457001BA46E /* WalletQuestionnaireBannerTableViewCell.swift */; }; 31 1E64E8FD2B8DE457001BA46E /* WalletQuestionnaireBannerTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E64E8FC2B8DE457001BA46E /* WalletQuestionnaireBannerTableViewCell.swift */; };
30 1E64E8FF2B8DE487001BA46E /* WalletHistoryBannerTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E64E8FE2B8DE487001BA46E /* WalletHistoryBannerTableViewCell.swift */; }; 32 1E64E8FF2B8DE487001BA46E /* WalletHistoryBannerTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E64E8FE2B8DE487001BA46E /* WalletHistoryBannerTableViewCell.swift */; };
31 1E64E9012B8DE4AC001BA46E /* WalletEmptyViewTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E64E9002B8DE4AC001BA46E /* WalletEmptyViewTableViewCell.swift */; }; 33 1E64E9012B8DE4AC001BA46E /* WalletEmptyViewTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E64E9002B8DE4AC001BA46E /* WalletEmptyViewTableViewCell.swift */; };
...@@ -62,6 +64,7 @@ ...@@ -62,6 +64,7 @@
62 1EDCDFAC28DB29E8002ED8F0 /* AnalysisMoreViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EDCDFAB28DB29E8002ED8F0 /* AnalysisMoreViewCell.swift */; }; 64 1EDCDFAC28DB29E8002ED8F0 /* AnalysisMoreViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EDCDFAB28DB29E8002ED8F0 /* AnalysisMoreViewCell.swift */; };
63 1EDD4F892AE937AA00A6B5A6 /* LoyaltyHistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EDD4F882AE937AA00A6B5A6 /* LoyaltyHistoryViewController.swift */; }; 65 1EDD4F892AE937AA00A6B5A6 /* LoyaltyHistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EDD4F882AE937AA00A6B5A6 /* LoyaltyHistoryViewController.swift */; };
64 1EE67DA32AE2AF2B0057C8CC /* UnifiedCouponsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EE67DA22AE2AF2B0057C8CC /* UnifiedCouponsViewController.swift */; }; 66 1EE67DA32AE2AF2B0057C8CC /* UnifiedCouponsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EE67DA22AE2AF2B0057C8CC /* UnifiedCouponsViewController.swift */; };
67 + 1EEC5C582CC15C4600CF3CAC /* PopupMerchantsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EEC5C572CC15C4600CF3CAC /* PopupMerchantsViewController.swift */; };
65 7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0D5F56DD4E5371A50AD2D87 /* Pods_SwiftWarplyFramework.framework */; }; 68 7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0D5F56DD4E5371A50AD2D87 /* Pods_SwiftWarplyFramework.framework */; };
66 A02F34052882B6E60086465F /* TelcoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A02F34042882B6E60086465F /* TelcoViewController.swift */; }; 69 A02F34052882B6E60086465F /* TelcoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A02F34042882B6E60086465F /* TelcoViewController.swift */; };
67 A04D31DE288FF670000E43B5 /* HistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A04D31DD288FF670000E43B5 /* HistoryViewController.swift */; }; 70 A04D31DE288FF670000E43B5 /* HistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A04D31DD288FF670000E43B5 /* HistoryViewController.swift */; };
...@@ -220,6 +223,8 @@ ...@@ -220,6 +223,8 @@
220 1E46B4C02BEBBDD800D5B488 /* WalletActiveCouponCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletActiveCouponCollectionViewCell.swift; sourceTree = "<group>"; }; 223 1E46B4C02BEBBDD800D5B488 /* WalletActiveCouponCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletActiveCouponCollectionViewCell.swift; sourceTree = "<group>"; };
221 1E479FB229DD948B00C38193 /* WalletBadgesTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletBadgesTableViewCell.swift; sourceTree = "<group>"; }; 224 1E479FB229DD948B00C38193 /* WalletBadgesTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletBadgesTableViewCell.swift; sourceTree = "<group>"; };
222 1E51678D2AE6934100FE66C3 /* WalletVouchersBannerTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletVouchersBannerTableViewCell.swift; sourceTree = "<group>"; }; 225 1E51678D2AE6934100FE66C3 /* WalletVouchersBannerTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletVouchersBannerTableViewCell.swift; sourceTree = "<group>"; };
226 + 1E56DF722CC249B300F71882 /* MerchantTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MerchantTableViewCell.swift; sourceTree = "<group>"; };
227 + 1E56DF742CC2620000F71882 /* PopupMerchantsFooterTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PopupMerchantsFooterTableViewCell.swift; sourceTree = "<group>"; };
223 1E64E8FC2B8DE457001BA46E /* WalletQuestionnaireBannerTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletQuestionnaireBannerTableViewCell.swift; sourceTree = "<group>"; }; 228 1E64E8FC2B8DE457001BA46E /* WalletQuestionnaireBannerTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletQuestionnaireBannerTableViewCell.swift; sourceTree = "<group>"; };
224 1E64E8FE2B8DE487001BA46E /* WalletHistoryBannerTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletHistoryBannerTableViewCell.swift; sourceTree = "<group>"; }; 229 1E64E8FE2B8DE487001BA46E /* WalletHistoryBannerTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletHistoryBannerTableViewCell.swift; sourceTree = "<group>"; };
225 1E64E9002B8DE4AC001BA46E /* WalletEmptyViewTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletEmptyViewTableViewCell.swift; sourceTree = "<group>"; }; 230 1E64E9002B8DE4AC001BA46E /* WalletEmptyViewTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletEmptyViewTableViewCell.swift; sourceTree = "<group>"; };
...@@ -255,6 +260,7 @@ ...@@ -255,6 +260,7 @@
255 1EDCDFAB28DB29E8002ED8F0 /* AnalysisMoreViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisMoreViewCell.swift; sourceTree = "<group>"; }; 260 1EDCDFAB28DB29E8002ED8F0 /* AnalysisMoreViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisMoreViewCell.swift; sourceTree = "<group>"; };
256 1EDD4F882AE937AA00A6B5A6 /* LoyaltyHistoryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoyaltyHistoryViewController.swift; sourceTree = "<group>"; }; 261 1EDD4F882AE937AA00A6B5A6 /* LoyaltyHistoryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoyaltyHistoryViewController.swift; sourceTree = "<group>"; };
257 1EE67DA22AE2AF2B0057C8CC /* UnifiedCouponsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnifiedCouponsViewController.swift; sourceTree = "<group>"; }; 262 1EE67DA22AE2AF2B0057C8CC /* UnifiedCouponsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnifiedCouponsViewController.swift; sourceTree = "<group>"; };
263 + 1EEC5C572CC15C4600CF3CAC /* PopupMerchantsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PopupMerchantsViewController.swift; sourceTree = "<group>"; };
258 A02F34042882B6E60086465F /* TelcoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TelcoViewController.swift; sourceTree = "<group>"; }; 264 A02F34042882B6E60086465F /* TelcoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TelcoViewController.swift; sourceTree = "<group>"; };
259 A04D31DD288FF670000E43B5 /* HistoryViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HistoryViewController.swift; sourceTree = "<group>"; }; 265 A04D31DD288FF670000E43B5 /* HistoryViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HistoryViewController.swift; sourceTree = "<group>"; };
260 A079366D2885D07700064122 /* AnalysisChildViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisChildViewController.swift; sourceTree = "<group>"; }; 266 A079366D2885D07700064122 /* AnalysisChildViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisChildViewController.swift; sourceTree = "<group>"; };
...@@ -567,6 +573,9 @@ ...@@ -567,6 +573,9 @@
567 1EB236AE28816CAB0063777A /* NumbersTableViewCell.swift */, 573 1EB236AE28816CAB0063777A /* NumbersTableViewCell.swift */,
568 1EB5F4C728536FD60016F36E /* StepsViewController.swift */, 574 1EB5F4C728536FD60016F36E /* StepsViewController.swift */,
569 1E36E43C2CBFDD5100A60198 /* PopupInfoViewController.swift */, 575 1E36E43C2CBFDD5100A60198 /* PopupInfoViewController.swift */,
576 + 1EEC5C572CC15C4600CF3CAC /* PopupMerchantsViewController.swift */,
577 + 1E56DF722CC249B300F71882 /* MerchantTableViewCell.swift */,
578 + 1E56DF742CC2620000F71882 /* PopupMerchantsFooterTableViewCell.swift */,
570 E6A77860282933E40045BBA8 /* MyApi.h */, 579 E6A77860282933E40045BBA8 /* MyApi.h */,
571 E6A778DC282933E60045BBA8 /* MyApi.m */, 580 E6A778DC282933E60045BBA8 /* MyApi.m */,
572 E6A77862282933E50045BBA8 /* MyEmptyClass.swift */, 581 E6A77862282933E50045BBA8 /* MyEmptyClass.swift */,
...@@ -993,6 +1002,7 @@ ...@@ -993,6 +1002,7 @@
993 E6A77901282933E60045BBA8 /* WLBaseItem.m in Sources */, 1002 E6A77901282933E60045BBA8 /* WLBaseItem.m in Sources */,
994 1EE67DA32AE2AF2B0057C8CC /* UnifiedCouponsViewController.swift in Sources */, 1003 1EE67DA32AE2AF2B0057C8CC /* UnifiedCouponsViewController.swift in Sources */,
995 1E74838D28378AF40042A589 /* CouponBarcodeViewController.swift in Sources */, 1004 1E74838D28378AF40042A589 /* CouponBarcodeViewController.swift in Sources */,
1005 + 1E56DF732CC249B300F71882 /* MerchantTableViewCell.swift in Sources */,
996 1E479FB329DD948B00C38193 /* WalletBadgesTableViewCell.swift in Sources */, 1006 1E479FB329DD948B00C38193 /* WalletBadgesTableViewCell.swift in Sources */,
997 1E151F1829DAE48500951FA0 /* UnifiedCouponsTableViewCell.swift in Sources */, 1007 1E151F1829DAE48500951FA0 /* UnifiedCouponsTableViewCell.swift in Sources */,
998 E6A778F0282933E60045BBA8 /* WLNativeAdsCollectionMode.m in Sources */, 1008 E6A778F0282933E60045BBA8 /* WLNativeAdsCollectionMode.m in Sources */,
...@@ -1059,6 +1069,7 @@ ...@@ -1059,6 +1069,7 @@
1059 E6A77947282933E70045BBA8 /* FMDatabaseQueue.m in Sources */, 1069 E6A77947282933E70045BBA8 /* FMDatabaseQueue.m in Sources */,
1060 E6A77922282933E60045BBA8 /* NSData+SSToolkitAdditions.m in Sources */, 1070 E6A77922282933E60045BBA8 /* NSData+SSToolkitAdditions.m in Sources */,
1061 1EA771AC290977CA0030924C /* CopyableLabel.swift in Sources */, 1071 1EA771AC290977CA0030924C /* CopyableLabel.swift in Sources */,
1072 + 1E56DF752CC2620000F71882 /* PopupMerchantsFooterTableViewCell.swift in Sources */,
1062 1EB236AB28816B680063777A /* ShareViewController.swift in Sources */, 1073 1EB236AB28816B680063777A /* ShareViewController.swift in Sources */,
1063 E6A778E7282933E60045BBA8 /* DetailsViewController.swift in Sources */, 1074 E6A778E7282933E60045BBA8 /* DetailsViewController.swift in Sources */,
1064 1EB5F4CA285370C90016F36E /* LoyaltyAnalysisViewController.swift in Sources */, 1075 1EB5F4CA285370C90016F36E /* LoyaltyAnalysisViewController.swift in Sources */,
...@@ -1087,6 +1098,7 @@ ...@@ -1087,6 +1098,7 @@
1087 A04D31DE288FF670000E43B5 /* HistoryViewController.swift in Sources */, 1098 A04D31DE288FF670000E43B5 /* HistoryViewController.swift in Sources */,
1088 E6A7792A282933E70045BBA8 /* AFNetworkActivityIndicatorManager.m in Sources */, 1099 E6A7792A282933E70045BBA8 /* AFNetworkActivityIndicatorManager.m in Sources */,
1089 E6A77914282933E60045BBA8 /* WLUserManager.m in Sources */, 1100 E6A77914282933E60045BBA8 /* WLUserManager.m in Sources */,
1101 + 1EEC5C582CC15C4600CF3CAC /* PopupMerchantsViewController.swift in Sources */,
1090 1EB236AF28816CAC0063777A /* NumbersTableViewCell.swift in Sources */, 1102 1EB236AF28816CAC0063777A /* NumbersTableViewCell.swift in Sources */,
1091 E6A7794F282933E70045BBA8 /* FMDatabasePool.m in Sources */, 1103 E6A7794F282933E70045BBA8 /* FMDatabasePool.m in Sources */,
1092 1EB236AD28816C560063777A /* NumberPopupViewController.swift in Sources */, 1104 1EB236AD28816C560063777A /* NumberPopupViewController.swift in Sources */,
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
7 <key>SwiftWarplyFramework.xcscheme_^#shared#^_</key> 7 <key>SwiftWarplyFramework.xcscheme_^#shared#^_</key>
8 <dict> 8 <dict>
9 <key>orderHint</key> 9 <key>orderHint</key>
10 - <integer>0</integer> 10 + <integer>1</integer>
11 </dict> 11 </dict>
12 </dict> 12 </dict>
13 </dict> 13 </dict>
......
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<Bucket
3 + uuid = "30A67F8F-7993-41EC-813B-55466ABD0520"
4 + type = "0"
5 + version = "2.0">
6 +</Bucket>
...@@ -640,7 +640,18 @@ import AVFoundation ...@@ -640,7 +640,18 @@ import AVFoundation
640 640
641 @IBAction func redeemButtomAction(_ sender: Any) { 641 @IBAction func redeemButtomAction(_ sender: Any) {
642 if (isSMCoupon == true) { 642 if (isSMCoupon == true) {
643 - // TODO: Open popup 643 + let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
644 + if let popupVC = storyboard.instantiateViewController(withIdentifier: "PopupMerchantsViewController") as? SwiftWarplyFramework.PopupMerchantsViewController {
645 + popupVC.modalPresentationStyle = .overCurrentContext
646 + popupVC.modalTransitionStyle = .crossDissolve
647 + popupVC.coupon = coupon
648 +// popupVC.headerText = "Βρες το προϊον στα supermarket"
649 +// popupVC.buttonTitle = "Βρες το"
650 + popupVC.buttonIcon = "shopping_cart"
651 +// popupVC.footerText = "Η διαθεσιμότητα ενδέχεται να διαφέρει ανάλογα με την τοποθεσία."
652 +
653 + self.present(popupVC, animated: true, completion: nil)
654 + }
644 655
645 } else { 656 } else {
646 let couponSetData: swiftApi.CouponSetItemModel? = self.coupon?.couponset_data 657 let couponSetData: swiftApi.CouponSetItemModel? = self.coupon?.couponset_data
......
1 +{
2 + "images" : [
3 + {
4 + "filename" : "shopping_cart.png",
5 + "idiom" : "universal",
6 + "scale" : "1x"
7 + },
8 + {
9 + "filename" : "shopping_cart 1.png",
10 + "idiom" : "universal",
11 + "scale" : "2x"
12 + },
13 + {
14 + "filename" : "shopping_cart 2.png",
15 + "idiom" : "universal",
16 + "scale" : "3x"
17 + }
18 + ],
19 + "info" : {
20 + "author" : "xcode",
21 + "version" : 1
22 + }
23 +}
1 +//
2 +// MerchantTableViewCell.swift
3 +// SwiftWarplyFramework
4 +//
5 +// Created by Manos Chorianopoulos on 18/10/24.
6 +//
7 +
8 +import UIKit
9 +
10 +// Define a protocol (if using delegation)
11 +protocol MerchantTableViewCellDelegate: AnyObject {
12 + func didTapButton(in cell: MerchantTableViewCell)
13 +}
14 +
15 +class MerchantTableViewCell: UITableViewCell {
16 + @IBOutlet weak var mainView: UIView!
17 + @IBOutlet weak var merchantImage: UIImageView!
18 + @IBOutlet weak var buttonView: UIView!
19 + @IBOutlet weak var buttonTitleLable: UILabel!
20 + @IBOutlet weak var buttonIconImage: UIImageView!
21 + @IBOutlet weak var actionButton: UIButton!
22 +
23 + // Delegate variable
24 + weak var delegate: MerchantTableViewCellDelegate?
25 +
26 + var postImageURL: String? {
27 + didSet {
28 + if let url = postImageURL {
29 + self.merchantImage.image = UIImage() // UIImage(named: "loading")
30 +
31 + UIImage.loadImageUsingCacheWithUrlString(url) { image in
32 + // set the image only when we are still displaying the content for the image we finished downloading
33 + if url == self.postImageURL {
34 + self.merchantImage.image = image
35 + }
36 + }
37 + }
38 + else {
39 + self.merchantImage.image = nil
40 + }
41 + }
42 + }
43 +
44 + override func awakeFromNib() {
45 + super.awakeFromNib()
46 + // Initialization code
47 +
48 + mainView.backgroundColor = UIColor(rgb: 0xF2F2F3)
49 + mainView.layer.cornerRadius = 20.0
50 +
51 + buttonTitleLable.font = UIFont(name: "PeridotPE-SBold", size: 13)
52 + buttonTitleLable.textColor = UIColor(rgb: 0xFFFFFF)
53 +
54 + buttonView.backgroundColor = UIColor(rgb: 0x0EA600)
55 + buttonView.layer.cornerRadius = 12.0
56 +
57 + // Add action for button tap
58 + actionButton.addTarget(self, action: #selector(buttonTapped), for: .touchUpInside)
59 + }
60 +
61 + override func setSelected(_ selected: Bool, animated: Bool) {
62 + super.setSelected(selected, animated: animated)
63 +
64 + // Configure the view for the selected state
65 + }
66 +
67 + public override func layoutSubviews() {
68 + super.layoutSubviews()
69 + //set the values for top,left,bottom,right margins
70 + let margins = UIEdgeInsets(top: 0, left: 0, bottom: 32, right: 0)
71 + contentView.frame = contentView.frame.inset(by: margins)
72 + }
73 +
74 + func configureCell(merchant: swiftApi.MerchantModel, buttonTitle: String, iconImage: String?) {
75 +
76 + self.postImageURL = merchant._img_preview
77 +
78 + buttonTitleLable.text = buttonTitle
79 +
80 + if let iconImage {
81 + self.buttonIconImage.image = UIImage(named: iconImage)
82 + self.buttonIconImage.isHidden = false
83 + } else {
84 + self.buttonIconImage.isHidden = true
85 + }
86 + }
87 +
88 + @objc private func buttonTapped() {
89 + // Notify the delegate when button is tapped
90 + delegate?.didTapButton(in: self)
91 + }
92 +}
1 +//
2 +// PopupMerchantsFooterTableViewCell.swift
3 +// SwiftWarplyFramework
4 +//
5 +// Created by Manos Chorianopoulos on 18/10/24.
6 +//
7 +
8 +import UIKit
9 +
10 +class PopupMerchantsFooterTableViewCell: UITableViewCell {
11 + @IBOutlet weak var footerLabel: UILabel!
12 +
13 + override func awakeFromNib() {
14 + super.awakeFromNib()
15 + // Initialization code
16 +
17 + footerLabel.font = UIFont(name: "PeridotPE-Regular", size: 13)
18 + footerLabel.textColor = UIColor(rgb: 0x000000)
19 + }
20 +
21 + override func setSelected(_ selected: Bool, animated: Bool) {
22 + super.setSelected(selected, animated: animated)
23 +
24 + // Configure the view for the selected state
25 + }
26 +
27 + func configureCell(title: String) {
28 + footerLabel.text = title
29 + }
30 +
31 +}
1 +//
2 +// PopupSMMerchantsViewController.swift
3 +// SwiftWarplyFramework
4 +//
5 +// Created by Manos Chorianopoulos on 17/10/24.
6 +//
7 +
8 +import UIKit
9 +
10 +class PopupMerchantsViewController: UIViewController {
11 + @IBOutlet weak var popupView: UIView!
12 + @IBOutlet weak var headerLabel: UILabel!
13 + @IBOutlet weak var closeButton: UIButton!
14 + @IBOutlet weak var tableView: DynamicSizeTableView!
15 +
16 + public var coupon: swiftApi.CouponItemModel?
17 + public var headerText: String? = "Βρες το προϊον στα supermarket"
18 + public var buttonTitle: String? = "Βρες το"
19 + public var buttonIcon: String?
20 + public var footerText: String? = "Η διαθεσιμότητα ενδέχεται να διαφέρει ανάλογα με την τοποθεσία."
21 +
22 + let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList()
23 +
24 + override func viewDidLoad() {
25 + super.viewDidLoad()
26 +
27 + tableView.delegate = self
28 + tableView.dataSource = self
29 +
30 + tableView.contentInset.top = 75
31 +
32 + popupView.clipsToBounds = true
33 + popupView.layer.cornerRadius = 16
34 + popupView.layer.maskedCorners = [ .layerMinXMinYCorner, .layerMaxXMinYCorner] // Top left, right corner radius
35 +
36 + closeButton.setImage(UIImage(named: "ic_close_3.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
37 + closeButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
38 +
39 +// self.tableView.reloadData()
40 + self.tableView.invalidateIntrinsicContentSize()
41 + self.headerLabel.text = self.headerText
42 + headerLabel.font = UIFont(name: "BTCosmo-Bold", size: 18)
43 + headerLabel.textColor = UIColor(rgb: 0x000000)
44 + }
45 +
46 + // MARK: - UIButton Actions
47 + @IBAction func closeButtonAction(_ sender: Any) {
48 + }
49 +
50 +}
51 +
52 +// MARK: - TableView
53 +extension PopupMerchantsViewController: UITableViewDelegate, UITableViewDataSource{
54 +
55 + public func numberOfSections(in tableView: UITableView) -> Int {
56 + return 2
57 + }
58 +
59 + public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
60 + if (section == 0) {
61 + return self.merchantList.count
62 + } else if (section == 1) {
63 + return 1
64 + } else {
65 + return 0
66 + }
67 + }
68 +
69 + public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
70 + if (indexPath.section == 0) {
71 + return 56.0 + 32.0
72 + // return UITableViewAutomaticDimension
73 + } else if (indexPath.section == 1) {
74 + return 100.0
75 + } else {
76 + return 0.0
77 + }
78 +// return UITableViewAutomaticDimension
79 + }
80 +
81 + public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
82 + if (indexPath.section == 0) {
83 + let cell = tableView.dequeueReusableCell(withIdentifier: "MerchantTableViewCellId", for: indexPath) as! MerchantTableViewCell
84 + cell.configureCell(merchant: merchantList[indexPath.row], buttonTitle: self.buttonTitle ?? "Βρες το", iconImage: buttonIcon)
85 +
86 + return cell
87 +
88 + } else {
89 + let cell = tableView.dequeueReusableCell(withIdentifier: "PopupMerchantsFooterTableViewCellId", for: indexPath) as! PopupMerchantsFooterTableViewCell
90 + cell.configureCell(title: self.footerText ?? "Η διαθεσιμότητα ενδέχεται να διαφέρει ανάλογα με την τοποθεσία.")
91 +
92 + return cell
93 + }
94 + }
95 +
96 + public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
97 +// self.dismiss(animated: true, completion: {})
98 +
99 + // TODO: DELETE LOGS
100 + print(" didSelectRowAt Button tapped in row \(indexPath.row)")
101 +
102 + // TODO: Open merchant url
103 +
104 + // Logs
105 +// let couponSetData: swiftApi.CouponSetItemModel? = coupons[indexPath.row].couponset_data
106 +// print("Coupon clicked: " + (coupons[indexPath.row].coupon ?? ""))
107 +// print("Coupon Name clicked: " + (couponSetData?.name ?? ""))
108 +// print("Coupon Description clicked: " + (couponSetData?.short_description ?? ""))
109 +// print("Coupon Expiration clicked: " + (coupons[indexPath.row].expiration ?? ""))
110 +
111 + }
112 +
113 + public func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
114 + return nil
115 + }
116 +
117 + public func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
118 + return 0.0
119 + }
120 +
121 + public func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
122 +// return CGFloat.leastNormalMagnitude
123 + return 0.0
124 + }
125 +
126 + public func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
127 + return nil
128 + }
129 +}
130 +
131 +// MARK: - MerchantTableViewCellDelegate
132 +extension PopupMerchantsViewController: MerchantTableViewCellDelegate {
133 +
134 + func didTapButton(in cell: MerchantTableViewCell) {
135 + // Find the index path of the cell where the button was tapped
136 + if let indexPath = tableView.indexPath(for: cell) {
137 + // TODO: DELETE LOGS
138 + print("Button tapped in row \(indexPath.row)")
139 + print("Button tapped cell: \(cell)")
140 + // Handle the button tap action here
141 + }
142 + }
143 +
144 +}