Manos Chorianopoulos

delete unnecessary files and code, add openSuperMarketsFlow function

Showing 416 changed files with 155 additions and 16047 deletions
...@@ -7,39 +7,11 @@ ...@@ -7,39 +7,11 @@
7 objects = { 7 objects = {
8 8
9 /* Begin PBXBuildFile section */ 9 /* Begin PBXBuildFile section */
10 - 1E029A4129E002CF00CC7447 /* UnifiedCouponBCHeaderTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E029A4029E002CF00CC7447 /* UnifiedCouponBCHeaderTableViewCell.swift */; };
11 - 1E029A4329E0031600CC7447 /* UnifiedCouponBCFooterTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E029A4229E0031600CC7447 /* UnifiedCouponBCFooterTableViewCell.swift */; };
12 1E108A9228A3F9280008B8E7 /* pf_square_sans_pro_regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1E108A8D28A3F9270008B8E7 /* pf_square_sans_pro_regular.ttf */; }; 10 1E108A9228A3F9280008B8E7 /* pf_square_sans_pro_regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1E108A8D28A3F9270008B8E7 /* pf_square_sans_pro_regular.ttf */; };
13 1E108A9328A3F9280008B8E7 /* pf_square_sans_pro_medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1E108A8E28A3F9280008B8E7 /* pf_square_sans_pro_medium.ttf */; }; 11 1E108A9328A3F9280008B8E7 /* pf_square_sans_pro_medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1E108A8E28A3F9280008B8E7 /* pf_square_sans_pro_medium.ttf */; };
14 1E108A9428A3F9280008B8E7 /* pf_square_sans_pro_extra_black.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1E108A8F28A3F9280008B8E7 /* pf_square_sans_pro_extra_black.ttf */; }; 12 1E108A9428A3F9280008B8E7 /* pf_square_sans_pro_extra_black.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1E108A8F28A3F9280008B8E7 /* pf_square_sans_pro_extra_black.ttf */; };
15 1E108A9528A3F9280008B8E7 /* pf_square_sans_pro_bold_italic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1E108A9028A3F9280008B8E7 /* pf_square_sans_pro_bold_italic.ttf */; }; 13 1E108A9528A3F9280008B8E7 /* pf_square_sans_pro_bold_italic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1E108A9028A3F9280008B8E7 /* pf_square_sans_pro_bold_italic.ttf */; };
16 1E108A9628A3F9280008B8E7 /* pf_square_sans_pro_bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1E108A9128A3F9280008B8E7 /* pf_square_sans_pro_bold.ttf */; }; 14 1E108A9628A3F9280008B8E7 /* pf_square_sans_pro_bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1E108A9128A3F9280008B8E7 /* pf_square_sans_pro_bold.ttf */; };
17 - 1E151F1829DAE48500951FA0 /* UnifiedCouponsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E151F1729DAE48500951FA0 /* UnifiedCouponsTableViewCell.swift */; };
18 - 1E151F1A29DAE4D500951FA0 /* ActiveCodeTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E151F1929DAE4D500951FA0 /* ActiveCodeTableViewCell.swift */; };
19 - 1E15B9A229DDCF02000A408D /* MarketSharingHistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E15B9A129DDCF02000A408D /* MarketSharingHistoryViewController.swift */; };
20 - 1E15B9A429DDD211000A408D /* MarketHistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E15B9A329DDD211000A408D /* MarketHistoryViewController.swift */; };
21 - 1E2966EA2837A21D00F83FAC /* RSBarcodes_Swift in Frameworks */ = {isa = PBXBuildFile; productRef = 1E2966E92837A21D00F83FAC /* RSBarcodes_Swift */; };
22 - 1E36E43D2CBFDD5100A60198 /* PopupInfoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E36E43C2CBFDD5100A60198 /* PopupInfoViewController.swift */; };
23 - 1E4195FB2AE691D20094DADE /* WalletActiveCouponsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E4195FA2AE691D20094DADE /* WalletActiveCouponsTableViewCell.swift */; };
24 - 1E4410B128F5855000859F92 /* CampaignCategory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E4410B028F5855000859F92 /* CampaignCategory.swift */; };
25 - 1E46B4BF2BEBB68800D5B488 /* WalletActiveCouponsScrollTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E46B4BE2BEBB68800D5B488 /* WalletActiveCouponsScrollTableViewCell.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 */; };
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 */; };
31 - 1E64E8FD2B8DE457001BA46E /* WalletQuestionnaireBannerTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E64E8FC2B8DE457001BA46E /* WalletQuestionnaireBannerTableViewCell.swift */; };
32 - 1E64E8FF2B8DE487001BA46E /* WalletHistoryBannerTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E64E8FE2B8DE487001BA46E /* WalletHistoryBannerTableViewCell.swift */; };
33 - 1E64E9012B8DE4AC001BA46E /* WalletEmptyViewTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E64E9002B8DE4AC001BA46E /* WalletEmptyViewTableViewCell.swift */; };
34 - 1E6515D52D36A4C300AD80C6 /* MarketAnalysisItemViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E6515D42D36A4C300AD80C6 /* MarketAnalysisItemViewCell.swift */; };
35 - 1E74838D28378AF40042A589 /* CouponBarcodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E74838C28378AF40042A589 /* CouponBarcodeViewController.swift */; };
36 - 1E7B9A5829F6ACF400B37E13 /* WalletBannersTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E7B9A5729F6ACF400B37E13 /* WalletBannersTableViewCell.swift */; };
37 - 1E87A9EF28C2021200C79F90 /* ContextualViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E87A9EE28C2021200C79F90 /* ContextualViewController.swift */; };
38 - 1EA04EC12AE7FCE800389A84 /* WalletSpinnerTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EA04EC02AE7FCE700389A84 /* WalletSpinnerTableViewCell.swift */; };
39 - 1EA1AF0A2835346A008998AA /* CouponsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EA1AF092835346A008998AA /* CouponsTableViewCell.swift */; };
40 - 1EA2BB792865BFE8003F2AB0 /* InboxTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EA2BB782865BFE8003F2AB0 /* InboxTableViewCell.swift */; };
41 - 1EA771AC290977CA0030924C /* CopyableLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EA771AB290977CA0030924C /* CopyableLabel.swift */; };
42 - 1EAEFC7A29DDCAF500114A1C /* MarketLoyaltyAnalysisViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EAEFC7929DDCAF500114A1C /* MarketLoyaltyAnalysisViewController.swift */; };
43 1EB15E6C29E45F5100654657 /* PeridotPE-SemiBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1EB15E6329E45F5100654657 /* PeridotPE-SemiBold.ttf */; }; 15 1EB15E6C29E45F5100654657 /* PeridotPE-SemiBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1EB15E6329E45F5100654657 /* PeridotPE-SemiBold.ttf */; };
44 1EB15E6D29E45F5100654657 /* PeridotPE-ExtraBoldItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1EB15E6429E45F5100654657 /* PeridotPE-ExtraBoldItalic.ttf */; }; 16 1EB15E6D29E45F5100654657 /* PeridotPE-ExtraBoldItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1EB15E6429E45F5100654657 /* PeridotPE-ExtraBoldItalic.ttf */; };
45 1EB15E6E29E45F5100654657 /* PeridotPE-SemiBoldItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1EB15E6529E45F5100654657 /* PeridotPE-SemiBoldItalic.ttf */; }; 17 1EB15E6E29E45F5100654657 /* PeridotPE-SemiBoldItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1EB15E6529E45F5100654657 /* PeridotPE-SemiBoldItalic.ttf */; };
...@@ -49,47 +21,16 @@ ...@@ -49,47 +21,16 @@
49 1EB15E7229E45F5100654657 /* PeridotPE-BoldItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1EB15E6929E45F5100654657 /* PeridotPE-BoldItalic.ttf */; }; 21 1EB15E7229E45F5100654657 /* PeridotPE-BoldItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1EB15E6929E45F5100654657 /* PeridotPE-BoldItalic.ttf */; };
50 1EB15E7329E45F5100654657 /* PeridotPE-ExtraBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1EB15E6A29E45F5100654657 /* PeridotPE-ExtraBold.ttf */; }; 22 1EB15E7329E45F5100654657 /* PeridotPE-ExtraBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1EB15E6A29E45F5100654657 /* PeridotPE-ExtraBold.ttf */; };
51 1EB15E7429E45F5100654657 /* PeridotPE-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1EB15E6B29E45F5100654657 /* PeridotPE-Regular.ttf */; }; 23 1EB15E7429E45F5100654657 /* PeridotPE-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1EB15E6B29E45F5100654657 /* PeridotPE-Regular.ttf */; };
52 - 1EB236AB28816B680063777A /* ShareViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EB236AA28816B680063777A /* ShareViewController.swift */; };
53 - 1EB236AD28816C560063777A /* NumberPopupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EB236AC28816C560063777A /* NumberPopupViewController.swift */; };
54 - 1EB236AF28816CAC0063777A /* NumbersTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EB236AE28816CAB0063777A /* NumbersTableViewCell.swift */; };
55 - 1EB5F4C828536FD60016F36E /* StepsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EB5F4C728536FD60016F36E /* StepsViewController.swift */; };
56 - 1EB5F4CA285370C90016F36E /* LoyaltyAnalysisViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EB5F4C9285370C90016F36E /* LoyaltyAnalysisViewController.swift */; };
57 - 1EBC75432922829D004FBE75 /* SpinnerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EBC75422922829D004FBE75 /* SpinnerViewController.swift */; };
58 - 1EBE97212865EE460080EFF7 /* MFYInboxTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EBE97202865EE460080EFF7 /* MFYInboxTableViewCell.swift */; };
59 1EBF5F072840E13F00B8B17F /* SwiftEventBus in Frameworks */ = {isa = PBXBuildFile; productRef = 1EBF5F062840E13F00B8B17F /* SwiftEventBus */; }; 24 1EBF5F072840E13F00B8B17F /* SwiftEventBus in Frameworks */ = {isa = PBXBuildFile; productRef = 1EBF5F062840E13F00B8B17F /* SwiftEventBus */; };
60 - 1ECA079128D9E3BA00D2BDE0 /* CSMButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ECA079028D9E3BA00D2BDE0 /* CSMButton.swift */; };
61 - 1ECA079428D9E53F00D2BDE0 /* MapsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ECA079228D9E53F00D2BDE0 /* MapsViewController.swift */; };
62 - 1ECA079528D9E53F00D2BDE0 /* MapsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1ECA079328D9E53F00D2BDE0 /* MapsViewController.xib */; };
63 - 1ECA079728D9E66200D2BDE0 /* MerchantAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ECA079628D9E66200D2BDE0 /* MerchantAnnotation.swift */; };
64 - 1EDAF23F2D36B59200894144 /* MarketPassViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EDAF23E2D36B59200894144 /* MarketPassViewController.swift */; };
65 - 1EDAF2412D36B5B100894144 /* MarketPassInfoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EDAF2402D36B5B000894144 /* MarketPassInfoViewController.swift */; };
66 - 1EDCB47A29DEEC2E00DF218B /* UnifiedCouponBarcodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EDCB47929DEEC2E00DF218B /* UnifiedCouponBarcodeViewController.swift */; };
67 - 1EDCDFAC28DB29E8002ED8F0 /* AnalysisMoreViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EDCDFAB28DB29E8002ED8F0 /* AnalysisMoreViewCell.swift */; };
68 - 1EDD4F892AE937AA00A6B5A6 /* LoyaltyHistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EDD4F882AE937AA00A6B5A6 /* LoyaltyHistoryViewController.swift */; };
69 - 1EE67DA32AE2AF2B0057C8CC /* UnifiedCouponsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EE67DA22AE2AF2B0057C8CC /* UnifiedCouponsViewController.swift */; };
70 - 1EEC5C582CC15C4600CF3CAC /* PopupMerchantsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EEC5C572CC15C4600CF3CAC /* PopupMerchantsViewController.swift */; };
71 - 1EFBAB942CC65C9B001DFF75 /* PopupMerchantCategoriesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EFBAB932CC65C9B001DFF75 /* PopupMerchantCategoriesViewController.swift */; };
72 7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0D5F56DD4E5371A50AD2D87 /* Pods_SwiftWarplyFramework.framework */; }; 25 7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0D5F56DD4E5371A50AD2D87 /* Pods_SwiftWarplyFramework.framework */; };
73 - A02F34052882B6E60086465F /* TelcoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A02F34042882B6E60086465F /* TelcoViewController.swift */; };
74 - A04D31DE288FF670000E43B5 /* HistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A04D31DD288FF670000E43B5 /* HistoryViewController.swift */; };
75 - A079366E2885D07700064122 /* AnalysisChildViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A079366D2885D07700064122 /* AnalysisChildViewController.swift */; };
76 - A07936702885D95600064122 /* AnalysisItemViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A079366F2885D95600064122 /* AnalysisItemViewCell.swift */; };
77 - A07936732885E67400064122 /* AnalysisItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = A07936722885E67400064122 /* AnalysisItem.swift */; };
78 A07936762885E9CC00064122 /* UIColorExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A07936752885E9CC00064122 /* UIColorExtensions.swift */; }; 26 A07936762885E9CC00064122 /* UIColorExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A07936752885E9CC00064122 /* UIColorExtensions.swift */; };
79 - A079367C2885F2F500064122 /* AnalysisHeaderViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A079367B2885F2F500064122 /* AnalysisHeaderViewCell.swift */; };
80 - A079367E2885F60A00064122 /* AnalysisHeaderMessageViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A079367D2885F60A00064122 /* AnalysisHeaderMessageViewCell.swift */; };
81 - A09DBCAE2888BA8100DD50B0 /* SharingHistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A09DBCAD2888BA8100DD50B0 /* SharingHistoryViewController.swift */; };
82 E6A77853282933340045BBA8 /* SwiftWarplyFramework.docc in Sources */ = {isa = PBXBuildFile; fileRef = E6A77852282933340045BBA8 /* SwiftWarplyFramework.docc */; }; 27 E6A77853282933340045BBA8 /* SwiftWarplyFramework.docc in Sources */ = {isa = PBXBuildFile; fileRef = E6A77852282933340045BBA8 /* SwiftWarplyFramework.docc */; };
83 E6A77854282933340045BBA8 /* SwiftWarplyFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = E6A77851282933340045BBA8 /* SwiftWarplyFramework.h */; settings = {ATTRIBUTES = (Public, ); }; }; 28 E6A77854282933340045BBA8 /* SwiftWarplyFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = E6A77851282933340045BBA8 /* SwiftWarplyFramework.h */; settings = {ATTRIBUTES = (Public, ); }; };
84 E6A778DF282933E60045BBA8 /* WarplyReactMethods.m in Sources */ = {isa = PBXBuildFile; fileRef = E6A7785B282933E40045BBA8 /* WarplyReactMethods.m */; }; 29 E6A778DF282933E60045BBA8 /* WarplyReactMethods.m in Sources */ = {isa = PBXBuildFile; fileRef = E6A7785B282933E40045BBA8 /* WarplyReactMethods.m */; };
85 E6A778E0282933E60045BBA8 /* WarplyReactMethods.h in Headers */ = {isa = PBXBuildFile; fileRef = E6A7785C282933E40045BBA8 /* WarplyReactMethods.h */; }; 30 E6A778E0282933E60045BBA8 /* WarplyReactMethods.h in Headers */ = {isa = PBXBuildFile; fileRef = E6A7785C282933E40045BBA8 /* WarplyReactMethods.h */; };
86 - E6A778E1282933E60045BBA8 /* CouponViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6A7785D282933E40045BBA8 /* CouponViewController.swift */; };
87 - E6A778E2282933E60045BBA8 /* CouponsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6A7785E282933E40045BBA8 /* CouponsViewController.swift */; };
88 - E6A778E3282933E60045BBA8 /* WalletViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6A7785F282933E40045BBA8 /* WalletViewController.swift */; };
89 E6A778E4282933E60045BBA8 /* MyApi.h in Headers */ = {isa = PBXBuildFile; fileRef = E6A77860282933E40045BBA8 /* MyApi.h */; settings = {ATTRIBUTES = (Public, ); }; }; 31 E6A778E4282933E60045BBA8 /* MyApi.h in Headers */ = {isa = PBXBuildFile; fileRef = E6A77860282933E40045BBA8 /* MyApi.h */; settings = {ATTRIBUTES = (Public, ); }; };
90 E6A778E5282933E60045BBA8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E6A77861282933E50045BBA8 /* Main.storyboard */; }; 32 E6A778E5282933E60045BBA8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E6A77861282933E50045BBA8 /* Main.storyboard */; };
91 E6A778E6282933E60045BBA8 /* MyEmptyClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6A77862282933E50045BBA8 /* MyEmptyClass.swift */; }; 33 E6A778E6282933E60045BBA8 /* MyEmptyClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6A77862282933E50045BBA8 /* MyEmptyClass.swift */; };
92 - E6A778E7282933E60045BBA8 /* DetailsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6A77863282933E50045BBA8 /* DetailsViewController.swift */; };
93 E6A778E9282933E60045BBA8 /* WLNativeAdCollectionViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = E6A77867282933E50045BBA8 /* WLNativeAdCollectionViewCell.h */; }; 34 E6A778E9282933E60045BBA8 /* WLNativeAdCollectionViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = E6A77867282933E50045BBA8 /* WLNativeAdCollectionViewCell.h */; };
94 E6A778EA282933E60045BBA8 /* WLNativeVideoTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E6A77868282933E50045BBA8 /* WLNativeVideoTableViewCell.xib */; }; 35 E6A778EA282933E60045BBA8 /* WLNativeVideoTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E6A77868282933E50045BBA8 /* WLNativeVideoTableViewCell.xib */; };
95 E6A778EB282933E60045BBA8 /* WLNativeAdTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = E6A77869282933E50045BBA8 /* WLNativeAdTableViewCell.h */; }; 36 E6A778EB282933E60045BBA8 /* WLNativeAdTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = E6A77869282933E50045BBA8 /* WLNativeAdTableViewCell.h */; };
...@@ -196,51 +137,20 @@ ...@@ -196,51 +137,20 @@
196 E6A77950282933E70045BBA8 /* FMResultSet.m in Sources */ = {isa = PBXBuildFile; fileRef = E6A778D8282933E60045BBA8 /* FMResultSet.m */; }; 137 E6A77950282933E70045BBA8 /* FMResultSet.m in Sources */ = {isa = PBXBuildFile; fileRef = E6A778D8282933E60045BBA8 /* FMResultSet.m */; };
197 E6A77951282933E70045BBA8 /* WLEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = E6A778D9282933E60045BBA8 /* WLEvent.h */; }; 138 E6A77951282933E70045BBA8 /* WLEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = E6A778D9282933E60045BBA8 /* WLEvent.h */; };
198 E6A77952282933E70045BBA8 /* Warply.h in Headers */ = {isa = PBXBuildFile; fileRef = E6A778DA282933E60045BBA8 /* Warply.h */; }; 139 E6A77952282933E70045BBA8 /* Warply.h in Headers */ = {isa = PBXBuildFile; fileRef = E6A778DA282933E60045BBA8 /* Warply.h */; };
199 - E6A77953282933E70045BBA8 /* MFYViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6A778DB282933E60045BBA8 /* MFYViewController.swift */; };
200 E6A77954282933E70045BBA8 /* MyApi.m in Sources */ = {isa = PBXBuildFile; fileRef = E6A778DC282933E60045BBA8 /* MyApi.m */; }; 140 E6A77954282933E70045BBA8 /* MyApi.m in Sources */ = {isa = PBXBuildFile; fileRef = E6A778DC282933E60045BBA8 /* MyApi.m */; };
201 E6A77955282933E70045BBA8 /* ViewControllerExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6A778DD282933E60045BBA8 /* ViewControllerExtensions.swift */; }; 141 E6A77955282933E70045BBA8 /* ViewControllerExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6A778DD282933E60045BBA8 /* ViewControllerExtensions.swift */; };
202 - E6A77956282933E70045BBA8 /* GiftsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6A778DE282933E60045BBA8 /* GiftsViewController.swift */; };
203 E6A7795A28293D390045BBA8 /* swiftApi.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6A77864282933E50045BBA8 /* swiftApi.swift */; }; 142 E6A7795A28293D390045BBA8 /* swiftApi.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6A77864282933E50045BBA8 /* swiftApi.swift */; };
204 E6A77A32282BA9C60045BBA8 /* CampaignViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6A77A31282BA9C60045BBA8 /* CampaignViewController.swift */; }; 143 E6A77A32282BA9C60045BBA8 /* CampaignViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6A77A31282BA9C60045BBA8 /* CampaignViewController.swift */; };
205 - E6A77A34282BB3BB0045BBA8 /* ActiveGiftsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6A77A33282BB3BB0045BBA8 /* ActiveGiftsViewController.swift */; };
206 - E6A77A36282BB4CB0045BBA8 /* MakeItAPresentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6A77A35282BB4CB0045BBA8 /* MakeItAPresentViewController.swift */; };
207 E6A77A38282BC3530045BBA8 /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E6A77A37282BC3530045BBA8 /* Media.xcassets */; }; 144 E6A77A38282BC3530045BBA8 /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E6A77A37282BC3530045BBA8 /* Media.xcassets */; };
208 /* End PBXBuildFile section */ 145 /* End PBXBuildFile section */
209 146
210 /* Begin PBXFileReference section */ 147 /* Begin PBXFileReference section */
211 - 1E029A4029E002CF00CC7447 /* UnifiedCouponBCHeaderTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnifiedCouponBCHeaderTableViewCell.swift; sourceTree = "<group>"; };
212 - 1E029A4229E0031600CC7447 /* UnifiedCouponBCFooterTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnifiedCouponBCFooterTableViewCell.swift; sourceTree = "<group>"; };
213 1E108A8D28A3F9270008B8E7 /* pf_square_sans_pro_regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = pf_square_sans_pro_regular.ttf; sourceTree = "<group>"; }; 148 1E108A8D28A3F9270008B8E7 /* pf_square_sans_pro_regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = pf_square_sans_pro_regular.ttf; sourceTree = "<group>"; };
214 1E108A8E28A3F9280008B8E7 /* pf_square_sans_pro_medium.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = pf_square_sans_pro_medium.ttf; sourceTree = "<group>"; }; 149 1E108A8E28A3F9280008B8E7 /* pf_square_sans_pro_medium.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = pf_square_sans_pro_medium.ttf; sourceTree = "<group>"; };
215 1E108A8F28A3F9280008B8E7 /* pf_square_sans_pro_extra_black.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = pf_square_sans_pro_extra_black.ttf; sourceTree = "<group>"; }; 150 1E108A8F28A3F9280008B8E7 /* pf_square_sans_pro_extra_black.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = pf_square_sans_pro_extra_black.ttf; sourceTree = "<group>"; };
216 1E108A9028A3F9280008B8E7 /* pf_square_sans_pro_bold_italic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = pf_square_sans_pro_bold_italic.ttf; sourceTree = "<group>"; }; 151 1E108A9028A3F9280008B8E7 /* pf_square_sans_pro_bold_italic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = pf_square_sans_pro_bold_italic.ttf; sourceTree = "<group>"; };
217 1E108A9128A3F9280008B8E7 /* pf_square_sans_pro_bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = pf_square_sans_pro_bold.ttf; sourceTree = "<group>"; }; 152 1E108A9128A3F9280008B8E7 /* pf_square_sans_pro_bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = pf_square_sans_pro_bold.ttf; sourceTree = "<group>"; };
218 1E108A9728A3FA9B0008B8E7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; }; 153 1E108A9728A3FA9B0008B8E7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
219 - 1E151F1729DAE48500951FA0 /* UnifiedCouponsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnifiedCouponsTableViewCell.swift; sourceTree = "<group>"; };
220 - 1E151F1929DAE4D500951FA0 /* ActiveCodeTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActiveCodeTableViewCell.swift; sourceTree = "<group>"; };
221 - 1E15B9A129DDCF02000A408D /* MarketSharingHistoryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarketSharingHistoryViewController.swift; sourceTree = "<group>"; };
222 - 1E15B9A329DDD211000A408D /* MarketHistoryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarketHistoryViewController.swift; sourceTree = "<group>"; };
223 - 1E36E43C2CBFDD5100A60198 /* PopupInfoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PopupInfoViewController.swift; sourceTree = "<group>"; };
224 - 1E4195FA2AE691D20094DADE /* WalletActiveCouponsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletActiveCouponsTableViewCell.swift; sourceTree = "<group>"; };
225 - 1E4410B028F5855000859F92 /* CampaignCategory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CampaignCategory.swift; sourceTree = "<group>"; };
226 - 1E46B4BE2BEBB68800D5B488 /* WalletActiveCouponsScrollTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletActiveCouponsScrollTableViewCell.swift; sourceTree = "<group>"; };
227 - 1E46B4C02BEBBDD800D5B488 /* WalletActiveCouponCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletActiveCouponCollectionViewCell.swift; sourceTree = "<group>"; };
228 - 1E479FB229DD948B00C38193 /* WalletBadgesTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletBadgesTableViewCell.swift; sourceTree = "<group>"; };
229 - 1E51678D2AE6934100FE66C3 /* WalletVouchersBannerTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletVouchersBannerTableViewCell.swift; sourceTree = "<group>"; };
230 - 1E56DF722CC249B300F71882 /* MerchantTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MerchantTableViewCell.swift; sourceTree = "<group>"; };
231 - 1E56DF742CC2620000F71882 /* PopupMerchantsFooterTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PopupMerchantsFooterTableViewCell.swift; sourceTree = "<group>"; };
232 - 1E64E8FC2B8DE457001BA46E /* WalletQuestionnaireBannerTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletQuestionnaireBannerTableViewCell.swift; sourceTree = "<group>"; };
233 - 1E64E8FE2B8DE487001BA46E /* WalletHistoryBannerTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletHistoryBannerTableViewCell.swift; sourceTree = "<group>"; };
234 - 1E64E9002B8DE4AC001BA46E /* WalletEmptyViewTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletEmptyViewTableViewCell.swift; sourceTree = "<group>"; };
235 - 1E6515D42D36A4C300AD80C6 /* MarketAnalysisItemViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarketAnalysisItemViewCell.swift; sourceTree = "<group>"; };
236 - 1E74838C28378AF40042A589 /* CouponBarcodeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CouponBarcodeViewController.swift; sourceTree = "<group>"; };
237 - 1E7B9A5729F6ACF400B37E13 /* WalletBannersTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletBannersTableViewCell.swift; sourceTree = "<group>"; };
238 - 1E87A9EE28C2021200C79F90 /* ContextualViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContextualViewController.swift; sourceTree = "<group>"; };
239 - 1EA04EC02AE7FCE700389A84 /* WalletSpinnerTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletSpinnerTableViewCell.swift; sourceTree = "<group>"; };
240 - 1EA1AF092835346A008998AA /* CouponsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CouponsTableViewCell.swift; sourceTree = "<group>"; };
241 - 1EA2BB782865BFE8003F2AB0 /* InboxTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InboxTableViewCell.swift; sourceTree = "<group>"; };
242 - 1EA771AB290977CA0030924C /* CopyableLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CopyableLabel.swift; sourceTree = "<group>"; };
243 - 1EAEFC7929DDCAF500114A1C /* MarketLoyaltyAnalysisViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarketLoyaltyAnalysisViewController.swift; sourceTree = "<group>"; };
244 1EB15E6329E45F5100654657 /* PeridotPE-SemiBold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "PeridotPE-SemiBold.ttf"; sourceTree = "<group>"; }; 154 1EB15E6329E45F5100654657 /* PeridotPE-SemiBold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "PeridotPE-SemiBold.ttf"; sourceTree = "<group>"; };
245 1EB15E6429E45F5100654657 /* PeridotPE-ExtraBoldItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "PeridotPE-ExtraBoldItalic.ttf"; sourceTree = "<group>"; }; 155 1EB15E6429E45F5100654657 /* PeridotPE-ExtraBoldItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "PeridotPE-ExtraBoldItalic.ttf"; sourceTree = "<group>"; };
246 1EB15E6529E45F5100654657 /* PeridotPE-SemiBoldItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "PeridotPE-SemiBoldItalic.ttf"; sourceTree = "<group>"; }; 156 1EB15E6529E45F5100654657 /* PeridotPE-SemiBoldItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "PeridotPE-SemiBoldItalic.ttf"; sourceTree = "<group>"; };
...@@ -250,34 +160,7 @@ ...@@ -250,34 +160,7 @@
250 1EB15E6929E45F5100654657 /* PeridotPE-BoldItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "PeridotPE-BoldItalic.ttf"; sourceTree = "<group>"; }; 160 1EB15E6929E45F5100654657 /* PeridotPE-BoldItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "PeridotPE-BoldItalic.ttf"; sourceTree = "<group>"; };
251 1EB15E6A29E45F5100654657 /* PeridotPE-ExtraBold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "PeridotPE-ExtraBold.ttf"; sourceTree = "<group>"; }; 161 1EB15E6A29E45F5100654657 /* PeridotPE-ExtraBold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "PeridotPE-ExtraBold.ttf"; sourceTree = "<group>"; };
252 1EB15E6B29E45F5100654657 /* PeridotPE-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "PeridotPE-Regular.ttf"; sourceTree = "<group>"; }; 162 1EB15E6B29E45F5100654657 /* PeridotPE-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "PeridotPE-Regular.ttf"; sourceTree = "<group>"; };
253 - 1EB236AA28816B680063777A /* ShareViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareViewController.swift; sourceTree = "<group>"; };
254 - 1EB236AC28816C560063777A /* NumberPopupViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NumberPopupViewController.swift; sourceTree = "<group>"; };
255 - 1EB236AE28816CAB0063777A /* NumbersTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NumbersTableViewCell.swift; sourceTree = "<group>"; };
256 - 1EB5F4C728536FD60016F36E /* StepsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StepsViewController.swift; sourceTree = "<group>"; };
257 - 1EB5F4C9285370C90016F36E /* LoyaltyAnalysisViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoyaltyAnalysisViewController.swift; sourceTree = "<group>"; };
258 - 1EBC75422922829D004FBE75 /* SpinnerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpinnerViewController.swift; sourceTree = "<group>"; };
259 - 1EBE97202865EE460080EFF7 /* MFYInboxTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MFYInboxTableViewCell.swift; sourceTree = "<group>"; };
260 - 1ECA079028D9E3BA00D2BDE0 /* CSMButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CSMButton.swift; sourceTree = "<group>"; };
261 - 1ECA079228D9E53F00D2BDE0 /* MapsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapsViewController.swift; sourceTree = "<group>"; };
262 - 1ECA079328D9E53F00D2BDE0 /* MapsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MapsViewController.xib; sourceTree = "<group>"; };
263 - 1ECA079628D9E66200D2BDE0 /* MerchantAnnotation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MerchantAnnotation.swift; sourceTree = "<group>"; };
264 - 1EDAF23E2D36B59200894144 /* MarketPassViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarketPassViewController.swift; sourceTree = "<group>"; };
265 - 1EDAF2402D36B5B000894144 /* MarketPassInfoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarketPassInfoViewController.swift; sourceTree = "<group>"; };
266 - 1EDCB47929DEEC2E00DF218B /* UnifiedCouponBarcodeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnifiedCouponBarcodeViewController.swift; sourceTree = "<group>"; };
267 - 1EDCDFAB28DB29E8002ED8F0 /* AnalysisMoreViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisMoreViewCell.swift; sourceTree = "<group>"; };
268 - 1EDD4F882AE937AA00A6B5A6 /* LoyaltyHistoryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoyaltyHistoryViewController.swift; sourceTree = "<group>"; };
269 - 1EE67DA22AE2AF2B0057C8CC /* UnifiedCouponsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnifiedCouponsViewController.swift; sourceTree = "<group>"; };
270 - 1EEC5C572CC15C4600CF3CAC /* PopupMerchantsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PopupMerchantsViewController.swift; sourceTree = "<group>"; };
271 - 1EFBAB932CC65C9B001DFF75 /* PopupMerchantCategoriesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PopupMerchantCategoriesViewController.swift; sourceTree = "<group>"; };
272 - A02F34042882B6E60086465F /* TelcoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TelcoViewController.swift; sourceTree = "<group>"; };
273 - A04D31DD288FF670000E43B5 /* HistoryViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HistoryViewController.swift; sourceTree = "<group>"; };
274 - A079366D2885D07700064122 /* AnalysisChildViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisChildViewController.swift; sourceTree = "<group>"; };
275 - A079366F2885D95600064122 /* AnalysisItemViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisItemViewCell.swift; sourceTree = "<group>"; };
276 - A07936722885E67400064122 /* AnalysisItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisItem.swift; sourceTree = "<group>"; };
277 A07936752885E9CC00064122 /* UIColorExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIColorExtensions.swift; sourceTree = "<group>"; }; 163 A07936752885E9CC00064122 /* UIColorExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIColorExtensions.swift; sourceTree = "<group>"; };
278 - A079367B2885F2F500064122 /* AnalysisHeaderViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisHeaderViewCell.swift; sourceTree = "<group>"; };
279 - A079367D2885F60A00064122 /* AnalysisHeaderMessageViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisHeaderMessageViewCell.swift; sourceTree = "<group>"; };
280 - A09DBCAD2888BA8100DD50B0 /* SharingHistoryViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SharingHistoryViewController.swift; sourceTree = "<group>"; };
281 A9B7BE01A4E812DE49866EF8 /* Pods-SwiftWarplyFramework.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftWarplyFramework.debug.xcconfig"; path = "Target Support Files/Pods-SwiftWarplyFramework/Pods-SwiftWarplyFramework.debug.xcconfig"; sourceTree = "<group>"; }; 164 A9B7BE01A4E812DE49866EF8 /* Pods-SwiftWarplyFramework.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftWarplyFramework.debug.xcconfig"; path = "Target Support Files/Pods-SwiftWarplyFramework/Pods-SwiftWarplyFramework.debug.xcconfig"; sourceTree = "<group>"; };
282 B9EB8A451EF0C5AD75094EEE /* Pods-SwiftWarplyFramework.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftWarplyFramework.release.xcconfig"; path = "Target Support Files/Pods-SwiftWarplyFramework/Pods-SwiftWarplyFramework.release.xcconfig"; sourceTree = "<group>"; }; 165 B9EB8A451EF0C5AD75094EEE /* Pods-SwiftWarplyFramework.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftWarplyFramework.release.xcconfig"; path = "Target Support Files/Pods-SwiftWarplyFramework/Pods-SwiftWarplyFramework.release.xcconfig"; sourceTree = "<group>"; };
283 C0D5F56DD4E5371A50AD2D87 /* Pods_SwiftWarplyFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwiftWarplyFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 166 C0D5F56DD4E5371A50AD2D87 /* Pods_SwiftWarplyFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwiftWarplyFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; };
...@@ -286,13 +169,9 @@ ...@@ -286,13 +169,9 @@
286 E6A77852282933340045BBA8 /* SwiftWarplyFramework.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = SwiftWarplyFramework.docc; sourceTree = "<group>"; }; 169 E6A77852282933340045BBA8 /* SwiftWarplyFramework.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = SwiftWarplyFramework.docc; sourceTree = "<group>"; };
287 E6A7785B282933E40045BBA8 /* WarplyReactMethods.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WarplyReactMethods.m; sourceTree = "<group>"; }; 170 E6A7785B282933E40045BBA8 /* WarplyReactMethods.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WarplyReactMethods.m; sourceTree = "<group>"; };
288 E6A7785C282933E40045BBA8 /* WarplyReactMethods.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WarplyReactMethods.h; sourceTree = "<group>"; }; 171 E6A7785C282933E40045BBA8 /* WarplyReactMethods.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WarplyReactMethods.h; sourceTree = "<group>"; };
289 - E6A7785D282933E40045BBA8 /* CouponViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CouponViewController.swift; sourceTree = "<group>"; };
290 - E6A7785E282933E40045BBA8 /* CouponsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CouponsViewController.swift; sourceTree = "<group>"; };
291 - E6A7785F282933E40045BBA8 /* WalletViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletViewController.swift; sourceTree = "<group>"; };
292 E6A77860282933E40045BBA8 /* MyApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyApi.h; sourceTree = "<group>"; }; 172 E6A77860282933E40045BBA8 /* MyApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyApi.h; sourceTree = "<group>"; };
293 E6A77861282933E50045BBA8 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; }; 173 E6A77861282933E50045BBA8 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
294 E6A77862282933E50045BBA8 /* MyEmptyClass.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MyEmptyClass.swift; sourceTree = "<group>"; }; 174 E6A77862282933E50045BBA8 /* MyEmptyClass.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MyEmptyClass.swift; sourceTree = "<group>"; };
295 - E6A77863282933E50045BBA8 /* DetailsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetailsViewController.swift; sourceTree = "<group>"; };
296 E6A77864282933E50045BBA8 /* swiftApi.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = swiftApi.swift; sourceTree = "<group>"; }; 175 E6A77864282933E50045BBA8 /* swiftApi.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = swiftApi.swift; sourceTree = "<group>"; };
297 E6A77867282933E50045BBA8 /* WLNativeAdCollectionViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WLNativeAdCollectionViewCell.h; sourceTree = "<group>"; }; 176 E6A77867282933E50045BBA8 /* WLNativeAdCollectionViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WLNativeAdCollectionViewCell.h; sourceTree = "<group>"; };
298 E6A77868282933E50045BBA8 /* WLNativeVideoTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = WLNativeVideoTableViewCell.xib; sourceTree = "<group>"; }; 177 E6A77868282933E50045BBA8 /* WLNativeVideoTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = WLNativeVideoTableViewCell.xib; sourceTree = "<group>"; };
...@@ -400,13 +279,9 @@ ...@@ -400,13 +279,9 @@
400 E6A778D8282933E60045BBA8 /* FMResultSet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FMResultSet.m; sourceTree = "<group>"; }; 279 E6A778D8282933E60045BBA8 /* FMResultSet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FMResultSet.m; sourceTree = "<group>"; };
401 E6A778D9282933E60045BBA8 /* WLEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WLEvent.h; sourceTree = "<group>"; }; 280 E6A778D9282933E60045BBA8 /* WLEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WLEvent.h; sourceTree = "<group>"; };
402 E6A778DA282933E60045BBA8 /* Warply.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Warply.h; sourceTree = "<group>"; }; 281 E6A778DA282933E60045BBA8 /* Warply.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Warply.h; sourceTree = "<group>"; };
403 - E6A778DB282933E60045BBA8 /* MFYViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MFYViewController.swift; sourceTree = "<group>"; };
404 E6A778DC282933E60045BBA8 /* MyApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyApi.m; sourceTree = "<group>"; }; 282 E6A778DC282933E60045BBA8 /* MyApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyApi.m; sourceTree = "<group>"; };
405 E6A778DD282933E60045BBA8 /* ViewControllerExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewControllerExtensions.swift; sourceTree = "<group>"; }; 283 E6A778DD282933E60045BBA8 /* ViewControllerExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewControllerExtensions.swift; sourceTree = "<group>"; };
406 - E6A778DE282933E60045BBA8 /* GiftsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GiftsViewController.swift; sourceTree = "<group>"; };
407 E6A77A31282BA9C60045BBA8 /* CampaignViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CampaignViewController.swift; sourceTree = "<group>"; }; 284 E6A77A31282BA9C60045BBA8 /* CampaignViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CampaignViewController.swift; sourceTree = "<group>"; };
408 - E6A77A33282BB3BB0045BBA8 /* ActiveGiftsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActiveGiftsViewController.swift; sourceTree = "<group>"; };
409 - E6A77A35282BB4CB0045BBA8 /* MakeItAPresentViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MakeItAPresentViewController.swift; sourceTree = "<group>"; };
410 E6A77A37282BC3530045BBA8 /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Media.xcassets; sourceTree = "<group>"; }; 285 E6A77A37282BC3530045BBA8 /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Media.xcassets; sourceTree = "<group>"; };
411 /* End PBXFileReference section */ 286 /* End PBXFileReference section */
412 287
...@@ -415,7 +290,6 @@ ...@@ -415,7 +290,6 @@
415 isa = PBXFrameworksBuildPhase; 290 isa = PBXFrameworksBuildPhase;
416 buildActionMask = 2147483647; 291 buildActionMask = 2147483647;
417 files = ( 292 files = (
418 - 1E2966EA2837A21D00F83FAC /* RSBarcodes_Swift in Frameworks */,
419 7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */, 293 7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */,
420 1EBF5F072840E13F00B8B17F /* SwiftEventBus in Frameworks */, 294 1EBF5F072840E13F00B8B17F /* SwiftEventBus in Frameworks */,
421 ); 295 );
...@@ -461,26 +335,6 @@ ...@@ -461,26 +335,6 @@
461 name = Frameworks; 335 name = Frameworks;
462 sourceTree = "<group>"; 336 sourceTree = "<group>";
463 }; 337 };
464 - A079366A2885CDDC00064122 /* analysis */ = {
465 - isa = PBXGroup;
466 - children = (
467 - A079367A2885F2D100064122 /* cells */,
468 - 1EB5F4C9285370C90016F36E /* LoyaltyAnalysisViewController.swift */,
469 - A079366D2885D07700064122 /* AnalysisChildViewController.swift */,
470 - A04D31DD288FF670000E43B5 /* HistoryViewController.swift */,
471 - A09DBCAD2888BA8100DD50B0 /* SharingHistoryViewController.swift */,
472 - );
473 - name = analysis;
474 - sourceTree = "<group>";
475 - };
476 - A07936712885E65C00064122 /* models */ = {
477 - isa = PBXGroup;
478 - children = (
479 - A07936722885E67400064122 /* AnalysisItem.swift */,
480 - );
481 - name = models;
482 - sourceTree = "<group>";
483 - };
484 A07936742885E96A00064122 /* utilities */ = { 338 A07936742885E96A00064122 /* utilities */ = {
485 isa = PBXGroup; 339 isa = PBXGroup;
486 children = ( 340 children = (
...@@ -489,16 +343,6 @@ ...@@ -489,16 +343,6 @@
489 name = utilities; 343 name = utilities;
490 sourceTree = "<group>"; 344 sourceTree = "<group>";
491 }; 345 };
492 - A079367A2885F2D100064122 /* cells */ = {
493 - isa = PBXGroup;
494 - children = (
495 - A079366F2885D95600064122 /* AnalysisItemViewCell.swift */,
496 - A079367B2885F2F500064122 /* AnalysisHeaderViewCell.swift */,
497 - A079367D2885F60A00064122 /* AnalysisHeaderMessageViewCell.swift */,
498 - );
499 - name = cells;
500 - sourceTree = "<group>";
501 - };
502 C049E0423E2B72D796B777A3 /* Pods */ = { 346 C049E0423E2B72D796B777A3 /* Pods */ = {
503 isa = PBXGroup; 347 isa = PBXGroup;
504 children = ( 348 children = (
...@@ -529,65 +373,12 @@ ...@@ -529,65 +373,12 @@
529 E6A77850282933340045BBA8 /* SwiftWarplyFramework */ = { 373 E6A77850282933340045BBA8 /* SwiftWarplyFramework */ = {
530 isa = PBXGroup; 374 isa = PBXGroup;
531 children = ( 375 children = (
532 - 1EDCB47929DEEC2E00DF218B /* UnifiedCouponBarcodeViewController.swift */,
533 - 1E029A4029E002CF00CC7447 /* UnifiedCouponBCHeaderTableViewCell.swift */,
534 - 1E029A4229E0031600CC7447 /* UnifiedCouponBCFooterTableViewCell.swift */,
535 - 1E15B9A329DDD211000A408D /* MarketHistoryViewController.swift */,
536 - 1E6515D42D36A4C300AD80C6 /* MarketAnalysisItemViewCell.swift */,
537 - 1EBC75422922829D004FBE75 /* SpinnerViewController.swift */,
538 - 1ECA079028D9E3BA00D2BDE0 /* CSMButton.swift */,
539 1E108A9728A3FA9B0008B8E7 /* Info.plist */, 376 1E108A9728A3FA9B0008B8E7 /* Info.plist */,
540 1E108A8B28A3F8FF0008B8E7 /* Resources */, 377 1E108A8B28A3F8FF0008B8E7 /* Resources */,
541 - A02F34042882B6E60086465F /* TelcoViewController.swift */,
542 - A07936712885E65C00064122 /* models */,
543 - A079366A2885CDDC00064122 /* analysis */,
544 A07936742885E96A00064122 /* utilities */, 378 A07936742885E96A00064122 /* utilities */,
545 - E6A7785E282933E40045BBA8 /* CouponsViewController.swift */,
546 - 1EE67DA22AE2AF2B0057C8CC /* UnifiedCouponsViewController.swift */,
547 - 1EA1AF092835346A008998AA /* CouponsTableViewCell.swift */,
548 - E6A7785D282933E40045BBA8 /* CouponViewController.swift */,
549 - 1E151F1729DAE48500951FA0 /* UnifiedCouponsTableViewCell.swift */,
550 - 1E151F1929DAE4D500951FA0 /* ActiveCodeTableViewCell.swift */,
551 - 1E74838C28378AF40042A589 /* CouponBarcodeViewController.swift */,
552 - E6A77863282933E50045BBA8 /* DetailsViewController.swift */,
553 - E6A778DE282933E60045BBA8 /* GiftsViewController.swift */,
554 - 1EA2BB782865BFE8003F2AB0 /* InboxTableViewCell.swift */,
555 - 1EBE97202865EE460080EFF7 /* MFYInboxTableViewCell.swift */,
556 - E6A778DB282933E60045BBA8 /* MFYViewController.swift */,
557 - E6A7785F282933E40045BBA8 /* WalletViewController.swift */,
558 - 1EDAF23E2D36B59200894144 /* MarketPassViewController.swift */,
559 - 1EDAF2402D36B5B000894144 /* MarketPassInfoViewController.swift */,
560 E6A77A31282BA9C60045BBA8 /* CampaignViewController.swift */, 379 E6A77A31282BA9C60045BBA8 /* CampaignViewController.swift */,
561 - E6A77A33282BB3BB0045BBA8 /* ActiveGiftsViewController.swift */,
562 - E6A77A35282BB4CB0045BBA8 /* MakeItAPresentViewController.swift */,
563 E6A7785A282933E40045BBA8 /* Helpers */, 380 E6A7785A282933E40045BBA8 /* Helpers */,
564 E6A77861282933E50045BBA8 /* Main.storyboard */, 381 E6A77861282933E50045BBA8 /* Main.storyboard */,
565 - 1E7B9A5729F6ACF400B37E13 /* WalletBannersTableViewCell.swift */,
566 - 1E4195FA2AE691D20094DADE /* WalletActiveCouponsTableViewCell.swift */,
567 - 1E46B4BE2BEBB68800D5B488 /* WalletActiveCouponsScrollTableViewCell.swift */,
568 - 1E46B4C02BEBBDD800D5B488 /* WalletActiveCouponCollectionViewCell.swift */,
569 - 1E51678D2AE6934100FE66C3 /* WalletVouchersBannerTableViewCell.swift */,
570 - 1EA04EC02AE7FCE700389A84 /* WalletSpinnerTableViewCell.swift */,
571 - 1E64E8FC2B8DE457001BA46E /* WalletQuestionnaireBannerTableViewCell.swift */,
572 - 1E64E8FE2B8DE487001BA46E /* WalletHistoryBannerTableViewCell.swift */,
573 - 1E64E9002B8DE4AC001BA46E /* WalletEmptyViewTableViewCell.swift */,
574 - 1EDD4F882AE937AA00A6B5A6 /* LoyaltyHistoryViewController.swift */,
575 - 1E15B9A129DDCF02000A408D /* MarketSharingHistoryViewController.swift */,
576 - 1EAEFC7929DDCAF500114A1C /* MarketLoyaltyAnalysisViewController.swift */,
577 - 1E479FB229DD948B00C38193 /* WalletBadgesTableViewCell.swift */,
578 - 1EA771AB290977CA0030924C /* CopyableLabel.swift */,
579 - 1E4410B028F5855000859F92 /* CampaignCategory.swift */,
580 - 1EDCDFAB28DB29E8002ED8F0 /* AnalysisMoreViewCell.swift */,
581 - 1E87A9EE28C2021200C79F90 /* ContextualViewController.swift */,
582 - 1EB236AA28816B680063777A /* ShareViewController.swift */,
583 - 1EB236AC28816C560063777A /* NumberPopupViewController.swift */,
584 - 1EB236AE28816CAB0063777A /* NumbersTableViewCell.swift */,
585 - 1EB5F4C728536FD60016F36E /* StepsViewController.swift */,
586 - 1E36E43C2CBFDD5100A60198 /* PopupInfoViewController.swift */,
587 - 1EEC5C572CC15C4600CF3CAC /* PopupMerchantsViewController.swift */,
588 - 1E56DF722CC249B300F71882 /* MerchantTableViewCell.swift */,
589 - 1E56DF742CC2620000F71882 /* PopupMerchantsFooterTableViewCell.swift */,
590 - 1EFBAB932CC65C9B001DFF75 /* PopupMerchantCategoriesViewController.swift */,
591 E6A77860282933E40045BBA8 /* MyApi.h */, 382 E6A77860282933E40045BBA8 /* MyApi.h */,
592 E6A778DC282933E60045BBA8 /* MyApi.m */, 383 E6A778DC282933E60045BBA8 /* MyApi.m */,
593 E6A77862282933E50045BBA8 /* MyEmptyClass.swift */, 384 E6A77862282933E50045BBA8 /* MyEmptyClass.swift */,
...@@ -597,9 +388,6 @@ ...@@ -597,9 +388,6 @@
597 E6A77851282933340045BBA8 /* SwiftWarplyFramework.h */, 388 E6A77851282933340045BBA8 /* SwiftWarplyFramework.h */,
598 E6A77852282933340045BBA8 /* SwiftWarplyFramework.docc */, 389 E6A77852282933340045BBA8 /* SwiftWarplyFramework.docc */,
599 E6A77A37282BC3530045BBA8 /* Media.xcassets */, 390 E6A77A37282BC3530045BBA8 /* Media.xcassets */,
600 - 1ECA079228D9E53F00D2BDE0 /* MapsViewController.swift */,
601 - 1ECA079628D9E66200D2BDE0 /* MerchantAnnotation.swift */,
602 - 1ECA079328D9E53F00D2BDE0 /* MapsViewController.xib */,
603 ); 391 );
604 path = SwiftWarplyFramework; 392 path = SwiftWarplyFramework;
605 sourceTree = "<group>"; 393 sourceTree = "<group>";
...@@ -897,7 +685,6 @@ ...@@ -897,7 +685,6 @@
897 ); 685 );
898 name = SwiftWarplyFramework; 686 name = SwiftWarplyFramework;
899 packageProductDependencies = ( 687 packageProductDependencies = (
900 - 1E2966E92837A21D00F83FAC /* RSBarcodes_Swift */,
901 1EBF5F062840E13F00B8B17F /* SwiftEventBus */, 688 1EBF5F062840E13F00B8B17F /* SwiftEventBus */,
902 ); 689 );
903 productName = SwiftWarplyFramework; 690 productName = SwiftWarplyFramework;
...@@ -929,7 +716,6 @@ ...@@ -929,7 +716,6 @@
929 ); 716 );
930 mainGroup = E6A77844282933340045BBA8; 717 mainGroup = E6A77844282933340045BBA8;
931 packageReferences = ( 718 packageReferences = (
932 - 1E2966E82837A21D00F83FAC /* XCRemoteSwiftPackageReference "RSBarcodes_Swift" */,
933 1EBF5F052840E13F00B8B17F /* XCRemoteSwiftPackageReference "SwiftEventBus" */, 719 1EBF5F052840E13F00B8B17F /* XCRemoteSwiftPackageReference "SwiftEventBus" */,
934 ); 720 );
935 productRefGroup = E6A7784F282933340045BBA8 /* Products */; 721 productRefGroup = E6A7784F282933340045BBA8 /* Products */;
...@@ -950,7 +736,6 @@ ...@@ -950,7 +736,6 @@
950 1E108A9628A3F9280008B8E7 /* pf_square_sans_pro_bold.ttf in Resources */, 736 1E108A9628A3F9280008B8E7 /* pf_square_sans_pro_bold.ttf in Resources */,
951 1EB15E6D29E45F5100654657 /* PeridotPE-ExtraBoldItalic.ttf in Resources */, 737 1EB15E6D29E45F5100654657 /* PeridotPE-ExtraBoldItalic.ttf in Resources */,
952 1E108A9228A3F9280008B8E7 /* pf_square_sans_pro_regular.ttf in Resources */, 738 1E108A9228A3F9280008B8E7 /* pf_square_sans_pro_regular.ttf in Resources */,
953 - 1ECA079528D9E53F00D2BDE0 /* MapsViewController.xib in Resources */,
954 E6A778EA282933E60045BBA8 /* WLNativeVideoTableViewCell.xib in Resources */, 739 E6A778EA282933E60045BBA8 /* WLNativeVideoTableViewCell.xib in Resources */,
955 1E108A9528A3F9280008B8E7 /* pf_square_sans_pro_bold_italic.ttf in Resources */, 740 1E108A9528A3F9280008B8E7 /* pf_square_sans_pro_bold_italic.ttf in Resources */,
956 E6A7790A282933E60045BBA8 /* warp_white_close_button.png in Resources */, 741 E6A7790A282933E60045BBA8 /* warp_white_close_button.png in Resources */,
...@@ -1009,119 +794,58 @@ ...@@ -1009,119 +794,58 @@
1009 files = ( 794 files = (
1010 E6A7791E282933E60045BBA8 /* WLSMSActionHanlder.m in Sources */, 795 E6A7791E282933E60045BBA8 /* WLSMSActionHanlder.m in Sources */,
1011 E6A778F5282933E60045BBA8 /* WLCustomNativeAdTableViewCell.m in Sources */, 796 E6A778F5282933E60045BBA8 /* WLCustomNativeAdTableViewCell.m in Sources */,
1012 - 1EB5F4C828536FD60016F36E /* StepsViewController.swift in Sources */,
1013 - A02F34052882B6E60086465F /* TelcoViewController.swift in Sources */,
1014 E6A77901282933E60045BBA8 /* WLBaseItem.m in Sources */, 797 E6A77901282933E60045BBA8 /* WLBaseItem.m in Sources */,
1015 - 1EE67DA32AE2AF2B0057C8CC /* UnifiedCouponsViewController.swift in Sources */,
1016 - 1E74838D28378AF40042A589 /* CouponBarcodeViewController.swift in Sources */,
1017 - 1E56DF732CC249B300F71882 /* MerchantTableViewCell.swift in Sources */,
1018 - 1E479FB329DD948B00C38193 /* WalletBadgesTableViewCell.swift in Sources */,
1019 - 1E151F1829DAE48500951FA0 /* UnifiedCouponsTableViewCell.swift in Sources */,
1020 E6A778F0282933E60045BBA8 /* WLNativeAdsCollectionMode.m in Sources */, 798 E6A778F0282933E60045BBA8 /* WLNativeAdsCollectionMode.m in Sources */,
1021 - 1E6515D52D36A4C300AD80C6 /* MarketAnalysisItemViewCell.swift in Sources */,
1022 E6A7791C282933E60045BBA8 /* WLSMSActionHandlerDeprecated.m in Sources */, 799 E6A7791C282933E60045BBA8 /* WLSMSActionHandlerDeprecated.m in Sources */,
1023 E6A77934282933E70045BBA8 /* UIActivityIndicatorView+AFNetworking.m in Sources */, 800 E6A77934282933E70045BBA8 /* UIActivityIndicatorView+AFNetworking.m in Sources */,
1024 - E6A77A34282BB3BB0045BBA8 /* ActiveGiftsViewController.swift in Sources */,
1025 - 1E64E8FF2B8DE487001BA46E /* WalletHistoryBannerTableViewCell.swift in Sources */,
1026 E6A778E6282933E60045BBA8 /* MyEmptyClass.swift in Sources */, 801 E6A778E6282933E60045BBA8 /* MyEmptyClass.swift in Sources */,
1027 - 1E46B4C12BEBBDD800D5B488 /* WalletActiveCouponCollectionViewCell.swift in Sources */,
1028 E6A77912282933E60045BBA8 /* WLAnalyticsManager.m in Sources */, 802 E6A77912282933E60045BBA8 /* WLAnalyticsManager.m in Sources */,
1029 - 1EDAF2412D36B5B100894144 /* MarketPassInfoViewController.swift in Sources */,
1030 - E6A778E2282933E60045BBA8 /* CouponsViewController.swift in Sources */,
1031 E6A77930282933E70045BBA8 /* UIImageView+AFNetworking.m in Sources */, 803 E6A77930282933E70045BBA8 /* UIImageView+AFNetworking.m in Sources */,
1032 E6A77900282933E60045BBA8 /* WLInboxItemViewController.m in Sources */, 804 E6A77900282933E60045BBA8 /* WLInboxItemViewController.m in Sources */,
1033 - 1E87A9EF28C2021200C79F90 /* ContextualViewController.swift in Sources */,
1034 - 1EA04EC12AE7FCE800389A84 /* WalletSpinnerTableViewCell.swift in Sources */,
1035 E6A7793E282933E70045BBA8 /* AFHTTPSessionManager.m in Sources */, 805 E6A7793E282933E70045BBA8 /* AFHTTPSessionManager.m in Sources */,
1036 E6A77933282933E70045BBA8 /* UIButton+AFNetworking.m in Sources */, 806 E6A77933282933E70045BBA8 /* UIButton+AFNetworking.m in Sources */,
1037 E6A77919282933E60045BBA8 /* Warply.m in Sources */, 807 E6A77919282933E60045BBA8 /* Warply.m in Sources */,
1038 - 1E15B9A429DDD211000A408D /* MarketHistoryViewController.swift in Sources */,
1039 - E6A77953282933E70045BBA8 /* MFYViewController.swift in Sources */,
1040 E6A7794B282933E70045BBA8 /* FMDatabase.m in Sources */, 808 E6A7794B282933E70045BBA8 /* FMDatabase.m in Sources */,
1041 - 1EDD4F892AE937AA00A6B5A6 /* LoyaltyHistoryViewController.swift in Sources */,
1042 E6A778EC282933E60045BBA8 /* WLNativeVideoTableViewCell.m in Sources */, 809 E6A778EC282933E60045BBA8 /* WLNativeVideoTableViewCell.m in Sources */,
1043 E6A77954282933E70045BBA8 /* MyApi.m in Sources */, 810 E6A77954282933E70045BBA8 /* MyApi.m in Sources */,
1044 - A09DBCAE2888BA8100DD50B0 /* SharingHistoryViewController.swift in Sources */,
1045 E6A778F2282933E60045BBA8 /* WLNativeAdCollectionViewCell.m in Sources */, 811 E6A778F2282933E60045BBA8 /* WLNativeAdCollectionViewCell.m in Sources */,
1046 E6A77904282933E60045BBA8 /* WLEvent.m in Sources */, 812 E6A77904282933E60045BBA8 /* WLEvent.m in Sources */,
1047 E6A77927282933E70045BBA8 /* UIRefreshControl+AFNetworking.m in Sources */, 813 E6A77927282933E70045BBA8 /* UIRefreshControl+AFNetworking.m in Sources */,
1048 E6A77955282933E70045BBA8 /* ViewControllerExtensions.swift in Sources */, 814 E6A77955282933E70045BBA8 /* ViewControllerExtensions.swift in Sources */,
1049 A07936762885E9CC00064122 /* UIColorExtensions.swift in Sources */, 815 A07936762885E9CC00064122 /* UIColorExtensions.swift in Sources */,
1050 - A079367C2885F2F500064122 /* AnalysisHeaderViewCell.swift in Sources */,
1051 E6A7795A28293D390045BBA8 /* swiftApi.swift in Sources */, 816 E6A7795A28293D390045BBA8 /* swiftApi.swift in Sources */,
1052 - 1E51678E2AE6934100FE66C3 /* WalletVouchersBannerTableViewCell.swift in Sources */,
1053 E6A77935282933E70045BBA8 /* UIWebView+AFNetworking.m in Sources */, 817 E6A77935282933E70045BBA8 /* UIWebView+AFNetworking.m in Sources */,
1054 E6A77925282933E70045BBA8 /* UIProgressView+AFNetworking.m in Sources */, 818 E6A77925282933E70045BBA8 /* UIProgressView+AFNetworking.m in Sources */,
1055 E6A77944282933E70045BBA8 /* AFSecurityPolicy.m in Sources */, 819 E6A77944282933E70045BBA8 /* AFSecurityPolicy.m in Sources */,
1056 - 1EA1AF0A2835346A008998AA /* CouponsTableViewCell.swift in Sources */,
1057 - 1EAEFC7A29DDCAF500114A1C /* MarketLoyaltyAnalysisViewController.swift in Sources */,
1058 E6A77A32282BA9C60045BBA8 /* CampaignViewController.swift in Sources */, 820 E6A77A32282BA9C60045BBA8 /* CampaignViewController.swift in Sources */,
1059 E6A77917282933E60045BBA8 /* UIViewController+WLAdditions.m in Sources */, 821 E6A77917282933E60045BBA8 /* UIViewController+WLAdditions.m in Sources */,
1060 - 1EA2BB792865BFE8003F2AB0 /* InboxTableViewCell.swift in Sources */,
1061 E6A77943282933E70045BBA8 /* AFNetworkReachabilityManager.m in Sources */, 822 E6A77943282933E70045BBA8 /* AFNetworkReachabilityManager.m in Sources */,
1062 - 1E4195FB2AE691D20094DADE /* WalletActiveCouponsTableViewCell.swift in Sources */,
1063 - 1ECA079428D9E53F00D2BDE0 /* MapsViewController.swift in Sources */,
1064 - A07936702885D95600064122 /* AnalysisItemViewCell.swift in Sources */,
1065 - E6A77956282933E70045BBA8 /* GiftsViewController.swift in Sources */,
1066 - 1ECA079728D9E66200D2BDE0 /* MerchantAnnotation.swift in Sources */,
1067 - 1EBC75432922829D004FBE75 /* SpinnerViewController.swift in Sources */,
1068 E6A778F1282933E60045BBA8 /* WLNativeAdTableViewCell.m in Sources */, 823 E6A778F1282933E60045BBA8 /* WLNativeAdTableViewCell.m in Sources */,
1069 E6A77853282933340045BBA8 /* SwiftWarplyFramework.docc in Sources */, 824 E6A77853282933340045BBA8 /* SwiftWarplyFramework.docc in Sources */,
1070 E6A77938282933E70045BBA8 /* AFImageDownloader.m in Sources */, 825 E6A77938282933E70045BBA8 /* AFImageDownloader.m in Sources */,
1071 E6A778ED282933E60045BBA8 /* WLCustomNativeCollectionViewCell.m in Sources */, 826 E6A778ED282933E60045BBA8 /* WLCustomNativeCollectionViewCell.m in Sources */,
1072 E6A7790D282933E60045BBA8 /* WLLocationManager.m in Sources */, 827 E6A7790D282933E60045BBA8 /* WLLocationManager.m in Sources */,
1073 E6A7793D282933E70045BBA8 /* AFURLResponseSerialization.m in Sources */, 828 E6A7793D282933E70045BBA8 /* AFURLResponseSerialization.m in Sources */,
1074 - 1EBE97212865EE460080EFF7 /* MFYInboxTableViewCell.swift in Sources */,
1075 E6A778FD282933E60045BBA8 /* WLInboxItem.m in Sources */, 829 E6A778FD282933E60045BBA8 /* WLInboxItem.m in Sources */,
1076 E6A778EE282933E60045BBA8 /* WLNativeAdsTableMode.m in Sources */, 830 E6A778EE282933E60045BBA8 /* WLNativeAdsTableMode.m in Sources */,
1077 - A07936732885E67400064122 /* AnalysisItem.swift in Sources */,
1078 - 1EDCB47A29DEEC2E00DF218B /* UnifiedCouponBarcodeViewController.swift in Sources */,
1079 E6A778DF282933E60045BBA8 /* WarplyReactMethods.m in Sources */, 831 E6A778DF282933E60045BBA8 /* WarplyReactMethods.m in Sources */,
1080 E6A77941282933E70045BBA8 /* AFURLRequestSerialization.m in Sources */, 832 E6A77941282933E70045BBA8 /* AFURLRequestSerialization.m in Sources */,
1081 E6A77915282933E60045BBA8 /* WLUtils.m in Sources */, 833 E6A77915282933E60045BBA8 /* WLUtils.m in Sources */,
1082 - E6A77A36282BB4CB0045BBA8 /* MakeItAPresentViewController.swift in Sources */,
1083 E6A77947282933E70045BBA8 /* FMDatabaseQueue.m in Sources */, 834 E6A77947282933E70045BBA8 /* FMDatabaseQueue.m in Sources */,
1084 E6A77922282933E60045BBA8 /* NSData+SSToolkitAdditions.m in Sources */, 835 E6A77922282933E60045BBA8 /* NSData+SSToolkitAdditions.m in Sources */,
1085 - 1EA771AC290977CA0030924C /* CopyableLabel.swift in Sources */,
1086 - 1E56DF752CC2620000F71882 /* PopupMerchantsFooterTableViewCell.swift in Sources */,
1087 - 1EB236AB28816B680063777A /* ShareViewController.swift in Sources */,
1088 - E6A778E7282933E60045BBA8 /* DetailsViewController.swift in Sources */,
1089 - 1EB5F4CA285370C90016F36E /* LoyaltyAnalysisViewController.swift in Sources */,
1090 E6A7794A282933E70045BBA8 /* FMDatabaseAdditions.m in Sources */, 836 E6A7794A282933E70045BBA8 /* FMDatabaseAdditions.m in Sources */,
1091 E6A77903282933E60045BBA8 /* WLAPSItem.m in Sources */, 837 E6A77903282933E60045BBA8 /* WLAPSItem.m in Sources */,
1092 - 1E64E9012B8DE4AC001BA46E /* WalletEmptyViewTableViewCell.swift in Sources */,
1093 - 1E029A4129E002CF00CC7447 /* UnifiedCouponBCHeaderTableViewCell.swift in Sources */,
1094 - 1EDAF23F2D36B59200894144 /* MarketPassViewController.swift in Sources */,
1095 - 1ECA079128D9E3BA00D2BDE0 /* CSMButton.swift in Sources */,
1096 - 1E4410B128F5855000859F92 /* CampaignCategory.swift in Sources */,
1097 - 1E46B4BF2BEBB68800D5B488 /* WalletActiveCouponsScrollTableViewCell.swift in Sources */,
1098 E6A7790B282933E60045BBA8 /* WLPushManager.m in Sources */, 838 E6A7790B282933E60045BBA8 /* WLPushManager.m in Sources */,
1099 - 1E15B9A229DDCF02000A408D /* MarketSharingHistoryViewController.swift in Sources */,
1100 - A079366E2885D07700064122 /* AnalysisChildViewController.swift in Sources */,
1101 E6A77950282933E70045BBA8 /* FMResultSet.m in Sources */, 839 E6A77950282933E70045BBA8 /* FMResultSet.m in Sources */,
1102 - 1E36E43D2CBFDD5100A60198 /* PopupInfoViewController.swift in Sources */,
1103 - 1E151F1A29DAE4D500951FA0 /* ActiveCodeTableViewCell.swift in Sources */,
1104 E6A77936282933E70045BBA8 /* AFAutoPurgingImageCache.m in Sources */, 840 E6A77936282933E70045BBA8 /* AFAutoPurgingImageCache.m in Sources */,
1105 - A079367E2885F60A00064122 /* AnalysisHeaderMessageViewCell.swift in Sources */,
1106 - 1E64E8FD2B8DE457001BA46E /* WalletQuestionnaireBannerTableViewCell.swift in Sources */,
1107 - 1E7B9A5829F6ACF400B37E13 /* WalletBannersTableViewCell.swift in Sources */,
1108 E6A778FF282933E60045BBA8 /* WLBeacon.m in Sources */, 841 E6A778FF282933E60045BBA8 /* WLBeacon.m in Sources */,
1109 - 1E029A4329E0031600CC7447 /* UnifiedCouponBCFooterTableViewCell.swift in Sources */,
1110 - 1EFBAB942CC65C9B001DFF75 /* PopupMerchantCategoriesViewController.swift in Sources */,
1111 E6A7791A282933E60045BBA8 /* WLAPPActionHandler.m in Sources */, 842 E6A7791A282933E60045BBA8 /* WLAPPActionHandler.m in Sources */,
1112 - E6A778E1282933E60045BBA8 /* CouponViewController.swift in Sources */,
1113 E6A77924282933E70045BBA8 /* NSString+SSToolkitAdditions.m in Sources */, 843 E6A77924282933E70045BBA8 /* NSString+SSToolkitAdditions.m in Sources */,
1114 - A04D31DE288FF670000E43B5 /* HistoryViewController.swift in Sources */,
1115 E6A7792A282933E70045BBA8 /* AFNetworkActivityIndicatorManager.m in Sources */, 844 E6A7792A282933E70045BBA8 /* AFNetworkActivityIndicatorManager.m in Sources */,
1116 E6A77914282933E60045BBA8 /* WLUserManager.m in Sources */, 845 E6A77914282933E60045BBA8 /* WLUserManager.m in Sources */,
1117 - 1EEC5C582CC15C4600CF3CAC /* PopupMerchantsViewController.swift in Sources */,
1118 - 1EB236AF28816CAC0063777A /* NumbersTableViewCell.swift in Sources */,
1119 E6A7794F282933E70045BBA8 /* FMDatabasePool.m in Sources */, 846 E6A7794F282933E70045BBA8 /* FMDatabasePool.m in Sources */,
1120 - 1EB236AD28816C560063777A /* NumberPopupViewController.swift in Sources */,
1121 - E6A778E3282933E60045BBA8 /* WalletViewController.swift in Sources */,
1122 E6A7790C282933E60045BBA8 /* WLBeaconManager.m in Sources */, 847 E6A7790C282933E60045BBA8 /* WLBeaconManager.m in Sources */,
1123 E6A77940282933E70045BBA8 /* AFURLSessionManager.m in Sources */, 848 E6A77940282933E70045BBA8 /* AFURLSessionManager.m in Sources */,
1124 - 1EDCDFAC28DB29E8002ED8F0 /* AnalysisMoreViewCell.swift in Sources */,
1125 ); 849 );
1126 runOnlyForDeploymentPostprocessing = 0; 850 runOnlyForDeploymentPostprocessing = 0;
1127 }; 851 };
...@@ -1347,14 +1071,6 @@ ...@@ -1347,14 +1071,6 @@
1347 /* End XCConfigurationList section */ 1071 /* End XCConfigurationList section */
1348 1072
1349 /* Begin XCRemoteSwiftPackageReference section */ 1073 /* Begin XCRemoteSwiftPackageReference section */
1350 - 1E2966E82837A21D00F83FAC /* XCRemoteSwiftPackageReference "RSBarcodes_Swift" */ = {
1351 - isa = XCRemoteSwiftPackageReference;
1352 - repositoryURL = "https://github.com/yeahdongcn/RSBarcodes_Swift";
1353 - requirement = {
1354 - kind = upToNextMajorVersion;
1355 - minimumVersion = 5.0.0;
1356 - };
1357 - };
1358 1EBF5F052840E13F00B8B17F /* XCRemoteSwiftPackageReference "SwiftEventBus" */ = { 1074 1EBF5F052840E13F00B8B17F /* XCRemoteSwiftPackageReference "SwiftEventBus" */ = {
1359 isa = XCRemoteSwiftPackageReference; 1075 isa = XCRemoteSwiftPackageReference;
1360 repositoryURL = "https://github.com/cesarferreira/SwiftEventBus"; 1076 repositoryURL = "https://github.com/cesarferreira/SwiftEventBus";
...@@ -1366,11 +1082,6 @@ ...@@ -1366,11 +1082,6 @@
1366 /* End XCRemoteSwiftPackageReference section */ 1082 /* End XCRemoteSwiftPackageReference section */
1367 1083
1368 /* Begin XCSwiftPackageProductDependency section */ 1084 /* Begin XCSwiftPackageProductDependency section */
1369 - 1E2966E92837A21D00F83FAC /* RSBarcodes_Swift */ = {
1370 - isa = XCSwiftPackageProductDependency;
1371 - package = 1E2966E82837A21D00F83FAC /* XCRemoteSwiftPackageReference "RSBarcodes_Swift" */;
1372 - productName = RSBarcodes_Swift;
1373 - };
1374 1EBF5F062840E13F00B8B17F /* SwiftEventBus */ = { 1085 1EBF5F062840E13F00B8B17F /* SwiftEventBus */ = {
1375 isa = XCSwiftPackageProductDependency; 1086 isa = XCSwiftPackageProductDependency;
1376 package = 1EBF5F052840E13F00B8B17F /* XCRemoteSwiftPackageReference "SwiftEventBus" */; 1087 package = 1EBF5F052840E13F00B8B17F /* XCRemoteSwiftPackageReference "SwiftEventBus" */;
......
1 { 1 {
2 + "originHash" : "a973e37718e3a158b792c38b1b8ebf4fb41961343f7a99be3fa56123caed92c7",
2 "pins" : [ 3 "pins" : [
3 { 4 {
4 - "identity" : "rsbarcodes_swift",
5 - "kind" : "remoteSourceControl",
6 - "location" : "https://github.com/yeahdongcn/RSBarcodes_Swift",
7 - "state" : {
8 - "revision" : "86d8b1a1439e7edb19793d17732b15fd784a0a15",
9 - "version" : "5.1.1"
10 - }
11 - },
12 - {
13 "identity" : "swifteventbus", 5 "identity" : "swifteventbus",
14 "kind" : "remoteSourceControl", 6 "kind" : "remoteSourceControl",
15 "location" : "https://github.com/cesarferreira/SwiftEventBus", 7 "location" : "https://github.com/cesarferreira/SwiftEventBus",
...@@ -19,5 +11,5 @@ ...@@ -19,5 +11,5 @@
19 } 11 }
20 } 12 }
21 ], 13 ],
22 - "version" : 2 14 + "version" : 3
23 } 15 }
......
1 -//
2 -// ActiveCodeTableViewCell.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 3/4/23.
6 -//
7 -
8 -import UIKit
9 -
10 -@objc public class ActiveCodeTableViewCell: UITableViewCell {
11 - @IBOutlet weak var activeCodeView: UIView!
12 - @IBOutlet weak var activeCodeViewHeight: NSLayoutConstraint!
13 - @IBOutlet weak var activeCodesCountLabel: UILabel!
14 - @IBOutlet weak var activeCodeLabel: UILabel!
15 - @IBOutlet weak var activeCodeExpirationLabel: UILabel!
16 - @IBOutlet weak var activeCodeImage: UIImageView!
17 - @IBOutlet weak var activeCodeScrollView: UIScrollView!
18 - @IBOutlet weak var activeCodeScrollViewHeight: NSLayoutConstraint!
19 - @IBOutlet weak var activeCodeContentView: UIView!
20 - @IBOutlet weak var activeCodeContentViewHeight: NSLayoutConstraint!
21 -
22 - public var dfyCoupons:Array<swiftApi.ActiveDFYCouponModel> = swiftApi().getActiveDFYCoupons()
23 -
24 - public override func awakeFromNib() {
25 - super.awakeFromNib()
26 -
27 - // TODO: DELETE ===>
28 - // let coupon = swiftApi.ActiveDFYCouponModel()
29 - // coupon._value = "12"
30 - // // coupon._date = "2022-12-05 01:55:01"
31 - // coupon._date = "2022-10-26 23:59:01"
32 - // coupon._code = "123456789"
33 -
34 - // let coupon2 = swiftApi.ActiveDFYCouponModel()
35 - // coupon2._value = "23"
36 - // coupon2._date = "2022-11-05 01:55"
37 - // coupon2._code = "234567891"
38 -
39 - // let coupon3 = swiftApi.ActiveDFYCouponModel()
40 - // coupon3._value = "34"
41 - // coupon3._date = "2022-07-01 01:55"
42 - // coupon3._code = "345678912"
43 -
44 - // let couponsArray: Array<swiftApi.ActiveDFYCouponModel> = [coupon, coupon2, coupon3, coupon3, coupon3]
45 -
46 - // swiftApi().setActiveDFYCoupons(dfyCoupons: couponsArray)
47 -
48 - // dfyCoupons = swiftApi().getActiveDFYCoupons()
49 - // TODO: DELETE <===
50 -
51 - // Add shadow
52 - self.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
53 - self.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
54 - self.layer.shadowOpacity = 1.0
55 - self.layer.shadowRadius = 1.0
56 -
57 - activeCodeView.layer.cornerRadius = 16.5
58 - // activeCodeView.layer.borderWidth = 1
59 - // activeCodeView.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor
60 -
61 - activeCodeImage.image = UIImage(named: "active_code_logo_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
62 -
63 - if (dfyCoupons.count > 0) {
64 - if (dfyCoupons.count == 1) {
65 - let dateFormatter = DateFormatter()
66 - dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
67 - // dateFormatter.dateFormat = "yyyy-MM-dd HH:mm"
68 -
69 - // sort dfyCoupons by date
70 - dfyCoupons.sort(by: {
71 - let date1 = dateFormatter.date(from: $0._date)
72 - let date2 = dateFormatter.date(from: $1._date)
73 -
74 - if ((date1 != nil) && (date2 != nil)) {
75 - return date1!.compare(date2!) == .orderedAscending
76 - } else {
77 - return false
78 - }
79 -
80 - })
81 -
82 - // Get days from now of the most recet coupon
83 - var daysFromNow = ""
84 - let calendar = Calendar.current
85 -
86 - // Replace the hour (time) of both dates with 00:00
87 - let date1 = calendar.startOfDay(for: Date())
88 - if let date2 = dateFormatter.date(from: dfyCoupons[0]._date) {
89 - let components = calendar.dateComponents([.day], from: date1, to: date2)
90 - daysFromNow = (components.day) != nil ? String((components.day ?? 0) + 1) : ""
91 - }
92 -
93 - activeCodesCountLabel.text = "Ενεργός κωδικός:"
94 - // activeCodeLabel.text = dfyCoupons[0]._code
95 - let newLabel = CopyableLabel()
96 - newLabel.text = String(dfyCoupons[0]._code)
97 - newLabel.font = UIFont(name: "PeridotPE-Bold", size: 18)
98 - newLabel.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
99 - newLabel.frame.size.width = newLabel.intrinsicContentSize.width
100 - newLabel.frame.size.height = newLabel.intrinsicContentSize.height // tagHeight
101 - activeCodeContentView.addSubview(newLabel)
102 - // set the btn frame origin
103 - newLabel.frame.origin.x = 0
104 - newLabel.frame.origin.y = 0
105 - let scrollHeight = newLabel.intrinsicContentSize.height
106 - activeCodeContentViewHeight.constant = scrollHeight
107 - activeCodeScrollViewHeight.constant = scrollHeight
108 -
109 - activeCodeExpirationLabel.isHidden = false
110 - if (daysFromNow == "1") {
111 - activeCodeExpirationLabel.text = "Λήγει σε " + daysFromNow + " ημέρα"
112 - } else {
113 - activeCodeExpirationLabel.text = "Λήγει σε " + daysFromNow + " ημέρες"
114 - }
115 -
116 - } else {
117 - var tagHeight:CGFloat = 30
118 - let tagPadding: CGFloat = 0
119 - let tagSpacingX: CGFloat = 0
120 - let tagSpacingY: CGFloat = 2
121 -
122 - let containerWidth = activeCodeContentView.frame.size.width
123 -
124 - var currentOriginX: CGFloat = 0
125 - var currentOriginY: CGFloat = 0
126 -
127 - // var couponCodesString = ""
128 - for (index, item) in dfyCoupons.enumerated() {
129 - let newLabel = CopyableLabel()
130 - newLabel.font = UIFont(name: "PeridotPE-Bold", size: 18)
131 - newLabel.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
132 -
133 - if (index == (dfyCoupons.endIndex - 1)) {
134 - // couponCodesString += String(item._code)
135 - newLabel.text = String(item._code)
136 - } else {
137 - // couponCodesString += String(item._code) + ", "
138 - newLabel.text = String(item._code) + ", "
139 - }
140 -
141 - newLabel.frame.size.width = newLabel.intrinsicContentSize.width + tagPadding
142 - newLabel.frame.size.height = newLabel.intrinsicContentSize.height // tagHeight
143 - tagHeight = newLabel.intrinsicContentSize.height
144 - activeCodeContentView.addSubview(newLabel)
145 -
146 - // if current X + label width will be greater than container view width
147 - // "move to next row"
148 - if currentOriginX + newLabel.frame.width > containerWidth {
149 - currentOriginX = 0
150 - currentOriginY += tagHeight + tagSpacingY
151 - }
152 -
153 - // set the btn frame origin
154 - newLabel.frame.origin.x = currentOriginX
155 - newLabel.frame.origin.y = currentOriginY
156 -
157 - // increment current X by btn width + spacing
158 - currentOriginX += newLabel.frame.width + tagSpacingX
159 - }
160 -
161 - activeCodesCountLabel.text = String(dfyCoupons.count) + " Ενεργοί κωδικοί:"
162 - // activeCodeLabel.text = couponCodesString
163 - activeCodeExpirationLabel.isHidden = true
164 -
165 - // update container view height
166 - activeCodeContentViewHeight.constant = currentOriginY + tagHeight
167 - if ((currentOriginY + tagHeight) <= (2 * tagHeight + tagSpacingY)) {
168 - activeCodeScrollViewHeight.constant = currentOriginY + tagHeight
169 - } else {
170 - activeCodeScrollViewHeight.constant = 2 * tagHeight + tagSpacingY
171 - }
172 - }
173 - } else {
174 - activeCodeLabel.text = "-"
175 - activeCodeExpirationLabel.text = ""
176 -
177 - activeCodeView.isHidden = true
178 -
179 - activeCodeViewHeight.constant = 0
180 - }
181 - }
182 -
183 - public override func setSelected(_ selected: Bool, animated: Bool) {
184 - super.setSelected(selected, animated: animated)
185 -
186 - // Configure the view for the selected state
187 - }
188 -
189 - public override func layoutSubviews() {
190 - super.layoutSubviews()
191 - //set the values for top,left,bottom,right margins
192 - let margins = UIEdgeInsets(top: 2, left: 0, bottom: 4, right: 0)
193 - contentView.frame = contentView.frame.inset(by: margins)
194 - }
195 -
196 -}
1 -//
2 -// ActiveGiftsViewController.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Βασιλης Σκουρας on 11/5/22.
6 -//
7 -
8 -import Foundation
9 -import UIKit
10 -
11 -@objc public class ActiveGiftsViewController: UIViewController {
12 -
13 - @IBOutlet weak var couponButton: UIButton!
14 -
15 - public override func viewWillAppear(_ animated: Bool) {
16 - super.viewWillAppear(animated)
17 -
18 - self.hidesBottomBarWhenPushed = true
19 - setBackButton()
20 - setNavigationTitle("Ενεργά δώρα")
21 - }
22 -
23 - @IBAction func navigateToCoupon(_ sender: Any) {
24 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
25 - let vc = storyboard.instantiateViewController(withIdentifier: "CouponViewController") as! SwiftWarplyFramework.CouponViewController
26 - self.navigationController?.pushViewController(vc, animated: true)
27 - }
28 -
29 -}
1 -//
2 -// AnalysisChildViewController.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 18/7/22.
6 -//
7 -
8 -import UIKit
9 -
10 -class AnalysisChildViewController: UITableViewController {
11 -
12 - public var index: Int = -1
13 -}
1 -//
2 -// AnalysisHeaderMessageViewCell.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 18/7/22.
6 -//
7 -
8 -import UIKit
9 -
10 -class AnalysisHeaderMessageViewCell: UITableViewCell {
11 -
12 - // attributes
13 - @IBOutlet weak var itemImage: UIImageView!
14 - @IBOutlet weak var messageLabelView: UIView!
15 - @IBOutlet weak var messageLabel: UILabel!
16 - @IBOutlet weak var titleLabel: UILabel!
17 - @IBOutlet weak var emptyLabel: UILabel!
18 - @IBOutlet weak var emptyLabelHeight: NSLayoutConstraint!
19 - @IBOutlet weak var emptyLabelTopSpace: NSLayoutConstraint!
20 - @IBOutlet weak var emptyLabelBottomSpace: NSLayoutConstraint!
21 -
22 - public var loyaltyBadge:swiftApi.LoyaltyBadgeModel = swiftApi().getLoyaltyBadge()
23 -
24 - // lifecycle
25 - override func awakeFromNib() {
26 - super.awakeFromNib()
27 -
28 - // image
29 -// itemImage.image = UIImage(named: "ic_gift_circle_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
30 -
31 - // title
32 - titleLabel.textColor = UIColor(rgb: 0x212121)
33 - titleLabel.text = "Αναλυτικά:"
34 -
35 - // message
36 - messageLabel.textColor = UIColor(rgb: 0x212121)
37 - // messageLabelView.layer.borderWidth = 1.0
38 - // messageLabelView.layer.borderColor = UIColor(rgb: 0xE6E6E6).cgColor
39 - messageLabelView.layer.cornerRadius = 16.5
40 - messageLabelView.backgroundColor = .white
41 -
42 -// messageLabel.text = "Μέχρι τώρα έχεις κερδίσει " + totalCouponDiscountString + "€ σε προσφορές από " + String(loyaltyBadge._couponCount) + " κουπόνια!"
43 -
44 - }
45 -}
46 -
47 -extension AnalysisHeaderMessageViewCell {
48 - func configureCell(isEmpty: Bool, isMarket: Bool) {
49 -
50 - if (isEmpty == true) {
51 - emptyLabel.isHidden = false
52 - emptyLabelHeight.constant = 18.5
53 - emptyLabelTopSpace.constant = 30.0
54 - emptyLabelBottomSpace.constant = 10.0
55 - } else {
56 - emptyLabel.isHidden = true
57 - emptyLabelHeight.constant = 0.0
58 - emptyLabelTopSpace.constant = 0.0
59 - emptyLabelBottomSpace.constant = 0.0
60 - }
61 -
62 - if (isMarket == true) {
63 - itemImage.image = UIImage(named: "ic_history_market_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
64 -
65 - let oldUnifiedCouponList: Array<swiftApi.CouponItemModel> = swiftApi().getOldUnifiedCouponList()
66 - let oldUnifiedCouponListLength = oldUnifiedCouponList.count
67 - var unifiedCouponsDiscount: Float = 0.0
68 -
69 - for coupon in oldUnifiedCouponList {
70 - if let discountFloat = Float(coupon.discount ?? "0.0") {
71 - unifiedCouponsDiscount += discountFloat
72 - }
73 - }
74 -
75 - let totalCouponDiscount = Float(round(100 * unifiedCouponsDiscount) / 100)
76 - var totalCouponDiscountString = "0"
77 - totalCouponDiscountString = String(format: "%.2f", totalCouponDiscount).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
78 -
79 - let coupNormalText1 = "Μέχρι τώρα έχεις κερδίσει "
80 - let coupBoldText = totalCouponDiscountString + "€"
81 - let coupNormalText2 = " σε προσφορές από "
82 - let coupBoldText2 = String(oldUnifiedCouponListLength)
83 - let coupNormalText3 = " κουπόνια!"
84 -
85 - let attrRegular = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-Regular", size: 17) ?? UIFont.systemFont(ofSize: 16)]
86 - let attrBold = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-Bold", size: 17) ?? UIFont.boldSystemFont(ofSize: 16)]
87 -
88 - let coupAttributedString = NSMutableAttributedString(string:coupNormalText1, attributes:attrRegular)
89 - let coupBoldString = NSMutableAttributedString(string: coupBoldText, attributes:attrBold)
90 - let coupNormalString2 = NSMutableAttributedString(string:coupNormalText2, attributes:attrRegular)
91 - let coupBoldString2 = NSMutableAttributedString(string: coupBoldText2, attributes:attrBold)
92 - let coupNormalString3 = NSMutableAttributedString(string:coupNormalText3, attributes:attrRegular)
93 -
94 - coupAttributedString.append(coupBoldString)
95 - coupAttributedString.append(coupNormalString2)
96 - coupAttributedString.append(coupBoldString2)
97 - coupAttributedString.append(coupNormalString3)
98 - messageLabel.attributedText = coupAttributedString
99 -
100 - } else {
101 - itemImage.image = UIImage(named: "ic_gift_history", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
102 -
103 - let totalCouponDiscount = Float(round(100 * loyaltyBadge._value) / 100)
104 - var totalCouponDiscountString = "0"
105 - totalCouponDiscountString = String(format: "%.2f", totalCouponDiscount).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
106 -
107 - let coupNormalText1 = "Μέχρι τώρα έχεις κερδίσει "
108 - let coupBoldText = totalCouponDiscountString + "€"
109 - let coupNormalText2 = " σε προσφορές από "
110 - let coupBoldText2 = String(loyaltyBadge._couponCount)
111 - let coupNormalText3 = " κουπόνια!"
112 -
113 - let attrRegular = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-Regular", size: 17) ?? UIFont.systemFont(ofSize: 16)]
114 - let attrBold = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-Bold", size: 17) ?? UIFont.boldSystemFont(ofSize: 16)]
115 -
116 - let coupAttributedString = NSMutableAttributedString(string:coupNormalText1, attributes:attrRegular)
117 - let coupBoldString = NSMutableAttributedString(string: coupBoldText, attributes:attrBold)
118 - let coupNormalString2 = NSMutableAttributedString(string:coupNormalText2, attributes:attrRegular)
119 - let coupBoldString2 = NSMutableAttributedString(string: coupBoldText2, attributes:attrBold)
120 - let coupNormalString3 = NSMutableAttributedString(string:coupNormalText3, attributes:attrRegular)
121 -
122 - coupAttributedString.append(coupBoldString)
123 - coupAttributedString.append(coupNormalString2)
124 - coupAttributedString.append(coupBoldString2)
125 - coupAttributedString.append(coupNormalString3)
126 - messageLabel.attributedText = coupAttributedString
127 - }
128 -
129 - }
130 -}
1 -//
2 -// AnalysisHeaderViewCell.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 18/7/22.
6 -//
7 -
8 -import UIKit
9 -
10 -class AnalysisHeaderViewCell: UITableViewCell {
11 -
12 - // attributes
13 - @IBOutlet weak var itemImage: UIImageView!
14 - @IBOutlet weak var titleLabel: UILabel!
15 - @IBOutlet weak var emptyLabel: UILabel!
16 - @IBOutlet weak var emptyLabelHeight: NSLayoutConstraint!
17 - @IBOutlet weak var emptyLabelTopSpace: NSLayoutConstraint!
18 - @IBOutlet weak var emptyLabelBottomSpace: NSLayoutConstraint!
19 -
20 - // lifecycle
21 - override func awakeFromNib() {
22 - super.awakeFromNib()
23 -
24 - // image
25 -// itemImage.image = UIImage(named: "ic_gift_circle_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
26 -
27 - // title
28 -// titleLabel.textColor = UIColor(rgb: 0x435563)
29 -// titleLabel.text = "Αναλυτικά:"
30 - }
31 -}
32 -
33 -extension AnalysisHeaderViewCell {
34 - func configureCell(isEmpty: Bool, isMarket: Bool) {
35 -
36 - if (isEmpty == true) {
37 - emptyLabel.isHidden = false
38 - emptyLabelHeight.constant = 18.5
39 -// emptyLabelTopSpace.constant = 30.0
40 - emptyLabelBottomSpace.constant = 10.0
41 - } else {
42 - emptyLabel.isHidden = true
43 - emptyLabelHeight.constant = 0.0
44 -// emptyLabelTopSpace.constant = 0.0
45 - emptyLabelBottomSpace.constant = 0.0
46 - }
47 -
48 - if (isMarket == true) {
49 - itemImage.image = UIImage(named: "ic_history_market_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
50 - } else {
51 - itemImage.image = UIImage(named: "ic_gift_history", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
52 - }
53 -
54 - }
55 -}
1 -//
2 -// AnalysisItem.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 18/7/22.
6 -//
7 -
8 -import UIKit
9 -
10 -public class AnalysisItem: Codable {
11 -
12 - // attributes
13 - public var date: Date
14 - public var image_url: String?
15 - public var title: String?
16 - public let subtitle: String?
17 - public var price: Float
18 -
19 - // initialization
20 - public init() {
21 - self.date = Date()
22 - self.image_url = ""
23 - self.title = ""
24 - self.subtitle = ""
25 - self.price = 4.0
26 - }
27 -}
1 -//
2 -// AnalysisItemViewCell.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 18/7/22.
6 -//
7 -
8 -import UIKit
9 -
10 -class AnalysisItemViewCell: UITableViewCell {
11 -
12 - @IBOutlet weak var dateLabel: UILabel!
13 - @IBOutlet weak var itemImage: UIImageView!
14 - @IBOutlet weak var titleLabel: UILabel!
15 - @IBOutlet weak var priceLabel: UILabel!
16 - @IBOutlet weak var subtitleLabel: UILabel!
17 -
18 - var postImageURL: String? {
19 - didSet {
20 - if let url = postImageURL {
21 - self.itemImage.image = UIImage() // UIImage(named: "loading")
22 -
23 - UIImage.loadImageUsingCacheWithUrlString(url) { image in
24 - // set the image only when we are still displaying the content for the image we finished downloading
25 - if url == self.postImageURL {
26 - self.itemImage.image = image
27 - }
28 - }
29 - }
30 - else {
31 - self.itemImage.image = nil
32 - }
33 - }
34 - }
35 -
36 - // lifecycle
37 - override func awakeFromNib() {
38 - super.awakeFromNib()
39 -
40 - // date
41 - dateLabel.textColor = UIColor(rgb: 0x212121)
42 - dateLabel.font = UIFont(name: "PeridotPE-Bold", size: 12.0)
43 -
44 - // title
45 - titleLabel.textColor = UIColor(rgb: 0x212121)
46 - titleLabel.font = UIFont(name: "PeridotPE-Regular", size: 17.0)
47 -
48 - // price
49 - priceLabel.textColor = UIColor(rgb: 0x212121)
50 - priceLabel.font = UIFont(name: "PeridotPE-Bold", size: 17.0)
51 -
52 - // subtitle
53 -// subtitleLabel.textColor = UIColor(rgb: 0x9D9D9C)
54 - subtitleLabel.textColor = UIColor(rgb: 0x212121)
55 - subtitleLabel.font = UIFont(name: "PeridotPE-Regular", size: 14.0)
56 - }
57 -}
58 -
59 -extension AnalysisItemViewCell {
60 - func configureCell(item: swiftApi.SharingCouponModel) {
61 -
62 - let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList()
63 -
64 - titleLabel.text = ""
65 -
66 - for merchant in merchantList {
67 - if (merchant._uuid == item._merchant_uuid) {
68 - // itemImage.load(link: merchant._img_preview, placeholder: UIImage(), cache: URLCache())
69 - self.postImageURL = merchant._img_preview
70 - titleLabel.text = merchant._admin_name
71 - break;
72 - }
73 - }
74 -
75 - dateLabel.text = item._date
76 - // titleLabel.text = item._name
77 -
78 - let priceFloat = Float(round(100 * (Float(item._final_price) )) / 100)
79 - var priceString = "0"
80 - priceString = String(format: "%.2f", priceFloat).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
81 - priceLabel.text = priceString + "€"
82 -
83 - if ("sent" == item._sharing_type) {
84 - subtitleLabel.text = String(format: "Εκπτωτικό κουπόνι προς " + item._receiver_msisdn)
85 - } else if ("received" == item._sharing_type) {
86 - subtitleLabel.text = String(format: "Εκπτωτικό κουπόνι από " + item._sender_msisdn)
87 - }
88 - }
89 -
90 - func configureCell(item: swiftApi.SharingCouponModel, isMarket: Bool) {
91 -
92 - let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList()
93 - let couponSetData: swiftApi.CouponSetItemModel? = item._sm_couponset_data
94 -
95 - titleLabel.text = ""
96 -
97 - for merchant in merchantList {
98 - if (merchant._uuid == item._merchant_uuid) {
99 - // itemImage.load(link: merchant._img_preview, placeholder: UIImage(), cache: URLCache())
100 - self.postImageURL = merchant._img_preview
101 - titleLabel.text = merchant._admin_name
102 - break;
103 - }
104 - }
105 -
106 - dateLabel.text = item._date
107 - // titleLabel.text = item._name
108 -// titleLabel.text = couponSetData?.name ?? ""
109 -
110 -// let priceFloat = Float(round(100 * (Float(item._final_price) )) / 100)
111 - let priceFloat = Float(round(100 * (Float(couponSetData?.final_price ?? 0.0) )) / 100)
112 - var priceString = "0"
113 - priceString = String(format: "%.2f", priceFloat).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
114 - priceLabel.text = priceString + "€"
115 -
116 - if ("sent" == item._sharing_type) {
117 - subtitleLabel.text = String(format: "Εκπτωτικό κουπόνι προς " + item._receiver_msisdn)
118 - } else if ("received" == item._sharing_type) {
119 - subtitleLabel.text = String(format: "Εκπτωτικό κουπόνι από " + item._sender_msisdn)
120 - }
121 - }
122 -
123 - func configureCell(item: swiftApi.CouponItemModel) {
124 -
125 -// COUPONSET: desc, img_preview, name, terms, merchant_uuid
126 -// COUPON: coupon, expiration, discount, status
127 -// MERCHANT: _img_preview,_admin_name
128 -
129 - let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList()
130 - let couponSetData: swiftApi.CouponSetItemModel? = item.couponset_data
131 -
132 - titleLabel.text = ""
133 -
134 - // for merchant in merchantList {
135 - // // if (merchant._uuid == couponSetData?.merchant_uuid) {
136 - // if (merchant._uuid == item.merchant_uuid) {
137 - // // itemImage.load(link: merchant._img_preview, placeholder: UIImage(), cache: URLCache())
138 - // self.postImageURL = merchant._img_preview
139 - // titleLabel.text = merchant._admin_name
140 - // break;
141 - // }
142 - // }
143 -
144 - let merchantDetails: swiftApi.MerchantModel? = item.merchant_details
145 - self.postImageURL = merchantDetails?._img_preview
146 - titleLabel.text = merchantDetails?._admin_name
147 -
148 - dateLabel.text = item.redeemed ?? "" // expiration
149 -// itemImage.load(link: couponSetData?.img_preview ?? "", placeholder: UIImage(), cache: URLCache())
150 -// titleLabel.text = couponSetData?.name ?? ""
151 -
152 - let priceFloat = Float(round(100 * (Float(couponSetData?.final_price ?? 0.0) )) / 100)
153 - var priceString = "0"
154 - priceString = String(format: "%.2f", priceFloat).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
155 - priceLabel.text = priceString + "€"
156 -
157 - subtitleLabel.text = "Έκπτωτικό κουπόνι"
158 -// subtitleLabel.text = couponSetData?.short_description ?? ""
159 - // OR
160 -// let htmlText = couponSetData?.inner_text ?? ""
161 -// subtitleLabel.text = htmlText.htmlToString
162 -
163 - }
164 -
165 - func configureCell(item: swiftApi.CouponItemModel, isMarket: Bool) {
166 -
167 -// COUPONSET: desc, img_preview, name, terms, merchant_uuid
168 -// COUPON: coupon, expiration, discount, status
169 -// MERCHANT: _img_preview,_admin_name
170 -
171 - let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList()
172 -// let couponSetData: swiftApi.CouponSetItemModel? = item.couponset_data
173 -
174 - titleLabel.text = ""
175 -
176 - // for merchant in merchantList {
177 - // if (merchant._uuid == item.merchant_uuid) {
178 - // // itemImage.load(link: merchant._img_preview, placeholder: UIImage(), cache: URLCache())
179 - // self.postImageURL = merchant._img_preview
180 - // titleLabel.text = merchant._admin_name
181 - // break;
182 - // }
183 - // }
184 -
185 - let merchantDetails: swiftApi.MerchantModel? = item.merchant_details
186 - self.postImageURL = merchantDetails?._img_preview
187 - titleLabel.text = merchantDetails?._admin_name
188 -
189 -// titleLabel.text = item.name
190 -// self.postImageURL = item.image
191 -
192 - dateLabel.text = item.redeemed ?? ""
193 -
194 - let priceFloat = Float(round(100 * (Float(item.discount ?? "0.0") ?? 0.0 )) / 100)
195 - var priceString = "0"
196 - priceString = String(format: "%.2f", priceFloat).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
197 - priceLabel.text = priceString + "€"
198 -
199 - subtitleLabel.text = "Έκπτωτικό κουπόνι"
200 -// subtitleLabel.text = couponSetData?.short_description ?? ""
201 - // OR
202 -// let htmlText = couponSetData?.inner_text ?? ""
203 -// subtitleLabel.text = htmlText.htmlToString
204 -
205 - }
206 -}
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 - @IBOutlet weak var arrowImage: UIImageView!
13 -
14 - // lifecycle
15 - public override func awakeFromNib() {
16 - super.awakeFromNib()
17 -
18 - // title
19 - titleLabel.font = UIFont(name: "PeridotPE-Bold", size: 15)
20 - titleLabel.textColor = UIColor(rgb: 0x212121)
21 - titleLabel.text = "Δες Περισσότερα"
22 -
23 - arrowImage.image = UIImage(named: "ic_down_dark_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
24 - }
25 -}
1 -//
2 -// CSMButton.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 20/9/22.
6 -//
7 -
8 -import UIKit
9 -
10 -// @IBDesignable
11 -@objc public class CSMButton: UIButton {
12 - required init?(coder aDecoder: NSCoder) {
13 - super.init(coder: aDecoder)
14 - configure()
15 - }
16 - override init(frame: CGRect = .zero) {
17 - super.init(frame: frame)
18 - configure()
19 - }
20 -
21 - public override func prepareForInterfaceBuilder() {
22 - super.prepareForInterfaceBuilder()
23 - configure()
24 - }
25 -}
26 -
27 -private extension CSMButton {
28 - func configure() {
29 - setImage(UIImage(named: "ic_directions", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
30 - titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 18)
31 - setTitleColor(.white, for: .normal)
32 -// backgroundColor = UIColor(rgb: 0x79BF14)
33 - backgroundColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00)
34 - layer.cornerRadius = 12.0
35 -
36 - imageEdgeInsets = UIEdgeInsets(top:0.0, left:0.0, bottom:0.0, right:5.0);
37 - titleEdgeInsets = UIEdgeInsets(top:0.0, left:5.0, bottom:0.0, right:0.0);
38 - }
39 -}
1 -//
2 -// CampaignCategory.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 11/10/22.
6 -//
7 -
8 -import Foundation
9 -
10 -public class CampaignCategory: Codable {
11 -
12 - // attributes
13 - public var name: String?
14 - public var index: Int
15 - public var items: Array<swiftApi.CampaignItemModel>
16 -
17 - // initialization
18 - public init(_ name: String) {
19 - self.name = name == "ΑΛΛΕΣ" ? name : String(name.dropFirst())
20 - self.index = Int(name.prefix(1)) ?? 0
21 - self.items = [swiftApi.CampaignItemModel]()
22 - }
23 -
24 - public init(_ name: String, index: Int) {
25 - self.name = name == "ΑΛΛΕΣ" ? name : String(name.dropFirst())
26 - self.index = index
27 - self.items = [swiftApi.CampaignItemModel]()
28 - }
29 -}
30 -
31 -enum CampaignCategoryFactory {
32 - static func create(withTitle title: String) -> CampaignCategory {
33 -
34 - var index = 100
35 - let indexChr:Character = title[title.index(title.startIndex, offsetBy: 1)]
36 - if indexChr.isNumber {
37 - index = indexChr.wholeNumberValue!
38 - }
39 -
40 - return CampaignCategory(title, index: index)
41 - }
42 -}
43 -
...@@ -110,9 +110,9 @@ var timer2: DispatchSourceTimer? ...@@ -110,9 +110,9 @@ var timer2: DispatchSourceTimer?
110 self.navigationController?.isNavigationBarHidden = false 110 self.navigationController?.isNavigationBarHidden = false
111 } 111 }
112 112
113 - stopTimer() 113 +// stopTimer()
114 - 114 +//
115 - saveSteps(startTracking: false) 115 +// saveSteps(startTracking: false)
116 116
117 removeApplicationObservers() 117 removeApplicationObservers()
118 } 118 }
...@@ -154,12 +154,13 @@ var timer2: DispatchSourceTimer? ...@@ -154,12 +154,13 @@ var timer2: DispatchSourceTimer?
154 @objc func applicationDidEnterBackground() { 154 @objc func applicationDidEnterBackground() {
155 // Handle code when the application enters the background 155 // Handle code when the application enters the background
156 156
157 - saveSteps(startTracking: false) 157 +// saveSteps(startTracking: false)
158 } 158 }
159 159
160 // MARK: - Functions 160 // MARK: - Functions
161 func sendWebviewDidFocus() { 161 func sendWebviewDidFocus() {
162 - let scriptSource2 = "webviewDidFocus(\(self.webViewLoaded),\(swiftApi().getTrackingStepsEnabled()));" 162 + // let scriptSource2 = "webviewDidFocus(\(self.webViewLoaded),\(swiftApi().getTrackingStepsEnabled()));"
163 + let scriptSource2 = "webviewDidFocus(\(self.webViewLoaded),false);"
163 164
164 webView.evaluateJavaScript(scriptSource2, completionHandler: { (object, error) in 165 webView.evaluateJavaScript(scriptSource2, completionHandler: { (object, error) in
165 // print("==== webviewDidFocus object ====") 166 // print("==== webviewDidFocus object ====")
...@@ -191,75 +192,75 @@ var timer2: DispatchSourceTimer? ...@@ -191,75 +192,75 @@ var timer2: DispatchSourceTimer?
191 NotificationCenter.default.removeObserver(self, name: UIApplication.didEnterBackgroundNotification, object: nil) 192 NotificationCenter.default.removeObserver(self, name: UIApplication.didEnterBackgroundNotification, object: nil)
192 } 193 }
193 194
194 - func saveSteps(startTracking: Bool) { 195 +// func saveSteps(startTracking: Bool) {
195 - let persistedSteps = swiftApi().getSteps() 196 +// let persistedSteps = swiftApi().getSteps()
196 - if (persistedSteps > 0) { 197 +// if (persistedSteps > 0) {
197 - 198 +//
198 - let currentDateTime = Date() 199 +// let currentDateTime = Date()
199 - let dateFormatter = DateFormatter() 200 +// let dateFormatter = DateFormatter()
200 - dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" 201 +// dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
201 - let dateString = dateFormatter.string(from: currentDateTime) 202 +// let dateString = dateFormatter.string(from: currentDateTime)
202 - 203 +//
203 - swiftApi().setPacingDetailsAsync(persistedSteps, dateString, setPacingDetailsAsyncCallback, failureCallback: {errorCode in }) 204 +// swiftApi().setPacingDetailsAsync(persistedSteps, dateString, setPacingDetailsAsyncCallback, failureCallback: {errorCode in })
204 - } 205 +// }
205 - 206 +//
206 - func setPacingDetailsAsyncCallback (_ responseData: swiftApi.GenericResponseModel?) -> Void { 207 +// func setPacingDetailsAsyncCallback (_ responseData: swiftApi.GenericResponseModel?) -> Void {
207 - if (responseData != nil) { 208 +// if (responseData != nil) {
208 - DispatchQueue.main.async { 209 +// DispatchQueue.main.async {
209 - if (responseData?.getStatus == 1) { 210 +// if (responseData?.getStatus == 1) {
210 - if (startTracking) { 211 +// if (startTracking) {
211 - // TODO: DELETE LOGS 212 +// // TODO: DELETE LOGS
212 - // print("===== startTrackingSteps after save persisted steps ====") 213 +// // print("===== startTrackingSteps after save persisted steps ====")
213 - 214 +//
214 - self.sendWebviewDidFocus() 215 +// self.sendWebviewDidFocus()
215 - 216 +//
216 - swiftApi().startTrackingSteps(self.startTrackingStepsCallback) 217 +// swiftApi().startTrackingSteps(self.startTrackingStepsCallback)
217 - } 218 +// }
218 - } 219 +// }
219 - } 220 +// }
220 - } else { 221 +// } else {
221 - } 222 +// }
222 - } 223 +// }
223 - } 224 +// }
224 225
225 - func startTimer() { 226 +// func startTimer() {
226 - // print("========= Webview Timer Started! =========") 227 +// // print("========= Webview Timer Started! =========")
227 - 228 +//
228 - let queue = DispatchQueue(label: Bundle.main.bundleIdentifier! + ".webview.timer") 229 +// let queue = DispatchQueue(label: Bundle.main.bundleIdentifier! + ".webview.timer")
229 - timer2 = DispatchSource.makeTimerSource(queue: queue) 230 +// timer2 = DispatchSource.makeTimerSource(queue: queue)
230 - timer2!.schedule(deadline: .now(), repeating: .seconds(1)) 231 +// timer2!.schedule(deadline: .now(), repeating: .seconds(1))
231 - timer2!.setEventHandler { [weak self] in 232 +// timer2!.setEventHandler { [weak self] in
232 - // do whatever stuff you want on the background queue here here 233 +// // do whatever stuff you want on the background queue here here
233 - // print("========= Webview interval! =========") 234 +// // print("========= Webview interval! =========")
234 - 235 +//
235 - DispatchQueue.main.async { 236 +// DispatchQueue.main.async {
236 - // update your model objects and/or UI here 237 +// // update your model objects and/or UI here
237 - let metersParam = swiftApi().getMetersWebview() 238 +// let metersParam = swiftApi().getMetersWebview()
238 - let scriptSource = "passMeters(\(metersParam));" 239 +// let scriptSource = "passMeters(\(metersParam));"
239 - 240 +//
240 - self?.webView.evaluateJavaScript(scriptSource, completionHandler: { (object, error) in 241 +// self?.webView.evaluateJavaScript(scriptSource, completionHandler: { (object, error) in
241 -// print("==== object passMeters ====") 242 +//// print("==== object passMeters ====")
242 -// print(object) 243 +//// print(object)
243 -// print("==== error passMeters ====") 244 +//// print("==== error passMeters ====")
244 -// print(error) 245 +//// print(error)
245 - 246 +//
246 - swiftApi().setSavedStepsWebview(swiftApi().getSavedStepsWebview() + swiftApi().getStepsWebview()) 247 +// swiftApi().setSavedStepsWebview(swiftApi().getSavedStepsWebview() + swiftApi().getStepsWebview())
247 - swiftApi().setStepsWebview(0) 248 +// swiftApi().setStepsWebview(0)
248 - swiftApi().setMetersWebview(0.0) 249 +// swiftApi().setMetersWebview(0.0)
249 - 250 +//
250 - // print("==== SavedStepsWebview ====") 251 +// // print("==== SavedStepsWebview ====")
251 - // print(swiftApi().getSavedStepsWebview()) 252 +// // print(swiftApi().getSavedStepsWebview())
252 - }) 253 +// })
253 - } 254 +// }
254 - } 255 +// }
255 - timer2!.resume() 256 +// timer2!.resume()
256 - } 257 +// }
257 - 258 +//
258 - func stopTimer() { 259 +// func stopTimer() {
259 - // print("========= Webview Timer Stopped! =========") 260 +// // print("========= Webview Timer Stopped! =========")
260 - timer2?.cancel() 261 +// timer2?.cancel()
261 - timer2 = nil 262 +// timer2 = nil
262 - } 263 +// }
263 264
264 // Location Permissions 265 // Location Permissions
265 func locationServicesIsEnabled() -> Bool { 266 func locationServicesIsEnabled() -> Bool {
...@@ -405,21 +406,21 @@ var timer2: DispatchSourceTimer? ...@@ -405,21 +406,21 @@ var timer2: DispatchSourceTimer?
405 // <=== 406 // <===
406 407
407 // MARK: - API Calls 408 // MARK: - API Calls
408 - func startTrackingSteps() { 409 +// func startTrackingSteps() {
409 - let persistedSteps = swiftApi().getSteps() 410 +// let persistedSteps = swiftApi().getSteps()
410 - if (persistedSteps > 0) { 411 +// if (persistedSteps > 0) {
411 - saveSteps(startTracking: true) 412 +// saveSteps(startTracking: true)
412 - } else { 413 +// } else {
413 - swiftApi().startTrackingSteps(startTrackingStepsCallback) 414 +// swiftApi().startTrackingSteps(startTrackingStepsCallback)
414 - } 415 +// }
415 - 416 +//
416 -// swiftApi().startTrackingSteps(startTrackingStepsCallback) 417 +//// swiftApi().startTrackingSteps(startTrackingStepsCallback)
417 - } 418 +// }
418 419
419 - func startTrackingStepsCallback (_ steps: Int) -> Void { 420 +// func startTrackingStepsCallback (_ steps: Int) -> Void {
420 - DispatchQueue.main.async { 421 +// DispatchQueue.main.async {
421 - } 422 +// }
422 - } 423 +// }
423 424
424 // MARK: - WKNavigationDelegate 425 // MARK: - WKNavigationDelegate
425 public func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { 426 public func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
...@@ -433,9 +434,9 @@ var timer2: DispatchSourceTimer? ...@@ -433,9 +434,9 @@ var timer2: DispatchSourceTimer?
433 // print("==== error ====") 434 // print("==== error ====")
434 // print(error) 435 // print(error)
435 436
436 - DispatchQueue.main.asyncAfter(deadline: .now() + 3.0) { 437 +// DispatchQueue.main.asyncAfter(deadline: .now() + 3.0) {
437 - self.startTimer() 438 +// self.startTimer()
438 - } 439 +// }
439 }) 440 })
440 441
441 // let scriptSource2 = "webviewDidFocus(\(self.webViewLoaded),\(swiftApi().getTrackingStepsEnabled()));" 442 // let scriptSource2 = "webviewDidFocus(\(self.webViewLoaded),\(swiftApi().getTrackingStepsEnabled()));"
...@@ -551,36 +552,36 @@ var timer2: DispatchSourceTimer? ...@@ -551,36 +552,36 @@ var timer2: DispatchSourceTimer?
551 } else if (eventArray[1] == "addUserTag") { 552 } else if (eventArray[1] == "addUserTag") {
552 // SwiftEventBus.post("questionnaire", sender: questionnaireEvent) 553 // SwiftEventBus.post("questionnaire", sender: questionnaireEvent)
553 554
554 - swiftApi().getProfileAsync(getProfileCallback, failureCallback: {errorCode in }) 555 + // swiftApi().getProfileAsync(getProfileCallback, failureCallback: {errorCode in })
555 556
556 - func getProfileCallback (_ profileData: swiftApi.ProfileModel?) -> Void { 557 + // func getProfileCallback (_ profileData: swiftApi.ProfileModel?) -> Void {
557 - if (profileData != nil) { 558 + // if (profileData != nil) {
558 - DispatchQueue.main.async { 559 + // DispatchQueue.main.async {
559 - swiftApi().getCampaignsAsyncNew(language: "en", filters: [String : Any](), getCampaignsCallback, failureCallback: {errorCode in }) 560 + // swiftApi().getCampaignsAsyncNew(language: "en", filters: [String : Any](), getCampaignsCallback, failureCallback: {errorCode in })
560 561
561 - func getCampaignsCallback (_ campaignsData: Array<swiftApi.CampaignItemModel>?) -> Void { 562 + // func getCampaignsCallback (_ campaignsData: Array<swiftApi.CampaignItemModel>?) -> Void {
562 - if (campaignsData != nil) { 563 + // if (campaignsData != nil) {
563 - DispatchQueue.main.async { 564 + // DispatchQueue.main.async {
564 - let questionnaireEvent = swiftApi.QuestionnaireEventModel() 565 + // let questionnaireEvent = swiftApi.QuestionnaireEventModel()
565 - questionnaireEvent._name = String(eventArray[1]) 566 + // questionnaireEvent._name = String(eventArray[1])
566 - if (eventArray.count > 2) { 567 + // if (eventArray.count > 2) {
567 - questionnaireEvent._parameter = String(eventArray[2]) 568 + // questionnaireEvent._parameter = String(eventArray[2])
568 - swiftApi().setUserTag(String(eventArray[2])) 569 + // swiftApi().setUserTag(String(eventArray[2]))
569 - } else { 570 + // } else {
570 - questionnaireEvent._parameter = "" 571 + // questionnaireEvent._parameter = ""
571 - swiftApi().setUserTag("") 572 + // swiftApi().setUserTag("")
572 - } 573 + // }
573 - SwiftEventBus.post("questionnaire", sender: questionnaireEvent) 574 + // SwiftEventBus.post("questionnaire", sender: questionnaireEvent)
574 - SwiftEventBus.post("campaigns_retrieved") 575 + // SwiftEventBus.post("campaigns_retrieved")
575 - } 576 + // }
576 - } else { 577 + // } else {
577 - } 578 + // }
578 - } 579 + // }
579 580
580 - } 581 + // }
581 - } else { 582 + // } else {
582 - } 583 + // }
583 - } 584 + // }
584 585
585 586
586 } else if (eventArray[1] == "couponRetrieved") { 587 } else if (eventArray[1] == "couponRetrieved") {
...@@ -618,35 +619,35 @@ var timer2: DispatchSourceTimer? ...@@ -618,35 +619,35 @@ var timer2: DispatchSourceTimer?
618 619
619 } 620 }
620 else if (eventArray[1] == "steps" && eventArray[2] == "widgetDisabled") { 621 else if (eventArray[1] == "steps" && eventArray[2] == "widgetDisabled") {
621 - let pacingWidget = swiftApi.WarplyPacingCardEventModel() 622 +// let pacingWidget = swiftApi.WarplyPacingCardEventModel()
622 - pacingWidget._isVisible = false 623 +// pacingWidget._isVisible = false
623 - SwiftEventBus.post("pacing_widget", sender: pacingWidget) 624 +// SwiftEventBus.post("pacing_widget", sender: pacingWidget)
624 625
625 } else if (eventArray[1] == "steps" && eventArray[2] == "widgetEnabled") { 626 } else if (eventArray[1] == "steps" && eventArray[2] == "widgetEnabled") {
626 - let pacingWidget = swiftApi.WarplyPacingCardEventModel() 627 +// let pacingWidget = swiftApi.WarplyPacingCardEventModel()
627 - pacingWidget._isVisible = true 628 +// pacingWidget._isVisible = true
628 - SwiftEventBus.post("pacing_widget", sender: pacingWidget) 629 +// SwiftEventBus.post("pacing_widget", sender: pacingWidget)
629 630
630 } 631 }
631 else if (eventArray[1] == "steps" && eventArray[2] == "shortcutEnabled") { 632 else if (eventArray[1] == "steps" && eventArray[2] == "shortcutEnabled") {
632 - let pacingEvent = swiftApi.WarplyPacingEventModel() 633 +// let pacingEvent = swiftApi.WarplyPacingEventModel()
633 - pacingEvent._isVisible = true 634 +// pacingEvent._isVisible = true
634 - SwiftEventBus.post("pacing", sender: pacingEvent) 635 +// SwiftEventBus.post("pacing", sender: pacingEvent)
635 - 636 +//
636 - if (swiftApi().getTrackingStepsEnabled() == false) { 637 +// if (swiftApi().getTrackingStepsEnabled() == false) {
637 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel() 638 +// let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
638 - firebaseEvent._eventName = "loyalty_steps_activation" 639 +// firebaseEvent._eventName = "loyalty_steps_activation"
639 - firebaseEvent._parameters = nil 640 +// firebaseEvent._parameters = nil
640 - SwiftEventBus.post("firebase", sender: firebaseEvent) 641 +// SwiftEventBus.post("firebase", sender: firebaseEvent)
641 - 642 +//
642 - self.startTrackingSteps() 643 +// self.startTrackingSteps()
643 - } 644 +// }
644 645
645 } else if (eventArray[1] == "steps" && eventArray[2] == "shortcutDisabled") { 646 } else if (eventArray[1] == "steps" && eventArray[2] == "shortcutDisabled") {
646 - let pacingEvent = swiftApi.WarplyPacingEventModel() 647 +// let pacingEvent = swiftApi.WarplyPacingEventModel()
647 - pacingEvent._isVisible = false 648 +// pacingEvent._isVisible = false
648 - SwiftEventBus.post("pacing", sender: pacingEvent) 649 +// SwiftEventBus.post("pacing", sender: pacingEvent)
649 - swiftApi().stopTrackingSteps() 650 +// swiftApi().stopTrackingSteps()
650 651
651 } else if (eventArray[1] == "request" || eventArray[1] == "response") { 652 } else if (eventArray[1] == "request" || eventArray[1] == "response") {
652 print("**************** WARPLY Webview Log START *****************") 653 print("**************** WARPLY Webview Log START *****************")
...@@ -800,13 +801,13 @@ var timer2: DispatchSourceTimer? ...@@ -800,13 +801,13 @@ var timer2: DispatchSourceTimer?
800 801
801 } else if (eventArray[1] == "loyaltyWallet") { 802 } else if (eventArray[1] == "loyaltyWallet") {
802 // event:loyaltyWallet 803 // event:loyaltyWallet
803 - SwiftEventBus.post("refresh_vouchers") 804 +// SwiftEventBus.post("refresh_vouchers")
804 -// SwiftEventBus.post("open_my_rewards") 805 +//// SwiftEventBus.post("open_my_rewards")
805 - 806 +//
806 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self)) 807 +// let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
807 - let vc = storyboard.instantiateViewController(withIdentifier: "UnifiedCouponsViewController") as! SwiftWarplyFramework.UnifiedCouponsViewController 808 +// let vc = storyboard.instantiateViewController(withIdentifier: "UnifiedCouponsViewController") as! SwiftWarplyFramework.UnifiedCouponsViewController
808 - vc.isFromCampaignVC = true 809 +// vc.isFromCampaignVC = true
809 - self.navigationController?.pushViewController(vc, animated: true) 810 +// self.navigationController?.pushViewController(vc, animated: true)
810 811
811 // swiftApi().getUnifiedCouponsDeals { unifiedCoupons in 812 // swiftApi().getUnifiedCouponsDeals { unifiedCoupons in
812 // let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self)) 813 // let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
...@@ -892,12 +893,12 @@ var timer2: DispatchSourceTimer? ...@@ -892,12 +893,12 @@ var timer2: DispatchSourceTimer?
892 } 893 }
893 } 894 }
894 895
895 - DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) { 896 +// DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) {
896 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: SwiftWarplyFramework.CouponsViewController.self)) 897 +// let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: SwiftWarplyFramework.CouponsViewController.self))
897 - if let vc = storyboard.instantiateViewController(withIdentifier: "CouponsViewController") as? SwiftWarplyFramework.CouponsViewController{ 898 +// if let vc = storyboard.instantiateViewController(withIdentifier: "CouponsViewController") as? SwiftWarplyFramework.CouponsViewController{
898 - self.navigationController?.pushViewController(vc,animated: true) 899 +// self.navigationController?.pushViewController(vc,animated: true)
899 - } 900 +// }
900 - } 901 +// }
901 902
902 } else if (eventArray[1] == "webviewRefresh") { 903 } else if (eventArray[1] == "webviewRefresh") {
903 self.mWebviewSupermarket = true 904 self.mWebviewSupermarket = true
......
1 -//
2 -// ContextualViewController.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 2/9/22.
6 -//
7 -
8 -import UIKit
9 -import SwiftEventBus
10 -
11 -@objc public class ContextualViewController: UIViewController, UIPopoverControllerDelegate {
12 - @IBOutlet weak var mainView: UIView!
13 - @IBOutlet weak var backgroundImage: UIImageView!
14 - @IBOutlet weak var scrollView: UIScrollView!
15 - @IBOutlet weak var scrollContentView: UIView!
16 - @IBOutlet weak var couponImage: UIImageView!
17 - @IBOutlet weak var couponImageHeight: NSLayoutConstraint!
18 - @IBOutlet weak var nameLabel: UILabel!
19 - @IBOutlet weak var descriptionLabel: UILabel!
20 - @IBOutlet weak var redeemButton: UIButton!
21 - @IBOutlet weak var topBorderLine: UIImageView!
22 - @IBOutlet weak var termsButton: UIButton!
23 - @IBOutlet weak var termsTextView: UnselectableTappableTextView!
24 - @IBOutlet weak var termsTextViewHeight: NSLayoutConstraint!
25 -
26 - public var ccms: swiftApi.LoyaltyContextualOfferModel?
27 -
28 - var selectedNumber: String = ""
29 - var termsVisible: Bool = false;
30 - public var numbersList: Array<String> = []
31 -
32 - let uiscreen: CGRect = UIScreen.main.bounds
33 -
34 - let spinner = SpinnerViewController()
35 -
36 - public override func viewDidLoad() {
37 - super.viewDidLoad()
38 -
39 - self.hidesBottomBarWhenPushed = true
40 -
41 - // Do any additional setup after loading the view.
42 - // getProfileRequest()
43 -
44 - numbersList = ccms?._eligibleAssets ?? []
45 -
46 - setBackButton()
47 -// setNavigationTitle("")
48 -
49 - backgroundImage.image = UIImage(named: "coupons_scrollview_white", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
50 -
51 -// scrollView.clipsToBounds = true
52 -// scrollView.layer.cornerRadius = 30
53 -// scrollView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
54 -
55 -// let image = UIImage(named: "top_border_line", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)!
56 -// var aspectR: CGFloat = 0.0
57 -//
58 -// aspectR = image.size.width/image.size.height
59 -//
60 -// topBorderLine.translatesAutoresizingMaskIntoConstraints = false
61 -// topBorderLine.image = image
62 -// topBorderLine.contentMode = .scaleAspectFill
63 -//
64 -// NSLayoutConstraint.activate([
65 -// topBorderLine.topAnchor.constraint(equalTo: mainView.topAnchor, constant: 0),
66 -// topBorderLine.leadingAnchor.constraint(equalTo: mainView.leadingAnchor, constant: 0),
67 -// topBorderLine.trailingAnchor.constraint(equalTo: mainView.trailingAnchor, constant: 0),
68 -// topBorderLine.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.width),
69 -// topBorderLine.heightAnchor.constraint(equalTo: topBorderLine.widthAnchor, multiplier: 1/aspectR)
70 -// ])
71 -
72 - couponImage.load(link: ccms?._imageUrl ?? "", placeholder: UIImage(), cache: URLCache())
73 - couponImage.contentMode = .scaleAspectFill
74 - couponImageHeight.constant = 222 // 255 //230 // 253 // self.uiscreen.height * 0.25
75 -
76 - nameLabel.text = ccms?._titleOffer ?? ""
77 - descriptionLabel.text = ccms?._description ?? ""
78 -
79 - redeemButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 17)
80 - redeemButton.setTitle("Ενεργοποίηση", for: .normal)
81 - redeemButton.setTitleColor(.white, for: .normal)
82 - redeemButton.backgroundColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00)
83 - redeemButton.layer.cornerRadius = 16.0
84 - redeemButton.frame = CGRect(x: 0.0, y: 0.0, width: redeemButton.intrinsicContentSize.width, height: 50)
85 - redeemButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 25, bottom: 0, right: 25)
86 - // Fix width for ipad
87 -// if UIDevice.current.userInterfaceIdiom == .pad {
88 -// // iPad
89 -// redeemButton.widthAnchor.constraint(equalToConstant: 250).isActive = true
90 -// } else {
91 -// // not iPad (iPhone, mac, tv, carPlay, unspecified)
92 -// redeemButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
93 -// }
94 -
95 - termsButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 15)
96 -// termsButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
97 - termsButton.setTitle("Όροι χρήσης", for: .normal)
98 - termsButton.setTitleColor(UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00), for: .normal)
99 - termsButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
100 - termsButton.semanticContentAttribute = .forceRightToLeft
101 - termsButton.tintColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 1.00)
102 - termsButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0);
103 - termsButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 5);
104 - termsButton.imageView?.layer.transform = CATransform3DMakeScale(0.8, 0.8, 0.8)
105 -
106 - termsTextView.text = ccms?._termsAndConditions ?? ""
107 - termsTextView.font = UIFont(name: "PeridotPE-Regular", size: 14)
108 - termsTextView.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
109 - termsTextView.textAlignment = .left
110 - termsTextView.isScrollEnabled = false
111 -
112 - toggleTerms()
113 -
114 - }
115 -
116 - public override func viewWillAppear(_ animated: Bool) {
117 - super.viewWillAppear(animated)
118 -
119 - swiftApi().logTrackersEvent("screen", "ContextualScreen")
120 -
121 - self.navigationController?.hideHairline()
122 - }
123 -
124 -
125 - // MARK: - Functions
126 - func showSpinner() {
127 - // add the spinner view controller
128 - // addChild(spinner)
129 - // spinner.view.frame = view.frame
130 - // view.addSubview(spinner.view)
131 - // spinner.didMove(toParent: self)
132 -
133 - addChild(spinner)
134 - spinner.view.frame = CGRect(x: 0, y: 0, width: self.view.frame.width, height: self.view.frame.height)
135 - self.view.addSubview(spinner.view)
136 - spinner.didMove(toParent: self)
137 - }
138 -
139 - func hideSpinner() {
140 - // remove the spinner view controller
141 - spinner.willMove(toParent: nil)
142 - spinner.view.removeFromSuperview()
143 - spinner.removeFromParent()
144 - }
145 -
146 - func toggleTerms() {
147 - if (termsVisible) {
148 - termsTextView.isHidden = false
149 - let targetSize = CGSize(width: termsTextView.frame.width, height: CGFloat(MAXFLOAT))
150 - termsTextViewHeight.constant = termsTextView.sizeThatFits(targetSize).height
151 -
152 - termsButton.setImage(UIImage(named: "ic_up_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
153 - } else {
154 - termsTextView.isHidden = true
155 - termsTextViewHeight.constant = CGFloat(0)
156 -
157 - termsButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
158 - }
159 - }
160 -
161 - func showConfirmDialog(_ numberArg: String) -> Void {
162 -
163 - let alert = UIAlertController(title: "Ενεργοποίηση υπηρεσίας", message: "Θέλετε να γίνει ενεργοποίηση στο " + numberArg + ";", preferredStyle: .alert)
164 -
165 - let cancelButton = UIAlertAction(title: "Άκυρο", style: .default, handler: { action in
166 - switch action.style{
167 - case .default:
168 - print("default")
169 -
170 - case .cancel:
171 - print("cancel")
172 -
173 - case .destructive:
174 - print("destructive")
175 -
176 - }
177 - })
178 - // cancelButton.setValue(UIColor(rgb: 0xFC5757), forKey: "titleTextColor")
179 - alert.addAction(cancelButton)
180 -
181 - alert.addAction(UIAlertAction(title: "Ενεργοποίηση", style: .default, handler: { action in
182 - switch action.style{
183 - case .default:
184 - swiftApi().logTrackersEvent("click", ("ActivateContextual:" + (self.ccms?._sessionId ?? "")))
185 - self.submitOrderRequest()
186 -
187 - case .cancel:
188 - print("cancel")
189 -
190 - case .destructive:
191 - print("destructive")
192 -
193 - }
194 - }))
195 -
196 - self.present(alert, animated: true, completion: nil)
197 - }
198 -
199 - func showDialog(_ alertTitle: String, _ alertSubTitle: String) -> Void {
200 -
201 - let alert = UIAlertController(title: alertTitle, message: alertSubTitle, preferredStyle: .alert)
202 - alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
203 - switch action.style{
204 - case .default:
205 - print("default")
206 -
207 - case .cancel:
208 - print("cancel")
209 -
210 - case .destructive:
211 - print("destructive")
212 -
213 - }
214 - }))
215 - self.present(alert, animated: true, completion: nil)
216 - }
217 -
218 - func showSuccessDialog(_ alertTitle: String, _ alertSubTitle: String) -> Void {
219 -
220 - let alert = UIAlertController(title: alertTitle, message: alertSubTitle, preferredStyle: .alert)
221 - alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
222 - switch action.style{
223 - case .default:
224 - self.navigationController?.popViewController(animated: true)
225 -
226 - // swiftApi().getCouponsAsync(getCouponsCallback, failureCallback: {errorCode in })
227 - swiftApi().getCouponsAsyncInternal(getCouponsCallback, failureCallback: {errorCode in })
228 -
229 - func getCouponsCallback (_ couponsData: Array<swiftApi.CouponItemModel>?) -> Void {
230 - if (couponsData != nil) {
231 - DispatchQueue.main.async {
232 - SwiftEventBus.post("coupons_fetched")
233 - }
234 - } else {
235 - }
236 - }
237 -
238 - var campaignFound: swiftApi.CampaignItemModel? = nil
239 -
240 - if let ccmLoyaltyCampaignId = self.ccms?._loyaltyCampaignId {
241 - let allCampaigns = swiftApi().getAllCampaignList()
242 - for item in allCampaigns {
243 - if (item.session_uuid == ccmLoyaltyCampaignId) {
244 - campaignFound = item
245 - break;
246 - }
247 - }
248 - }
249 -
250 - if let tempCampaign = campaignFound {
251 - swiftApi().removeCampaignItem(campaignArg: tempCampaign)
252 - swiftApi().getCampaignsAsyncNewInternal(getCampaignsCallback, failureCallback: {errorCode in})
253 - }
254 -
255 - // swiftApi().getCampaignsAsyncNew(language: "en", filters: [String : Any](), getCampaignsCallback, failureCallback: {errorCode in })
256 -
257 - func getCampaignsCallback (_ campaignsData: Array<swiftApi.CampaignItemModel>?) -> Void {
258 - if (campaignsData != nil) {
259 - DispatchQueue.main.async {
260 - SwiftEventBus.post("campaigns_retrieved")
261 - }
262 - } else {
263 - }
264 - }
265 -
266 - case .cancel:
267 - print("cancel")
268 -
269 - case .destructive:
270 - print("destructive")
271 -
272 - }
273 - }))
274 - self.present(alert, animated: true, completion: nil)
275 - }
276 -
277 -
278 - // MARK: - API CALLS
279 - func getProfileRequest() {
280 - swiftApi().getProfileAsync(getProfileCallback, failureCallback: {errorCode in })
281 - }
282 -
283 - func getProfileCallback (_ profileData: swiftApi.ProfileModel?) -> Void {
284 - if (profileData != nil) {
285 - DispatchQueue.main.async {
286 - self.numbersList = profileData?._msisdnList ?? []
287 - }
288 - } else {
289 - }
290 - }
291 -
292 - func submitOrderRequest() {
293 - self.showSpinner()
294 - swiftApi().submitOrderAsync(campaign_session_uuid: "", user_msisdn: self.selectedNumber, businessService: (ccms?._businessService ?? ""), offerName: (ccms?._offerName ?? ""), productType: (ccms?._productType ?? ""), provDuration: (ccms?._provDuration ?? ""), noOfRecurrance: (ccms?._noOfRecurrance ?? ""), price: (ccms?._price ?? ""), discount: (ccms?._discount ?? ""), voiceCategory: (ccms?._voiceCategory ?? ""), dataCategory: (ccms?._dataCategory ?? ""), minsValue: (ccms?._minsValue ?? ""), dataValue: (ccms?._dataValue ?? ""), provStepValueMins: (ccms?._provStepValueMins ?? ""),
295 - OfferAudienceLevel: (ccms?._offerAudienceLevel ?? ""), UACIOfferTrackingCode: (ccms?._uaciOfferTrackingCode ?? ""), OFFERCODE1: (ccms?._offerCode1 ?? ""), SCORE: (ccms?._score ?? ""), ZONE: (ccms?._zone ?? ""), WAVE: (ccms?._wave ?? ""), VALIDITY: (ccms?._validity ?? ""), TREATMENT_CODE: (ccms?._treatmentCode ?? ""), ccms_session_id: (ccms?._sessionId ?? ""), notificationMessage: (ccms?._notificationMessage ?? ""),
296 - submitOrderCallback, failureCallback: {errorCode in
297 - self.hideSpinner()
298 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
299 - firebaseEvent._eventName = "loyalty_offer_activated"
300 - firebaseEvent.setParameter = ("name", (self.ccms?._title ?? ""))
301 - firebaseEvent.setParameter = ("type", "gift")
302 - firebaseEvent.setParameter = ("successful", "false")
303 - SwiftEventBus.post("firebase", sender: firebaseEvent)
304 -
305 - self.showDialog("Αποτυχία","Κάτι πήγε στραβά")
306 - })
307 - }
308 -
309 - func submitOrderCallback (_ response: swiftApi.GenericResponseModel?) -> Void {
310 - self.hideSpinner()
311 - if (response != nil) {
312 - DispatchQueue.main.async {
313 - if (response?.getStatus == 1) {
314 -
315 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
316 - firebaseEvent._eventName = "loyalty_offer_activated"
317 - firebaseEvent.setParameter = ("name", (self.ccms?._title ?? ""))
318 - firebaseEvent.setParameter = ("type", "gift")
319 - firebaseEvent.setParameter = ("successful", "true")
320 - SwiftEventBus.post("firebase", sender: firebaseEvent)
321 -
322 - let ccmsEnabled = swiftApi.WarplyCCMSEnabledModel()
323 - ccmsEnabled._isActivated = true
324 - SwiftEventBus.post("ccms_enabled", sender: ccmsEnabled)
325 -
326 - self.showSuccessDialog("Το αίτημά σου ολοκληρώθηκε επιτυχώς!","Θα ενημερωθείς άμεσα για την ενεργοποίηση του πακέτου σου.")
327 - // self.postEventRequest()
328 -
329 - } else {
330 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
331 - firebaseEvent._eventName = "loyalty_offer_activated"
332 - firebaseEvent.setParameter = ("name", (self.ccms?._title ?? ""))
333 - firebaseEvent.setParameter = ("type", "gift")
334 - firebaseEvent.setParameter = ("successful", "false")
335 - SwiftEventBus.post("firebase", sender: firebaseEvent)
336 -
337 - self.showDialog("Αποτυχία","Κάτι πήγε στραβά")
338 - }
339 - }
340 - } else {
341 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
342 - firebaseEvent._eventName = "loyalty_offer_activated"
343 - firebaseEvent.setParameter = ("name", (self.ccms?._title ?? ""))
344 - firebaseEvent.setParameter = ("type", "gift")
345 - firebaseEvent.setParameter = ("successful", "false")
346 - SwiftEventBus.post("firebase", sender: firebaseEvent)
347 -
348 - self.showDialog("Αποτυχία","Κάτι πήγε στραβά")
349 - }
350 - }
351 -
352 - // MARK: - Actions
353 -
354 - @IBAction func redeemButtomAction(_ sender: Any) {
355 - if (self.numbersList != nil && self.numbersList.count == 1) {
356 - self.showConfirmDialog(self.numbersList[0])
357 - } else {
358 - self.numbersPopupTapped(sender)
359 - }
360 - }
361 -
362 - @IBAction func termsButtonAction(_ sender: Any) {
363 - termsVisible = !termsVisible
364 - toggleTerms()
365 - }
366 -
367 -}
368 -
369 -// MARK: NumbersPopup
370 -extension ContextualViewController: NumbersPopupDelegate {
371 - @objc func numbersPopupTapped(_ sender: Any) {
372 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
373 - let pp = storyboard.instantiateViewController(withIdentifier: "NumberPopupViewController") as! SwiftWarplyFramework.NumberPopupViewController
374 - pp.InitWithController(controller: self,
375 - numbersList: self.numbersList,
376 - sender: sender,
377 - delegate: self,
378 - headerText: "Επιλογή σύνδεσης")
379 - }
380 -
381 - func presentedPopup() {
382 -// Code for when popup is presented
383 - }
384 -
385 - func dismissedPopup() {
386 -// Code for when popup is dismissed
387 - }
388 -
389 - func optionSelected(_ option: String) {
390 -// Code for when option is selected
391 - self.selectedNumber = option
392 - DispatchQueue.main.async {
393 - self.showConfirmDialog(option)
394 - }
395 - }
396 -}
1 -//
2 -// CopyableLabel.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 26/10/22.
6 -//
7 -
8 -import Foundation
9 -import UIKit
10 -
11 -class CopyableLabel: UILabel {
12 -
13 - override init(frame: CGRect) {
14 - super.init(frame: frame)
15 - sharedInit()
16 - }
17 -
18 - required init(coder aDecoder: NSCoder) {
19 - super.init(coder: aDecoder)!
20 - sharedInit()
21 - }
22 -
23 - func sharedInit() {
24 - isUserInteractionEnabled = true
25 - addGestureRecognizer(UILongPressGestureRecognizer(target: self, action: #selector(showMenu(sender:))))
26 - }
27 -
28 - @objc
29 - func showMenu(sender: AnyObject?) {
30 - becomeFirstResponder()
31 - let menu = UIMenuController.shared
32 - if !menu.isMenuVisible {
33 - menu.setTargetRect(bounds, in: self)
34 - menu.setMenuVisible(true, animated: true)
35 - }
36 - }
37 -
38 - override var canBecomeFirstResponder: Bool {
39 - return true
40 - }
41 -
42 - override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool {
43 - if action == #selector(UIResponderStandardEditActions.copy(_:)) {
44 - return true
45 - }
46 - return false
47 - }
48 -
49 - override func copy(_ sender: Any?) {
50 - let board = UIPasteboard.general
51 - if var textToCopy = text {
52 - if (textToCopy.contains(", ")) {
53 - textToCopy = textToCopy.replacingOccurrences(of: ", ", with: "")
54 - }
55 - print(textToCopy)
56 - board.string = textToCopy
57 - }
58 -
59 -// board.string = text
60 - let menu = UIMenuController.shared
61 - menu.setMenuVisible(false, animated: true)
62 - }
63 -
64 -}
1 -//
2 -// CouponBarcodeViewController.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 20/5/22.
6 -//
7 -
8 -import UIKit
9 -import RSBarcodes_Swift
10 -import AVFoundation
11 -// import SwiftEventBus
12 -
13 -@objc public class CouponBarcodeViewController: UIViewController, UITextViewDelegate {
14 - @IBOutlet weak var mainView: UIView!
15 - @IBOutlet weak var backgroundImage: UIImageView!
16 - @IBOutlet weak var scrollView: UIScrollView!
17 - @IBOutlet weak var scrollContentView: UIView!
18 - @IBOutlet weak var couponImage: UIImageView!
19 - @IBOutlet weak var couponImageHeight: NSLayoutConstraint!
20 - @IBOutlet weak var nameLabel: UILabel!
21 - @IBOutlet weak var discriptionLabel: UILabel!
22 - @IBOutlet weak var merchantDescrTextView: UnselectableTappableTextView!
23 - @IBOutlet weak var merchantDescrTextViewHeight: NSLayoutConstraint!
24 - @IBOutlet weak var merchantDescrTextViewTopSpace: NSLayoutConstraint!
25 - @IBOutlet weak var couponCodeLabel: UILabel!
26 - @IBOutlet weak var couponCodeLabelHeight: NSLayoutConstraint!
27 - @IBOutlet weak var couponView: UIView!
28 - @IBOutlet weak var couponViewTopSpace: NSLayoutConstraint!
29 - @IBOutlet weak var couponViewHeight: NSLayoutConstraint!
30 - @IBOutlet weak var couponNumberLabel: CopyableLabel!
31 - @IBOutlet weak var barcodeImage: UIImageView!
32 - @IBOutlet weak var barcodeImageHeight: NSLayoutConstraint!
33 - @IBOutlet weak var barcodeLabel: UILabel!
34 - @IBOutlet weak var barcodeLabelHeight: NSLayoutConstraint!
35 - @IBOutlet weak var showBarcodeButton: UIButton!
36 - @IBOutlet weak var expirationLabel: UILabel!
37 - @IBOutlet weak var expirationLabelHeight: NSLayoutConstraint!
38 - @IBOutlet weak var redeemButton: UIButton!
39 - @IBOutlet weak var redeemButtonHeight: NSLayoutConstraint!
40 - @IBOutlet weak var redeemButtonTopSpace: NSLayoutConstraint!
41 - @IBOutlet weak var termsButton: UIButton!
42 - @IBOutlet weak var termsTextView: UnselectableTappableTextView!
43 - @IBOutlet weak var termsTextViewHeight: NSLayoutConstraint!
44 - @IBOutlet weak var borderViewHeight: NSLayoutConstraint!
45 - @IBOutlet weak var borderView2Height: NSLayoutConstraint!
46 - @IBOutlet weak var border1TopSpace: NSLayoutConstraint!
47 - @IBOutlet weak var barcodeImageTopSpace: NSLayoutConstraint!
48 - @IBOutlet weak var barcodeLabelTopSpace: NSLayoutConstraint!
49 - @IBOutlet weak var border2TopSpace: NSLayoutConstraint!
50 - @IBOutlet weak var mapButton: UIButton!
51 - @IBOutlet weak var topBorderLine: UIImageView!
52 - @IBOutlet weak var mapButtonHeight: NSLayoutConstraint!
53 - @IBOutlet weak var mapButtonTopSpace: NSLayoutConstraint!
54 - @IBOutlet weak var showBarcodeButtonHeight: NSLayoutConstraint!
55 - @IBOutlet weak var showBarcodeButtonTopSpace: NSLayoutConstraint!
56 - @IBOutlet weak var couponCodeLabelTopSpace: NSLayoutConstraint!
57 - @IBOutlet weak var discountView: UIView!
58 - @IBOutlet weak var discountLabel: UILabel!
59 - @IBOutlet weak var topExpirationView: UIView!
60 - @IBOutlet weak var topExpirationViewHeight: NSLayoutConstraint!
61 - @IBOutlet weak var topExpirationViewTopSpace: NSLayoutConstraint!
62 - @IBOutlet weak var topExpirationLabel: UILabel!
63 - @IBOutlet weak var barcodeTitleLabel: UILabel!
64 - @IBOutlet weak var barcodeTitleLabelHeight: NSLayoutConstraint!
65 - @IBOutlet weak var barcodeTitleLabelTopSpace: NSLayoutConstraint!
66 -
67 - let uiscreen: CGRect = UIScreen.main.bounds
68 -
69 - var termsVisible: Bool = false;
70 - var barcodeVisible: Bool = false;
71 -
72 - var mapBtnVisible: Bool = false;
73 - var eshopBtnVisible: Bool = false;
74 - var eshopWebsite: String = "";
75 -
76 - public var coupon: swiftApi.CouponItemModel?
77 - public var isFromWallet: Bool? = false
78 - public var isMarket: Bool? = false
79 - public var isSMCoupon: Bool? = false
80 -
81 - let smCouponsetsList = swiftApi().getCouponSetsDealsList()
82 -
83 - public override func viewDidLoad() {
84 - super.viewDidLoad()
85 -
86 - self.hidesBottomBarWhenPushed = true
87 - merchantDescrTextView.delegate = self
88 - termsTextView.delegate = self
89 -
90 - // Do any additional setup after loading the view.
91 - setBackButton()
92 - setNavigationTitle("Εκπτωτικό κουπόνι")
93 -
94 - // backgroundImage.image = UIImage(named: "coupons_scrollview_white", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil)
95 - backgroundImage.image = UIImage(named: "coupons_scrollview_white", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
96 -
97 -// scrollView.clipsToBounds = true
98 -// scrollView.layer.cornerRadius = 30
99 -// scrollView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
100 -
101 -// let image = UIImage(named: "top_border_line", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)!
102 -// var aspectR: CGFloat = 0.0
103 -//
104 -// aspectR = image.size.width/image.size.height
105 -//
106 -// topBorderLine.translatesAutoresizingMaskIntoConstraints = false
107 -// topBorderLine.image = image
108 -// topBorderLine.contentMode = .scaleAspectFill
109 -//
110 -// NSLayoutConstraint.activate([
111 -// topBorderLine.topAnchor.constraint(equalTo: mainView.topAnchor, constant: 0),
112 -// topBorderLine.leadingAnchor.constraint(equalTo: mainView.leadingAnchor, constant: 0),
113 -// topBorderLine.trailingAnchor.constraint(equalTo: mainView.trailingAnchor, constant: 0),
114 -// topBorderLine.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.width),
115 -// topBorderLine.heightAnchor.constraint(equalTo: topBorderLine.widthAnchor, multiplier: 1/aspectR)
116 -// ])
117 -
118 - // COUPONSET: description, img_preview, name, terms
119 - // COUPON: coupon, expiration, discount, status
120 -
121 - // OLD COUPON KEYS: coupon, expiration, discount, status
122 - // NEW COUPON KEYS (from couponset): inner_text, merchant_uuid
123 - // MISSING KEYS (from couponset): img_preview, name, short_description, terms
124 -
125 -// let couponSetData: swiftApi.CouponSetItemModel? = coupon?.couponset_data
126 - var couponSetData: swiftApi.CouponSetItemModel?
127 - if (isMarket == true || isSMCoupon == true) {
128 - for item in smCouponsetsList {
129 - if (item.uuid == coupon?.couponset_uuid) {
130 - couponSetData = item
131 - break;
132 - }
133 - }
134 -
135 - } else {
136 - couponSetData = coupon?.couponset_data
137 - }
138 -
139 - if (isMarket == true || isSMCoupon == true) {
140 -// couponImage.load(link: coupon?.image ?? "", placeholder: UIImage(), cache: URLCache())
141 - couponImage.load(link: couponSetData?.img?[0] ?? "", placeholder: UIImage(), cache: URLCache())
142 - } else {
143 - couponImage.load(link: couponSetData?.img_preview ?? "", placeholder: UIImage(), cache: URLCache())
144 - }
145 -
146 - couponImageHeight.constant = 222 // 255 //230 // 253 // self.uiscreen.height * 0.25
147 -
148 - discountView.backgroundColor = UIColor(rgb: 0xB8E0EF)
149 - discountView.layer.cornerRadius = 16.0
150 - discountView.layer.maskedCorners = [ .layerMinXMinYCorner, .layerMaxXMaxYCorner] // Top left, bottom right corner radius
151 - discountLabel.font = UIFont(name: "BTCosmo-Bold", size: 27)
152 - discountLabel.textColor = UIColor(rgb: 0x004B87)
153 -
154 - var discount = ""
155 - if (couponSetData?.discount_type == "value") {
156 - discount = ("-" + (coupon?.discount ?? "") + "€")
157 - } else if (couponSetData?.discount_type == "percentage") {
158 - discount = ("-" + (coupon?.discount ?? "") + "%")
159 - } else if (couponSetData?.discount_type == "plus_one") {
160 - discount = "1+1"
161 - } else {
162 - discount = ("-" + (coupon?.discount ?? "") + "€")
163 - }
164 - discountLabel.text = discount
165 -
166 - topExpirationView.backgroundColor = UIColor(rgb: 0xB8E0EF)
167 - topExpirationView.layer.cornerRadius = 13.0
168 - topExpirationLabel.text = "Ισχύει έως " + (coupon?.expiration ?? "")
169 - topExpirationLabel.font = UIFont(name: "PeridotPE-Bold", size: 13)
170 - topExpirationLabel.textColor = UIColor(rgb: 0x004B87)
171 - topExpirationLabel.frame.size.width = topExpirationLabel.intrinsicContentSize.width
172 -
173 - barcodeTitleLabel.text = "barcode κουπονιού"
174 - barcodeTitleLabel.font = UIFont(name: "PeridotPE-Bold", size: 16)
175 - barcodeTitleLabel.textColor = UIColor(rgb: 0x212121)
176 -
177 - if (isSMCoupon == true) {
178 - discountView.isHidden = false
179 - topExpirationView.isHidden = false
180 - topExpirationViewHeight.constant = topExpirationLabel.intrinsicContentSize.height + 8
181 - topExpirationViewTopSpace.constant = CGFloat(8)
182 - expirationLabel.isHidden = true
183 - expirationLabel.isHidden = true
184 - expirationLabelHeight.constant = CGFloat(0)
185 - barcodeTitleLabel.isHidden = false
186 - barcodeTitleLabelHeight.constant = barcodeTitleLabel.intrinsicContentSize.height
187 - barcodeTitleLabelTopSpace.constant = CGFloat(20)
188 - } else {
189 - if (isMarket == true) {
190 - discountView.isHidden = false
191 - } else {
192 - discountView.isHidden = true
193 - }
194 - topExpirationView.isHidden = true
195 - topExpirationViewHeight.constant = CGFloat(0)
196 - topExpirationViewTopSpace.constant = CGFloat(0)
197 - expirationLabel.isHidden = false
198 - expirationLabelHeight.constant = expirationLabel.intrinsicContentSize.height
199 - barcodeTitleLabel.isHidden = true
200 - barcodeTitleLabelHeight.constant = CGFloat(0)
201 - barcodeTitleLabelTopSpace.constant = CGFloat(0)
202 - }
203 -
204 - if (isMarket == true) {
205 - couponImage.contentMode = .scaleAspectFit
206 -
207 -// nameLabel.text = coupon?.name ?? ""
208 - nameLabel.text = couponSetData?.name ?? ""
209 -// discriptionLabel.text = coupon?.short_description ?? ""
210 -
211 -// let htmlName = coupon?.inner_text ?? ""
212 - let htmlDiscription = coupon?.description ?? ""
213 -
214 -// nameLabel.text = htmlName.htmlToString
215 - discriptionLabel.text = htmlDiscription.htmlToString
216 -
217 - } else if (isSMCoupon == true) {
218 - couponImage.contentMode = .scaleAspectFit
219 - nameLabel.text = couponSetData?.name ?? ""
220 - let htmlDiscription = couponSetData?.description ?? ""
221 - discriptionLabel.text = htmlDiscription.htmlToString
222 -
223 - } else {
224 - couponImage.contentMode = .scaleAspectFill
225 - nameLabel.text = couponSetData?.name ?? ""
226 - discriptionLabel.text = couponSetData?.short_description ?? ""
227 - }
228 -
229 - merchantDescrTextView.text = ""
230 - merchantDescrTextViewTopSpace.constant = CGFloat(0)
231 - merchantDescrTextViewHeight.constant = CGFloat(0)
232 - merchantDescrTextView.isHidden = true
233 - couponCodeLabelTopSpace.constant = CGFloat(35)
234 -
235 - let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList()
236 - var merchantUuid: String = ""
237 - // if (isMarket == true) {
238 - merchantUuid = coupon?.merchant_uuid ?? ""
239 - // } else {
240 - // merchantUuid = couponSetData?.merchant_uuid ?? ""
241 - // }
242 -
243 - // for merchant in merchantList {
244 - // if (merchant._uuid == merchantUuid) {
245 - // let htmlMerchDescrText = merchant._body
246 -
247 - let merchantDetails: swiftApi.MerchantModel? = coupon?.merchant_details
248 - let htmlMerchDescrText = merchantDetails?._body ?? ""
249 -
250 - if (isMarket != true && htmlMerchDescrText != "") {
251 - merchantDescrTextView.attributedText = htmlMerchDescrText.htmlToAttributedString
252 - merchantDescrTextView.font = UIFont(name: "PeridotPE-Regular", size: 16)
253 - merchantDescrTextView.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
254 - merchantDescrTextView.textAlignment = .center
255 - merchantDescrTextView.isScrollEnabled = false
256 - merchantDescrTextView.isUserInteractionEnabled = true
257 - merchantDescrTextView.isEditable = false
258 - merchantDescrTextView.isSelectable = true
259 - merchantDescrTextView.dataDetectorTypes = [.link]
260 -
261 - merchantDescrTextView.isHidden = false
262 - merchantDescrTextViewTopSpace.constant = CGFloat(10)
263 - let targetSize = CGSize(width: merchantDescrTextView.frame.width, height: CGFloat(MAXFLOAT))
264 - merchantDescrTextViewHeight.constant = merchantDescrTextView.sizeThatFits(targetSize).height
265 -
266 - couponCodeLabelTopSpace.constant = CGFloat(0)
267 - }
268 -
269 - // break;
270 - // }
271 - // }
272 -
273 - couponView.layer.cornerRadius = 16
274 - couponNumberLabel.text = coupon?.coupon ?? ""
275 - couponView.frame = CGRect(x: 0.0, y: 0.0, width: couponView.intrinsicContentSize.width, height: 55)
276 -
277 - if (isMarket == true) {
278 - couponCodeLabel.isHidden = true
279 - couponCodeLabelHeight.constant = CGFloat(0)
280 - couponCodeLabelTopSpace.constant = CGFloat(0)
281 -
282 - couponView.isHidden = true
283 - couponViewHeight.constant = CGFloat(0)
284 - couponViewTopSpace.constant = CGFloat(0)
285 -
286 - redeemButton.isHidden = true
287 - redeemButtonHeight.constant = CGFloat(0)
288 -// redeemButtonTopSpace.constant = CGFloat(0)
289 -
290 - } else {
291 - couponCodeLabel.isHidden = false
292 - couponCodeLabelHeight.constant = CGFloat(20)
293 - couponCodeLabelTopSpace.constant = CGFloat(35)
294 -
295 - couponView.isHidden = false
296 - couponViewHeight.constant = CGFloat(55)
297 - couponViewTopSpace.constant = CGFloat(20)
298 -
299 - redeemButton.isHidden = false
300 - redeemButtonHeight.constant = CGFloat(55)
301 -// redeemButtonTopSpace.constant = CGFloat(20)
302 - }
303 -
304 - let barcodeString = constructBarcode() ?? ""
305 - barcodeLabel.text = barcodeString
306 -
307 - if (isSMCoupon == true) {
308 - // Uncomment if Barcode Section is active again
309 - if let barcodeUIImage = RSUnifiedCodeGenerator.shared.generateCode(barcodeString, machineReadableCodeObjectType: AVMetadataObject.ObjectType.ean13.rawValue, targetSize: CGSize(width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.1)) {
310 - barcodeImage.image = barcodeUIImage
311 -
312 - barcodeImageHeight.constant = self.uiscreen.height * 0.1
313 -
314 -// showBarcodeButton.isHidden = false
315 -// showBarcodeButtonHeight.constant = 50
316 -// showBarcodeButtonTopSpace.constant = 10
317 -
318 - } else {
319 - barcodeImageHeight.constant = 0
320 -
321 -// showBarcodeButton.isHidden = true
322 -// showBarcodeButtonHeight.constant = 0
323 -// showBarcodeButtonTopSpace.constant = 0
324 - }
325 -
326 - // === Hide barcodeLabel
327 - barcodeLabel.isHidden = true
328 - barcodeLabelHeight.constant = CGFloat(0)
329 - barcodeLabelTopSpace.constant = CGFloat(0) // 10
330 - // === Hide Barcode Button
331 - showBarcodeButton.isHidden = true
332 - showBarcodeButtonHeight.constant = 0
333 - showBarcodeButtonTopSpace.constant = 0
334 - // ===
335 - border2TopSpace.constant = CGFloat(10)
336 -
337 - } else {
338 - // === Hide Barcode Section
339 - barcodeImage.isHidden = true
340 - barcodeImageHeight.constant = CGFloat(0)
341 - barcodeLabel.isHidden = true
342 - barcodeLabelHeight.constant = CGFloat(0)
343 -
344 - borderViewHeight.constant = CGFloat(0)
345 - borderView2Height.constant = CGFloat(0)
346 -
347 - border1TopSpace.constant = CGFloat(0) // 20
348 - barcodeImageTopSpace.constant = CGFloat(0) // 10
349 - barcodeLabelTopSpace.constant = CGFloat(0) // 10
350 - border2TopSpace.constant = CGFloat(0) // 15
351 -
352 - showBarcodeButton.isHidden = true
353 - showBarcodeButtonHeight.constant = 0
354 - showBarcodeButtonTopSpace.constant = 0
355 - // ===
356 - }
357 -
358 -// // Uncomment if Barcode Section is active again
359 -// if let barcodeUIImage = RSUnifiedCodeGenerator.shared.generateCode(barcodeString, machineReadableCodeObjectType: AVMetadataObject.ObjectType.ean13.rawValue, targetSize: CGSize(width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.1)) {
360 -// barcodeImage.image = barcodeUIImage
361 -//
362 -// barcodeImageHeight.constant = self.uiscreen.height * 0.1
363 -//
364 -// showBarcodeButton.isHidden = false
365 -// showBarcodeButtonHeight.constant = 50
366 -// showBarcodeButtonTopSpace.constant = 10
367 -//
368 -// } else {
369 -// barcodeImageHeight.constant = 0
370 -//
371 -// showBarcodeButton.isHidden = true
372 -// showBarcodeButtonHeight.constant = 0
373 -// showBarcodeButtonTopSpace.constant = 0
374 -// }
375 -
376 -// // === Hide Barcode Section
377 -// barcodeImage.isHidden = true
378 -// barcodeImageHeight.constant = CGFloat(0)
379 -// barcodeLabel.isHidden = true
380 -// barcodeLabelHeight.constant = CGFloat(0)
381 -//
382 -// borderViewHeight.constant = CGFloat(0)
383 -// borderView2Height.constant = CGFloat(0)
384 -//
385 -// border1TopSpace.constant = CGFloat(0) // 20
386 -// barcodeImageTopSpace.constant = CGFloat(0) // 10
387 -// barcodeLabelTopSpace.constant = CGFloat(0) // 10
388 -// border2TopSpace.constant = CGFloat(0) // 15
389 -//
390 -// showBarcodeButton.isHidden = true
391 -// showBarcodeButtonHeight.constant = 0
392 -// showBarcodeButtonTopSpace.constant = 0
393 -// // ===
394 -
395 - showBarcodeButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 16)
396 - showBarcodeButton.setTitle("Εμφάνιση barcode", for: .normal)
397 - showBarcodeButton.setTitleColor(UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00), for: .normal)
398 - showBarcodeButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
399 - showBarcodeButton.semanticContentAttribute = .forceRightToLeft
400 - showBarcodeButton.tintColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 1.00)
401 - showBarcodeButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0);
402 - showBarcodeButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 5);
403 - showBarcodeButton.imageView?.layer.transform = CATransform3DMakeScale(0.8, 0.8, 0.8)
404 -
405 - expirationLabel.text = "Το κουπόνι ισχύει έως " + (coupon?.expiration ?? "")
406 -
407 - if (isSMCoupon == true) {
408 - redeemButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 17)
409 - redeemButton.setTitle("Βρες το στα supermarket", for: .normal)
410 - redeemButton.setTitleColor(.white, for: .normal)
411 - redeemButton.backgroundColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00)
412 - redeemButton.layer.cornerRadius = 16.0
413 - redeemButton.frame = CGRect(x: 0.0, y: 0.0, width: 260, height: 55)
414 - // redeemButton.frame = CGRect(x: 0.0, y: 0.0, width: redeemButton.intrinsicContentSize.width, height: 55)
415 - // redeemButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 25, bottom: 0, right: 25)
416 - // Fix width for ipad
417 - // if UIDevice.current.userInterfaceIdiom == .pad {
418 - // // iPad
419 - // redeemButton.widthAnchor.constraint(equalToConstant: 250).isActive = true
420 - // } else {
421 - // // not iPad (iPhone, mac, tv, carPlay, unspecified)
422 - // redeemButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
423 - // }
424 -
425 - mapButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 17)
426 - mapButton.setTitle("Δώρισέ το", for: .normal)
427 - mapButton.setTitleColor(UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00), for: .normal)
428 - mapButton.layer.cornerRadius = 15.0
429 - mapButton.frame = CGRect(x: 0.0, y: 0.0, width: 260, height: 55)
430 - // mapButton.frame = CGRect(x: 0.0, y: 0.0, width: mapButton.intrinsicContentSize.width, height: 55)
431 - // mapButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 25, bottom: 0, right: 25)
432 - mapButton.backgroundColor = .clear
433 - mapButton.layer.borderWidth = 2
434 - mapButton.layer.borderColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00).cgColor
435 -
436 - } else {
437 - redeemButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 17)
438 - redeemButton.setTitle("Δώρισέ το", for: .normal)
439 - redeemButton.setTitleColor(.white, for: .normal)
440 - redeemButton.backgroundColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00)
441 - redeemButton.layer.cornerRadius = 16.0
442 - redeemButton.frame = CGRect(x: 0.0, y: 0.0, width: 260, height: 55)
443 - // redeemButton.frame = CGRect(x: 0.0, y: 0.0, width: redeemButton.intrinsicContentSize.width, height: 55)
444 - // redeemButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 25, bottom: 0, right: 25)
445 - // Fix width for ipad
446 - // if UIDevice.current.userInterfaceIdiom == .pad {
447 - // // iPad
448 - // redeemButton.widthAnchor.constraint(equalToConstant: 250).isActive = true
449 - // } else {
450 - // // not iPad (iPhone, mac, tv, carPlay, unspecified)
451 - // redeemButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
452 - // }
453 -
454 - mapButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 17)
455 - mapButton.setTitle("Δες τα καταστήματα", for: .normal)
456 - mapButton.setTitleColor(UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00), for: .normal)
457 - mapButton.layer.cornerRadius = 15.0
458 - mapButton.frame = CGRect(x: 0.0, y: 0.0, width: 260, height: 55)
459 - // mapButton.frame = CGRect(x: 0.0, y: 0.0, width: mapButton.intrinsicContentSize.width, height: 55)
460 - // mapButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 25, bottom: 0, right: 25)
461 - mapButton.backgroundColor = .clear
462 - mapButton.layer.borderWidth = 2
463 - mapButton.layer.borderColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00).cgColor
464 - }
465 -
466 -
467 - // mapButton.isHidden = true
468 - // mapButtonHeight.constant = 0
469 - // mapButtonTopSpace.constant = 0
470 -
471 - // let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList()
472 -
473 - // for merchant in merchantList {
474 - // if (merchant._uuid == couponSetData?.merchant_uuid) {
475 - // if (merchant._show_map == true) {
476 - // mapButton.setTitle("Δες τα καταστήματα", for: .normal)
477 - // mapButton.frame = CGRect(x: 0.0, y: 0.0, width: mapButton.intrinsicContentSize.width, height: 44)
478 - // mapButton.contentEdgeInsets = UIEdgeInsets(top: 1, left: 16, bottom: 0, right: 16)
479 - // mapButton.isHidden = false
480 - // mapBtnVisible = true
481 - // eshopBtnVisible = false
482 - // mapButtonHeight.constant = 44
483 - // mapButtonTopSpace.constant = 10
484 - // } else if (merchant._eshop == true) {
485 - // mapButton.setTitle("Δες το eshop", for: .normal)
486 - // mapButton.frame = CGRect(x: 0.0, y: 0.0, width: mapButton.intrinsicContentSize.width, height: 44)
487 - // mapButton.contentEdgeInsets = UIEdgeInsets(top: 1, left: 16, bottom: 0, right: 16)
488 - // mapButton.isHidden = false
489 - // mapBtnVisible = false
490 - // eshopBtnVisible = true
491 - // mapButtonHeight.constant = 44
492 - // mapButtonTopSpace.constant = 10
493 - // } else {
494 - // mapButton.isHidden = true
495 - // mapBtnVisible = false
496 - // eshopBtnVisible = false
497 - // mapButtonHeight.constant = 0
498 - // mapButtonTopSpace.constant = 0
499 - // }
500 - // eshopWebsite = merchant._website
501 - // break;
502 - // }
503 - // }
504 -
505 - // Fix width for ipad
506 -// if UIDevice.current.userInterfaceIdiom == .pad {
507 -// // iPad
508 -// mapButton.widthAnchor.constraint(equalToConstant: 250).isActive = true
509 -// } else {
510 -// // not iPad (iPhone, mac, tv, carPlay, unspecified)
511 -// mapButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
512 -// }
513 -
514 - termsButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 15)
515 -// termsButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
516 - termsButton.setTitle("Όροι χρήσης", for: .normal)
517 - termsButton.setTitleColor(UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00), for: .normal)
518 - termsButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
519 - termsButton.semanticContentAttribute = .forceRightToLeft
520 - termsButton.tintColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 1.00)
521 - termsButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0);
522 - termsButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 5);
523 - termsButton.imageView?.layer.transform = CATransform3DMakeScale(0.8, 0.8, 0.8)
524 -
525 - var htmlText = ""
526 - if (isMarket == true) {
527 - htmlText = coupon?.terms ?? ""
528 - } else {
529 - htmlText = couponSetData?.terms ?? ""
530 - }
531 -
532 - termsTextView.attributedText = htmlText.htmlToAttributedString
533 - termsTextView.font = UIFont(name: "PeridotPE-Regular", size: 14)
534 - termsTextView.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
535 - termsTextView.textAlignment = .left
536 - termsTextView.isScrollEnabled = false
537 -
538 - termsTextView.isUserInteractionEnabled = true
539 - termsTextView.isEditable = false
540 - termsTextView.isSelectable = true
541 - termsTextView.dataDetectorTypes = [.link]
542 -
543 - toggleTerms()
544 - // Uncomment if Barcode Section is active again
545 -// if (isMarket == false) {
546 -// toggleBarcode()
547 -// }
548 -
549 - // Logs
550 - print("Coupon: " + (coupon?.coupon ?? ""))
551 - print("Coupon Name: " + (couponSetData?.name ?? ""))
552 - print("Coupon Description: " + (couponSetData?.short_description ?? ""))
553 - print("Coupon Expiration: " + (coupon?.expiration ?? ""))
554 -
555 - }
556 -
557 - public override func viewWillAppear(_ animated: Bool) {
558 - super.viewWillAppear(animated)
559 -
560 - swiftApi().logTrackersEvent("screen", "CouponScreen")
561 -
562 - self.navigationController?.hideHairline()
563 - }
564 -
565 - public func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
566 - UIApplication.shared.open(URL)
567 -
568 - // Disable `.preview` by 3D Touch and other interactions
569 - return false
570 - }
571 -
572 -
573 - // MARK: - Functions
574 - func toggleTerms() {
575 - if (termsVisible) {
576 - termsTextView.isHidden = false
577 - let targetSize = CGSize(width: termsTextView.frame.width, height: CGFloat(MAXFLOAT))
578 - termsTextViewHeight.constant = termsTextView.sizeThatFits(targetSize).height
579 -
580 - termsButton.setImage(UIImage(named: "ic_up_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
581 - } else {
582 - termsTextView.isHidden = true
583 - termsTextViewHeight.constant = CGFloat(0)
584 -
585 - termsButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
586 - }
587 - }
588 -
589 - func toggleBarcode() {
590 - if (barcodeVisible) {
591 - barcodeImage.isHidden = false
592 - if (barcodeImage.image == nil) {
593 - barcodeImageHeight.constant = CGFloat(0)
594 - } else {
595 - barcodeImageHeight.constant = self.uiscreen.height * 0.1
596 - }
597 - barcodeLabel.isHidden = false
598 - let targetSize = CGSize(width: barcodeLabel.frame.width, height: CGFloat(MAXFLOAT))
599 - barcodeLabelHeight.constant = barcodeLabel.sizeThatFits(targetSize).height
600 -
601 - borderViewHeight.constant = CGFloat(1)
602 - borderView2Height.constant = CGFloat(1)
603 -
604 - border1TopSpace.constant = CGFloat(20) // 20
605 - barcodeImageTopSpace.constant = CGFloat(10) // 10
606 - barcodeLabelTopSpace.constant = CGFloat(10) // 10
607 - border2TopSpace.constant = CGFloat(15) // 15
608 -
609 - showBarcodeButton.setTitle("Απόκρυψη barcode", for: .normal)
610 - showBarcodeButton.setImage(UIImage(named: "ic_up_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
611 -
612 - } else {
613 - barcodeImage.isHidden = true
614 - barcodeImageHeight.constant = CGFloat(0)
615 - barcodeLabel.isHidden = true
616 - barcodeLabelHeight.constant = CGFloat(0)
617 -
618 - borderViewHeight.constant = CGFloat(0)
619 - borderView2Height.constant = CGFloat(0)
620 -
621 - border1TopSpace.constant = CGFloat(0) // 20
622 - barcodeImageTopSpace.constant = CGFloat(0) // 10
623 - barcodeLabelTopSpace.constant = CGFloat(0) // 10
624 - border2TopSpace.constant = CGFloat(0) // 15
625 -
626 - showBarcodeButton.setTitle("Εμφάνιση barcode", for: .normal)
627 - showBarcodeButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
628 - }
629 - }
630 -
631 - func constructBarcode() -> String? {
632 - // EAN 13 barcode construction
633 - let couponData = coupon?.couponset_data
634 - let couponString = coupon?.coupon ?? ""
635 -
636 - if (!couponString.isEmpty) {
637 - var checkDigit = 0;
638 - var result = 0;
639 -
640 - var fixedCouponCode = couponString;
641 -
642 - if (fixedCouponCode.count == 13) {
643 - return fixedCouponCode;
644 - }
645 -
646 - if (fixedCouponCode.count < 12) {
647 - let loops = 12 - fixedCouponCode.count;
648 - var zerosStr = "";
649 - for i in 0 ..< loops {
650 - zerosStr += "0"
651 - }
652 - // fixedCouponCode = zerosStr + fixedCouponCode;
653 - fixedCouponCode = fixedCouponCode + zerosStr;
654 - }
655 -
656 - var multiplier = 3;
657 - for idx in (0 ... (fixedCouponCode.count - 1)).reversed() {
658 - let curChar = fixedCouponCode[idx];
659 - result += (Int(curChar) ?? 0) * multiplier;
660 - multiplier = multiplier == 3 ? 1 : 3;
661 - }
662 - checkDigit = 10 - (result % 10);
663 -
664 - let barcodeStr = fixedCouponCode + String(checkDigit);
665 - return barcodeStr;
666 - }
667 -
668 - return ""
669 - }
670 -
671 - func showDialog(_ alertTitle: String, _ alertSubTitle: String) -> Void {
672 -
673 - let alert = UIAlertController(title: alertTitle, message: alertSubTitle, preferredStyle: .alert)
674 - alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
675 - switch action.style{
676 - case .default:
677 - print("default")
678 -
679 - case .cancel:
680 - print("cancel")
681 -
682 - case .destructive:
683 - print("destructive")
684 -
685 - }
686 - }))
687 - self.present(alert, animated: true, completion: nil)
688 - }
689 -
690 - // MARK: - Actions
691 -
692 - @IBAction func redeemButtomAction(_ sender: Any) {
693 - if (isSMCoupon == true) {
694 - var availableShopsList:Array<swiftApi.ShopAvailabilityItemModel> = []
695 - let smCouponsetsList = swiftApi().getCouponSetsDealsList()
696 - let couponsetUuid = coupon?.couponset_uuid
697 - for couponset in smCouponsetsList {
698 - if (couponset.uuid == couponsetUuid) {
699 - availableShopsList = couponset.shop_availability ?? []
700 - break;
701 - }
702 - }
703 -
704 - if (availableShopsList.count > 0) {
705 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
706 - if let popupVC = storyboard.instantiateViewController(withIdentifier: "PopupMerchantsViewController") as? SwiftWarplyFramework.PopupMerchantsViewController {
707 - popupVC.modalPresentationStyle = .overCurrentContext
708 - popupVC.modalTransitionStyle = .crossDissolve
709 - popupVC.availableShopsList = availableShopsList
710 - // popupVC.headerText = "Βρες το προϊον στα supermarket"
711 - // popupVC.buttonTitle = "Βρες το"
712 - popupVC.buttonIcon = "shopping_cart"
713 - // popupVC.footerText = "Η διαθεσιμότητα ενδέχεται να διαφέρει ανάλογα με την τοποθεσία."
714 -
715 - self.present(popupVC, animated: true, completion: nil)
716 - }
717 -
718 - } else {
719 - self.showDialog("Δεν υπάρχουν διαθέσιμα supermarkets","")
720 - }
721 -
722 - } else {
723 - let couponSetData: swiftApi.CouponSetItemModel? = self.coupon?.couponset_data
724 - let couponName = couponSetData?.name ?? ""
725 -
726 - swiftApi().logTrackersEvent("click", ("ShareCoupon:" + couponName))
727 -
728 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
729 - let vc = storyboard.instantiateViewController(withIdentifier: "ShareViewController") as! SwiftWarplyFramework.ShareViewController
730 - vc.coupon = self.coupon
731 - vc.isFromWallet = self.isFromWallet
732 - self.navigationController?.pushViewController(vc, animated: true)
733 - }
734 - }
735 -
736 - @IBAction func showBarcodeAction(_ sender: Any) {
737 - barcodeVisible = !barcodeVisible
738 - toggleBarcode()
739 - }
740 -
741 - @IBAction func termsButtonAction(_ sender: Any) {
742 - termsVisible = !termsVisible
743 - toggleTerms()
744 - }
745 -
746 - @IBAction func mapButtonAction(_ sender: Any) {
747 - if (isSMCoupon == true) {
748 - let couponSetData: swiftApi.CouponSetItemModel? = self.coupon?.couponset_data
749 - let couponName = couponSetData?.name ?? ""
750 -
751 - swiftApi().logTrackersEvent("click", ("ShareCoupon:" + couponName))
752 -
753 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
754 - let vc = storyboard.instantiateViewController(withIdentifier: "ShareViewController") as! SwiftWarplyFramework.ShareViewController
755 - vc.coupon = self.coupon
756 - vc.isFromWallet = self.isFromWallet
757 - self.navigationController?.pushViewController(vc, animated: true)
758 -
759 - } else {
760 - swiftApi().logTrackersEvent("click", "SeeShops")
761 -
762 - let vc = SwiftWarplyFramework.MapsViewController(nibName: "MapsViewController", bundle: Bundle(for: MyEmptyClass.self))
763 - if (isMarket == true) {
764 - vc.isMarket = true
765 - } else {
766 - vc.coupon = coupon
767 - }
768 -
769 - self.navigationController?.pushViewController(vc, animated: true)
770 - }
771 -
772 - // if (mapBtnVisible == true) {
773 - // swiftApi().logTrackersEvent("click", "SeeShops")
774 -
775 - // let vc = SwiftWarplyFramework.MapsViewController(nibName: "MapsViewController", bundle: Bundle(for: MyEmptyClass.self))
776 - // vc.couponSet = coupon?.couponset_data
777 - // self.navigationController?.pushViewController(vc, animated: true)
778 -
779 - // } else if (eshopBtnVisible == true) {
780 - // if (eshopWebsite != "") {
781 - // guard let websiteUrl = URL(string: eshopWebsite) else {
782 - // print("Error creating URL")
783 - // return
784 - // }
785 -
786 - // // check if link can be opened.
787 - // guard UIApplication.shared.canOpenURL(websiteUrl) else {
788 - // return
789 - // }
790 -
791 - // swiftApi().logTrackersEvent("click", "SeeShopWebsite")
792 - // UIApplication.shared.open(websiteUrl, options: [:], completionHandler: nil)
793 - // }
794 - // }
795 - }
796 -}
1 -//
2 -// CouponViewController.swift
3 -// WarplySDKFrameworkIOS
4 -//
5 -// Created by Manos Chorianopoulos on 5/5/22.
6 -//
7 -
8 -import UIKit
9 -import SwiftEventBus
10 -
11 -@objc public class CouponViewController: UIViewController, UITextViewDelegate {
12 - @IBOutlet weak var mainView: UIView!
13 - @IBOutlet weak var backgroundImage: UIImageView!
14 - @IBOutlet weak var scrollView: UIScrollView!
15 - @IBOutlet weak var scrollContentView: UIView!
16 - @IBOutlet weak var couponImage: UIImageView!
17 - @IBOutlet weak var couponImageHeight: NSLayoutConstraint!
18 - @IBOutlet weak var nameLabel: UILabel!
19 - @IBOutlet weak var descriptionTextView: UnselectableTappableTextView!
20 - @IBOutlet weak var descriptionTextViewHeight: NSLayoutConstraint!
21 - @IBOutlet weak var redeemButton: UIButton!
22 - @IBOutlet weak var termsButton: UIButton!
23 - @IBOutlet weak var termsTextView: UnselectableTappableTextView!
24 - @IBOutlet weak var termsTextViewHeight: NSLayoutConstraint!
25 - @IBOutlet weak var topBorderLine: UIImageView!
26 -
27 - public var ccms: swiftApi.LoyaltyContextualOfferModel?
28 - public var profile:swiftApi.ProfileModel? = swiftApi().getConsumer()
29 -
30 - let uiscreen: CGRect = UIScreen.main.bounds
31 -
32 - var termsVisible: Bool = false;
33 -
34 - public var couponset: swiftApi.CouponSetItemModel?
35 - public var campaign: swiftApi.CampaignItemModel?
36 -
37 - let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList()
38 -
39 - let spinner = SpinnerViewController()
40 -
41 - public override func viewDidLoad() {
42 - super.viewDidLoad()
43 -
44 - self.hidesBottomBarWhenPushed = true
45 - descriptionTextView.delegate = self
46 - termsTextView.delegate = self
47 -
48 - // Do any additional setup after loading the view.
49 - setBackButton()
50 - setNavigationTitle("Εκπτωτικό κουπόνι")
51 -
52 - // if ((profile != nil) && (profile?._nonTelco == true)) {
53 - if (swiftApi().getUserNonTelco() == true) {
54 - nonTelcoDialog("Αδυναμία ενεργοποίησης", "Πρόσθεσε σύνδεση COSMOTE σταθερής, κινητής ή TV για να έχεις πρόσβαση στις προσφορές.");
55 - }
56 -
57 - backgroundImage.image = UIImage(named: "coupons_scrollview_white", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
58 -
59 -// scrollView.clipsToBounds = true
60 -// scrollView.layer.cornerRadius = 30
61 -// scrollView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
62 -
63 -// let image = UIImage(named: "top_border_line", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)!
64 -// var aspectR: CGFloat = 0.0
65 -//
66 -// aspectR = image.size.width/image.size.height
67 -//
68 -// topBorderLine.translatesAutoresizingMaskIntoConstraints = false
69 -// topBorderLine.image = image
70 -// topBorderLine.contentMode = .scaleAspectFill
71 -//
72 -// NSLayoutConstraint.activate([
73 -// topBorderLine.topAnchor.constraint(equalTo: mainView.topAnchor, constant: 0),
74 -// topBorderLine.leadingAnchor.constraint(equalTo: mainView.leadingAnchor, constant: 0),
75 -// topBorderLine.trailingAnchor.constraint(equalTo: mainView.trailingAnchor, constant: 0),
76 -// topBorderLine.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.width),
77 -// topBorderLine.heightAnchor.constraint(equalTo: topBorderLine.widthAnchor, multiplier: 1/aspectR)
78 -// ])
79 -
80 - couponImage.load(link: couponset?.img_preview ?? "", placeholder: UIImage(), cache: URLCache())
81 - couponImage.contentMode = .scaleAspectFill
82 - couponImageHeight.constant = 222 // 255 //230 // 253 // self.uiscreen.height * 0.25
83 -
84 - nameLabel.text = couponset?.name ?? ""
85 - let htmlDescrText = couponset?.description ?? ""
86 -
87 - descriptionTextView.attributedText = htmlDescrText.htmlToAttributedString
88 - descriptionTextView.font = UIFont(name: "PeridotPE-Regular", size: 16)
89 - descriptionTextView.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
90 - descriptionTextView.textAlignment = .center
91 - descriptionTextView.isScrollEnabled = false
92 - descriptionTextView.isUserInteractionEnabled = true
93 - descriptionTextView.isEditable = false
94 - descriptionTextView.isSelectable = true
95 - descriptionTextView.dataDetectorTypes = [.link]
96 -
97 - let targetSize = CGSize(width: descriptionTextView.frame.width, height: CGFloat(MAXFLOAT))
98 - descriptionTextViewHeight.constant = descriptionTextView.sizeThatFits(targetSize).height
99 -
100 - redeemButton.setTitle("Απόκτησέ το δωρεάν", for: .normal)
101 - redeemButton.setTitleColor(.white, for: .normal)
102 - redeemButton.backgroundColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00)
103 - redeemButton.layer.cornerRadius = 16.0
104 -// redeemButton.frame = CGRect(x: 0.0, y: 0.0, width: redeemButton.intrinsicContentSize.width, height: 50)
105 - redeemButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 25, bottom: 0, right: 25)
106 - // Fix width for ipad
107 - if UIDevice.current.userInterfaceIdiom == .pad {
108 - // iPad
109 - redeemButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 19)
110 -// redeemButton.widthAnchor.constraint(equalToConstant: 250).isActive = true
111 - } else {
112 - // not iPad (iPhone, mac, tv, carPlay, unspecified)
113 - redeemButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 17)
114 -// redeemButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
115 - }
116 -
117 - termsButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 15)
118 -// termsButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
119 - termsButton.setTitle("Όροι χρήσης", for: .normal)
120 - termsButton.setTitleColor(UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00), for: .normal)
121 - termsButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
122 - termsButton.semanticContentAttribute = .forceRightToLeft
123 - termsButton.tintColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 1.00)
124 - termsButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0);
125 - termsButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 5);
126 - termsButton.imageView?.layer.transform = CATransform3DMakeScale(0.8, 0.8, 0.8)
127 -
128 - let htmlText = couponset?.terms ?? ""
129 - termsTextView.attributedText = htmlText.htmlToAttributedString
130 - termsTextView.font = UIFont(name: "PeridotPE-Regular", size: 14)
131 - termsTextView.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
132 - termsTextView.textAlignment = .left
133 - termsTextView.isScrollEnabled = false
134 - termsTextView.isUserInteractionEnabled = true
135 - termsTextView.isEditable = false
136 - termsTextView.isSelectable = true
137 - termsTextView.dataDetectorTypes = [.link]
138 -
139 - toggleTerms()
140 -
141 - }
142 -
143 - public override func viewWillAppear(_ animated: Bool) {
144 - super.viewWillAppear(animated)
145 -
146 - swiftApi().logTrackersEvent("screen", "CouponsetScreen")
147 -
148 - self.navigationController?.hideHairline()
149 - }
150 -
151 - public func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
152 - UIApplication.shared.open(URL)
153 -
154 - // Disable `.preview` by 3D Touch and other interactions
155 - return false
156 - }
157 -
158 - // MARK: - Functions
159 - func nonTelcoDialog(_ alertTitle: String, _ alertSubTitle: String) -> Void {
160 -
161 - let alert = UIAlertController(title: alertTitle, message: alertSubTitle, preferredStyle: .alert)
162 - alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
163 - switch action.style{
164 - case .default:
165 - self.navigationController?.popViewController(animated: true)
166 - // self.dismiss(animated: true, completion: {})
167 -
168 - case .cancel:
169 - print("cancel")
170 -
171 - case .destructive:
172 - print("destructive")
173 -
174 - }
175 - }))
176 - self.present(alert, animated: true, completion: nil)
177 - }
178 -
179 - func toggleTerms() {
180 - if (termsVisible) {
181 - termsTextView.isHidden = false
182 - let targetSize = CGSize(width: termsTextView.frame.width, height: CGFloat(MAXFLOAT))
183 - termsTextViewHeight.constant = termsTextView.sizeThatFits(targetSize).height
184 -
185 - termsButton.setImage(UIImage(named: "ic_up_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
186 - } else {
187 - termsTextView.isHidden = true
188 - termsTextViewHeight.constant = CGFloat(0)
189 -
190 - termsButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
191 - }
192 - }
193 -
194 - func showSpinner() {
195 - // add the spinner view controller
196 - // addChild(spinner)
197 - // spinner.view.frame = view.frame
198 - // view.addSubview(spinner.view)
199 - // spinner.didMove(toParent: self)
200 -
201 - addChild(spinner)
202 - spinner.view.frame = CGRect(x: 0, y: 0, width: self.view.frame.width, height: self.view.frame.height)
203 - self.view.addSubview(spinner.view)
204 - spinner.didMove(toParent: self)
205 - }
206 -
207 - func hideSpinner() {
208 - // remove the spinner view controller
209 - spinner.willMove(toParent: nil)
210 - spinner.view.removeFromSuperview()
211 - spinner.removeFromParent()
212 - }
213 -
214 - func redeemCouponSetRequest(uuid: String, communication_uuid: String) {
215 - showSpinner()
216 - redeemButton.isEnabled = false
217 -
218 - if (ccms == nil) {
219 - // swiftApi().redeemCouponSetAsync(uuid: uuid, communication_uuid: communication_uuid, redeemCouponSetCallback, failureCallback: {errorCode in
220 - swiftApi().redeemCouponSetAsyncInternal(uuid: uuid, communication_uuid: communication_uuid, redeemCouponSetCallback, failureCallback: {errorCode in
221 - self.hideSpinner()
222 - self.redeemButton.isEnabled = true
223 -
224 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
225 - firebaseEvent._eventName = "loyalty_offer_activated"
226 - firebaseEvent.setParameter = ("name", (self.couponset?.name ?? ""))
227 - firebaseEvent.setParameter = ("type", "coupon")
228 - firebaseEvent.setParameter = ("successful", "false")
229 - SwiftEventBus.post("firebase", sender: firebaseEvent)
230 -
231 - self.showDialog("Αποτυχία","Κάτι πήγε στραβά")
232 - })
233 - } else {
234 - // TODO: MAybe change user_msisdn: profile?._msisdn ?? ""
235 - // swiftApi().redeemCouponSetAsync(uuid: uuid, communication_uuid: communication_uuid, user_msisdn: profile?._msisdn ?? "", businessService: (ccms?._businessService ?? ""), offerName: (ccms?._offerName ?? ""), productType: (ccms?._productType ?? ""), provDuration: (ccms?._provDuration ?? ""), noOfRecurrance: (ccms?._noOfRecurrance ?? ""), price: (ccms?._price ?? ""), discount: (ccms?._discount ?? ""), voiceCategory: (ccms?._voiceCategory ?? ""), dataCategory: (ccms?._dataCategory ?? ""), minsValue: (ccms?._minsValue ?? ""), dataValue: (ccms?._dataValue ?? ""), provStepValueMins: (ccms?._provStepValueMins ?? ""), OfferAudienceLevel: (ccms?._offerAudienceLevel ?? ""), UACIOfferTrackingCode: (ccms?._uaciOfferTrackingCode ?? ""), OFFERCODE1: (ccms?._offerCode1 ?? ""), SCORE: (ccms?._score ?? ""), ZONE: (ccms?._zone ?? ""), WAVE: (ccms?._wave ?? ""), VALIDITY: (ccms?._validity ?? ""), TREATMENT_CODE: (ccms?._treatmentCode ?? ""), ccms_session_id: (ccms?._sessionId ?? ""), redeemCouponSetCallback, failureCallback: {errorCode in
236 - swiftApi().redeemCouponSetAsyncInternal(uuid: uuid, communication_uuid: communication_uuid, user_msisdn: profile?._msisdn ?? "", businessService: (ccms?._businessService ?? ""), offerName: (ccms?._offerName ?? ""), productType: (ccms?._productType ?? ""), provDuration: (ccms?._provDuration ?? ""), noOfRecurrance: (ccms?._noOfRecurrance ?? ""), price: (ccms?._price ?? ""), discount: (ccms?._discount ?? ""), voiceCategory: (ccms?._voiceCategory ?? ""), dataCategory: (ccms?._dataCategory ?? ""), minsValue: (ccms?._minsValue ?? ""), dataValue: (ccms?._dataValue ?? ""), provStepValueMins: (ccms?._provStepValueMins ?? ""), OfferAudienceLevel: (ccms?._offerAudienceLevel ?? ""), UACIOfferTrackingCode: (ccms?._uaciOfferTrackingCode ?? ""), OFFERCODE1: (ccms?._offerCode1 ?? ""), SCORE: (ccms?._score ?? ""), ZONE: (ccms?._zone ?? ""), WAVE: (ccms?._wave ?? ""), VALIDITY: (ccms?._validity ?? ""), TREATMENT_CODE: (ccms?._treatmentCode ?? ""), ccms_session_id: (ccms?._sessionId ?? ""), redeemCouponSetCallback, failureCallback: {errorCode in
237 - self.hideSpinner()
238 - self.redeemButton.isEnabled = true
239 -
240 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
241 - firebaseEvent._eventName = "loyalty_offer_activated"
242 - firebaseEvent.setParameter = ("name", (self.couponset?.name ?? ""))
243 - firebaseEvent.setParameter = ("type", "coupon")
244 - firebaseEvent.setParameter = ("successful", "false")
245 - SwiftEventBus.post("firebase", sender: firebaseEvent)
246 -
247 - self.showDialog("Αποτυχία","Κάτι πήγε στραβά")
248 - })
249 - }
250 - }
251 -
252 - // func redeemCouponSetCallback (_ response: swiftApi.GenericResponseModel?) -> Void {
253 - func redeemCouponSetCallback (_ response: swiftApi.RedeemCouponSetResponseModel?) -> Void {
254 - hideSpinner()
255 - self.redeemButton.isEnabled = true
256 -
257 - if (response != nil) {
258 - DispatchQueue.main.async {
259 - if (response?.getStatus == 1) {
260 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
261 - firebaseEvent._eventName = "loyalty_offer_activated"
262 - firebaseEvent.setParameter = ("name", (self.couponset?.name ?? ""))
263 - firebaseEvent.setParameter = ("type", "coupon")
264 - firebaseEvent.setParameter = ("successful", "true")
265 - SwiftEventBus.post("firebase", sender: firebaseEvent)
266 -
267 - if (self.ccms != nil) {
268 - let ccmsEnabled = swiftApi.WarplyCCMSEnabledModel()
269 - ccmsEnabled._isActivated = true
270 - SwiftEventBus.post("ccms_enabled", sender: ccmsEnabled)
271 - }
272 -
273 - self.showSuccessDialog("Επιτυχής ενεργοποίηση","Το κουπόνι σου έχει ενεργοποιηθεί και βρίσκεται στην ενότητα My Rewards.")
274 -
275 - /* OLD Addition start */
276 -// swiftApi().getCouponsAsync(getCouponsCallback, failureCallback: {errorCode in })
277 -// swiftApi().getCampaignsAsyncNew(language: "en", filters: [String : Any](), getCampaignsCallback, failureCallback: {errorCode in })
278 -//
279 -// func getCouponsCallback (_ couponsData: Array<swiftApi.CouponItemModel>?) -> Void {
280 -// if (couponsData != nil) {
281 -//
282 -// DispatchQueue.main.async {
283 -// SwiftEventBus.post("coupons_fetched")
284 -// }
285 -// } else {
286 -// }
287 -// }
288 -//
289 -// func getCampaignsCallback (_ campaignsData: Array<swiftApi.CampaignItemModel>?) -> Void {
290 -// if (campaignsData != nil) {
291 -// DispatchQueue.main.async {
292 -// SwiftEventBus.post("campaigns_retrieved")
293 -// }
294 -// } else {
295 -// }
296 -// }
297 - /* OLD Addition end */
298 -
299 - /* New Addition start */
300 - if let newCoupon = response?.getCoupon {
301 - newCoupon.status = 1
302 -
303 - if let couponsetData = self.couponset {
304 - newCoupon.setCouponSetData(couponsetData)
305 -
306 - for merchant in self.merchantList {
307 - if (merchant._uuid == couponsetData.merchant_uuid) {
308 - newCoupon.merchant_details = merchant
309 - break;
310 - }
311 - }
312 - }
313 -
314 - swiftApi().addCouponItem(newCoupon: newCoupon)
315 - SwiftEventBus.post("coupons_fetched")
316 -
317 - if let tempCampaign = self.campaign {
318 - swiftApi().removeCampaignItem(campaignArg: tempCampaign)
319 - swiftApi().getCampaignsAsyncNewInternal(getCampaignsCallback, failureCallback: {errorCode in})
320 - }
321 -
322 - func getCampaignsCallback (_ campaignsData: Array<swiftApi.CampaignItemModel>?) -> Void {
323 - if (campaignsData != nil) {
324 - DispatchQueue.main.async {
325 - SwiftEventBus.post("campaigns_retrieved")
326 - }
327 - }
328 - }
329 - }
330 - /* New Addition end */
331 -
332 - } else if (response?.getStatus == 3) {
333 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
334 - firebaseEvent._eventName = "loyalty_offer_activated"
335 - firebaseEvent.setParameter = ("name", (self.couponset?.name ?? ""))
336 - firebaseEvent.setParameter = ("type", "coupon")
337 - firebaseEvent.setParameter = ("successful", "false")
338 - SwiftEventBus.post("firebase", sender: firebaseEvent)
339 -
340 - self.showDialog("Αποτυχία","Το κουπόνι δεν είναι διαθέσιμο για αγορά")
341 -
342 - } else if (response?.getStatus == 5) {
343 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
344 - firebaseEvent._eventName = "loyalty_offer_activated"
345 - firebaseEvent.setParameter = ("name", (self.couponset?.name ?? ""))
346 - firebaseEvent.setParameter = ("type", "coupon")
347 - firebaseEvent.setParameter = ("successful", "false")
348 - SwiftEventBus.post("firebase", sender: firebaseEvent)
349 -
350 - self.showDialog("Αποτυχία","Δεν έχεις αρκετούς πόντους")
351 -
352 - } else if (response?.getStatus == 6) {
353 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
354 - firebaseEvent._eventName = "loyalty_offer_activated"
355 - firebaseEvent.setParameter = ("name", (self.couponset?.name ?? ""))
356 - firebaseEvent.setParameter = ("type", "coupon")
357 - firebaseEvent.setParameter = ("successful", "false")
358 - SwiftEventBus.post("firebase", sender: firebaseEvent)
359 -
360 - self.showDialog("Το κουπόνι εξαντλήθηκε","Μείνε συντονισμένος για νέες προσφορές και κουπόνια.")
361 -
362 - } else {
363 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
364 - firebaseEvent._eventName = "loyalty_offer_activated"
365 - firebaseEvent.setParameter = ("name", (self.couponset?.name ?? ""))
366 - firebaseEvent.setParameter = ("type", "coupon")
367 - firebaseEvent.setParameter = ("successful", "false")
368 - SwiftEventBus.post("firebase", sender: firebaseEvent)
369 -
370 - self.showDialog("Αποτυχία","Κάτι πήγε στραβά")
371 - }
372 - }
373 - } else {
374 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
375 - firebaseEvent._eventName = "loyalty_offer_activated"
376 - firebaseEvent.setParameter = ("name", (self.couponset?.name ?? ""))
377 - firebaseEvent.setParameter = ("type", "coupon")
378 - firebaseEvent.setParameter = ("successful", "false")
379 - SwiftEventBus.post("firebase", sender: firebaseEvent)
380 -
381 - self.showDialog("Αποτυχία","Κάτι πήγε στραβά")
382 - }
383 - }
384 -
385 - func showSuccessDialog(_ alertTitle: String, _ alertSubTitle: String) -> Void {
386 -
387 - let alert = UIAlertController(title: alertTitle, message: alertSubTitle, preferredStyle: .alert)
388 -
389 - let cancelButton = UIAlertAction(title: "Κλείσιμο", style: .default, handler: { action in
390 - switch action.style{
391 - case .default:
392 - self.navigationController?.popViewController(animated: true)
393 -
394 - case .cancel:
395 - print("cancel")
396 -
397 - case .destructive:
398 - print("destructive")
399 -
400 - }
401 - })
402 - // cancelButton.setValue(UIColor(rgb: 0xFC5757), forKey: "titleTextColor")
403 - alert.addAction(cancelButton)
404 -
405 - alert.addAction(UIAlertAction(title: "Δες το κουπόνι", style: .default, handler: { action in
406 - switch action.style{
407 - case .default:
408 - self.navigationController?.popViewController(animated: true)
409 -// SwiftEventBus.post("open_my_rewards")
410 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: SwiftWarplyFramework.CouponsViewController.self))
411 - if let vc = storyboard.instantiateViewController(withIdentifier: "CouponsViewController") as? SwiftWarplyFramework.CouponsViewController{
412 - self.navigationController?.pushViewController(vc,animated: true)
413 - }
414 -
415 - case .cancel:
416 - print("cancel")
417 -
418 - case .destructive:
419 - print("destructive")
420 -
421 - }
422 - }))
423 - self.present(alert, animated: true, completion: nil)
424 - }
425 -
426 - func showDialog(_ alertTitle: String, _ alertSubTitle: String) -> Void {
427 -
428 - let alert = UIAlertController(title: alertTitle, message: alertSubTitle, preferredStyle: .alert)
429 - alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
430 - switch action.style{
431 - case .default:
432 - print("default")
433 -
434 - case .cancel:
435 - print("cancel")
436 -
437 - case .destructive:
438 - print("destructive")
439 -
440 - }
441 - }))
442 - self.present(alert, animated: true, completion: nil)
443 - }
444 -
445 - // MARK: - Actions
446 -
447 - @IBAction func redeemButtomAction(_ sender: Any) {
448 -// SwiftEventBus.post("couponRedeem", sender: coupon)
449 -
450 - swiftApi().logTrackersEvent("click", ("RetrieveCoupon:" + (couponset?.uuid ?? "")))
451 -
452 - redeemCouponSetRequest(uuid: couponset?.uuid ?? "", communication_uuid: campaign?.session_uuid ?? "")
453 -
454 - // let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
455 - // let vc = storyboard.instantiateViewController(withIdentifier: "MakeItAPresentViewController") as! SwiftWarplyFramework.MakeItAPresentViewController
456 - // self.navigationController?.pushViewController(vc, animated: true)
457 - }
458 -
459 - @IBAction func termsButtonAction(_ sender: Any) {
460 - termsVisible = !termsVisible
461 - toggleTerms()
462 - }
463 -}
464 -
1 -//
2 -// CouponsTableViewCell.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 18/5/22.
6 -//
7 -
8 -import Foundation
9 -import UIKit
10 -
11 -@objc public class CouponsTableViewCell: UITableViewCell {
12 - @IBOutlet weak var couponBgImage: UIImageView!
13 - @IBOutlet weak var couponImage: UIImageView!
14 - @IBOutlet weak var borderView: UIView!
15 - @IBOutlet weak var nameLabel: UILabel!
16 - @IBOutlet weak var dicountLabel: UILabel!
17 - @IBOutlet weak var discriptionLabel: UILabel!
18 - @IBOutlet weak var expirationLabel: UILabel!
19 - @IBOutlet weak var expirationRedView: UIView!
20 - @IBOutlet weak var expirationRedImage: UIImageView!
21 - @IBOutlet weak var expirationRedLabel: UILabel!
22 -
23 - let smCouponsetsList = swiftApi().getCouponSetsDealsList()
24 -
25 - // Variables for the view, image, and button
26 - var selectView: UIView!
27 - var selectImageView: UIImageView!
28 - var selectButton: UIButton!
29 -
30 - // Boolean to track if the selectView should be visible
31 - var isSelectViewVisible: Bool = false {
32 - didSet {
33 - selectView.isHidden = !isSelectViewVisible
34 - }
35 - }
36 -
37 - // Boolean to track the selection state of the cell
38 - var isSelectedCell: Bool = false {
39 - didSet {
40 - updateSelectionState()
41 - }
42 - }
43 -
44 - // Action closure for button tap inside the cell
45 - var selectButtonAction: (() -> Void)?
46 -
47 - var postImageURL: String? {
48 - didSet {
49 - if let url = postImageURL {
50 - self.couponImage.image = UIImage() // UIImage(named: "loading")
51 -
52 - UIImage.loadImageUsingCacheWithUrlString(url) { image in
53 - // set the image only when we are still displaying the content for the image we finished downloading
54 - if url == self.postImageURL {
55 - self.couponImage.image = image
56 - }
57 - }
58 - }
59 - else {
60 - self.couponImage.image = nil
61 - }
62 - }
63 - }
64 -
65 -
66 - public override func awakeFromNib() {
67 - super.awakeFromNib()
68 - // Initialization code
69 -
70 - couponBgImage.image = UIImage(named: "coupon_bg_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
71 -
72 - borderView.addDashedBorderVertical(color: UIColor(red: 0.62, green: 0.62, blue: 0.61, alpha: 1.00), width: 1.0, height: 110.0)
73 -
74 - setupSelectButton()
75 - }
76 -
77 - public override func setSelected(_ selected: Bool, animated: Bool) {
78 - super.setSelected(selected, animated: animated)
79 -
80 - // Configure the view for the selected state
81 - }
82 -
83 - public override func layoutSubviews() {
84 - super.layoutSubviews()
85 - //set the values for top,left,bottom,right margins
86 - let margins = UIEdgeInsets(top: 0, left: 0, bottom: 8, right: 0)
87 - contentView.frame = contentView.frame.inset(by: margins)
88 - }
89 -
90 - // Setup Select Button UI and layout
91 - func setupSelectButton() {
92 - // Create the container view (selectView)
93 - selectView = UIView()
94 - selectView.translatesAutoresizingMaskIntoConstraints = false
95 - contentView.addSubview(selectView)
96 -
97 - // Set selectView constraints
98 - NSLayoutConstraint.activate([
99 - selectView.widthAnchor.constraint(equalToConstant: 26),
100 - selectView.heightAnchor.constraint(equalToConstant: 26),
101 - selectView.topAnchor.constraint(equalTo: contentView.topAnchor, constant: 6),
102 - selectView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -16)
103 - ])
104 -
105 - // Create the UIImageView inside selectView
106 - selectImageView = UIImageView()
107 - selectImageView.contentMode = .scaleAspectFit
108 - selectImageView.translatesAutoresizingMaskIntoConstraints = false
109 - selectView.addSubview(selectImageView)
110 -
111 - // Set imageView constraints to match the size of the selectView
112 - NSLayoutConstraint.activate([
113 - selectImageView.leadingAnchor.constraint(equalTo: selectView.leadingAnchor),
114 - selectImageView.trailingAnchor.constraint(equalTo: selectView.trailingAnchor),
115 - selectImageView.topAnchor.constraint(equalTo: selectView.topAnchor),
116 - selectImageView.bottomAnchor.constraint(equalTo: selectView.bottomAnchor)
117 - ])
118 -
119 - // Create the transparent button on top of the imageView
120 - selectButton = UIButton(type: .custom)
121 - selectButton.backgroundColor = .clear // Make the button transparent
122 - selectButton.translatesAutoresizingMaskIntoConstraints = false
123 - selectButton.addTarget(self, action: #selector(selectButtonTapped), for: .touchUpInside)
124 - selectView.addSubview(selectButton)
125 -
126 - // Set button constraints to match the size of the selectView
127 - NSLayoutConstraint.activate([
128 - selectButton.leadingAnchor.constraint(equalTo: selectView.leadingAnchor),
129 - selectButton.trailingAnchor.constraint(equalTo: selectView.trailingAnchor),
130 - selectButton.topAnchor.constraint(equalTo: selectView.topAnchor),
131 - selectButton.bottomAnchor.constraint(equalTo: selectView.bottomAnchor)
132 - ])
133 -
134 - // Initially hide the selectView (selectView)
135 - selectView.isHidden = true
136 - }
137 -
138 - // Button action handler
139 - @objc func selectButtonTapped() {
140 - // Trigger the action closure when the button is pressed
141 - selectButtonAction?()
142 - }
143 -
144 - // Update the cell's appearance based on selection state
145 - func updateSelectionState() {
146 - // Update the image based on the new state
147 - if (isSelectedCell) {
148 - selectImageView.image = UIImage(named: "circle_checked", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) // Selected image
149 - } else {
150 - selectImageView.image = UIImage(named: "circle_unchecked", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) // Unselected image
151 - }
152 - }
153 -
154 - func configureCell(coupon: swiftApi.CouponItemModel) {
155 -// COUPONSET: desc, img_preview, name, terms, merchant_uuid, discount_type, final_price
156 -// COUPON: coupon, expiration, discount, status
157 -// MERCHANT: _img_preview,_admin_name
158 -
159 - // Add shadow
160 - self.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
161 - self.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
162 - self.layer.shadowOpacity = 1.0
163 - self.layer.shadowRadius = 1.0
164 -
165 - let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList()
166 -
167 - let couponSetData: swiftApi.CouponSetItemModel? = coupon.couponset_data
168 -
169 - nameLabel.text = ""
170 -
171 - // for merchant in merchantList {
172 - // // if (merchant._uuid == couponSetData?.merchant_uuid) {
173 - // if (merchant._uuid == coupon.merchant_uuid) {
174 - // // couponImage.load(link: merchant._img_preview, placeholder: UIImage(), cache: URLCache())
175 - // self.postImageURL = merchant._img_preview
176 - // nameLabel.text = merchant._admin_name
177 - // break;
178 - // }
179 - // }
180 -
181 - let merchantDetails: swiftApi.MerchantModel? = coupon.merchant_details
182 - self.postImageURL = merchantDetails?._img_preview
183 - nameLabel.text = merchantDetails?._admin_name
184 -
185 -// couponImage.load(link: couponSetData?.img_preview ?? "", placeholder: UIImage(), cache: URLCache())
186 -// nameLabel.text = couponSetData?.name ?? ""
187 - let discount = couponSetData?.discount_type == "value" ? ((coupon.discount ?? "") + "€")
188 - : couponSetData?.discount_type == "percentage" ? ((coupon.discount ?? "") + "%")
189 - : couponSetData?.discount_type == "plus_one" ? "1+1"
190 - : ((coupon.discount ?? "") + "€")
191 - dicountLabel.text = discount
192 - // let htmlText = couponSetData?.inner_text ?? ""
193 - // discriptionLabel.text = htmlText.htmlToString
194 - discriptionLabel.text = couponSetData?.inner_text ?? ""
195 - expirationLabel.text = "Ισχύει έως "+(coupon.expiration ?? "")
196 - }
197 -
198 - func configureCell(coupon: swiftApi.CouponItemModel, isMarket: Bool) {
199 -// COUPONSET: desc, img_preview, name, terms, merchant_uuid
200 -// COUPON: coupon, expiration, discount, status
201 -// MERCHANT: _img_preview,_admin_name
202 -
203 - var couponSetData: swiftApi.CouponSetItemModel?
204 - for item in smCouponsetsList {
205 - if (item.uuid == coupon.couponset_uuid) {
206 - couponSetData = item
207 - break;
208 - }
209 - }
210 -
211 -// // Add shadow
212 - contentView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
213 - contentView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
214 - contentView.layer.shadowOpacity = 1.0
215 - contentView.layer.shadowRadius = 1.0
216 -
217 - expirationLabel.isHidden = true
218 - expirationRedView.isHidden = true
219 - expirationLabel.text = ""
220 - expirationRedLabel.text = ""
221 -
222 - if (coupon.status == 1) { // Active status 1
223 - // Add shadow
224 -// self.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.16).cgColor
225 -// self.layer.shadowOffset = CGSize(width: 0.0, height: 0.0)
226 -// self.layer.shadowOpacity = 1.0
227 -// self.layer.shadowRadius = 6.0
228 -
229 -// couponBgImage.image = UIImage(named: "coupon_bg", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
230 -
231 - couponImage.layer.opacity = 1
232 - borderView.layer.opacity = 1
233 - nameLabel.layer.opacity = 1
234 - dicountLabel.layer.opacity = 1
235 - discriptionLabel.layer.opacity = 1
236 -
237 - expirationLabel.isHidden = false
238 - expirationRedView.isHidden = true
239 - expirationLabel.text = "Ισχύει έως "+(coupon.expiration ?? "")
240 -
241 - let formatter = DateFormatter()
242 - formatter.dateFormat = "dd/MM/yyyy"
243 - let today = Date()
244 -// let firstDate = formatter.date(from: "01/08/2017")
245 -// let secondDate = formatter.date(from: "22/04/2023")
246 - if let couponExpiration = coupon.expiration, let secondDate = formatter.date(from: couponExpiration) {
247 -
248 - let calendar = NSCalendar.current
249 - let date1 = calendar.startOfDay(for: today)
250 - let date2 = calendar.startOfDay(for: secondDate)
251 -
252 - let differenceComponents = calendar.dateComponents([.day], from: date1, to: date2)
253 -
254 - if let daysDifference = differenceComponents.day {
255 - if ((daysDifference >= 0) && (daysDifference <= 15)) {
256 -
257 - expirationLabel.isHidden = true
258 - expirationRedView.isHidden = false
259 - expirationRedView.layer.cornerRadius = 10.0
260 - expirationRedView.backgroundColor = UIColor(red: 0.72, green: 0.88, blue: 0.94, alpha: 1.00)
261 -
262 - expirationRedImage.image = UIImage(named: "ic_time_forward_blue", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
263 -
264 - let normalText1 = "Ισχύει έως "
265 - let redText = (coupon.expiration ?? "")
266 -
267 - let attrRegular = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-SBold", size: 12) ?? UIFont.systemFont(ofSize: 11), NSAttributedString.Key.foregroundColor: UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)]
268 - let attrRed = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-SBold", size: 12) ?? UIFont.systemFont(ofSize: 11), NSAttributedString.Key.foregroundColor: UIColor(red: 0.00, green: 0.29, blue: 0.53, alpha: 1.00)]
269 -
270 - let attributedString = NSMutableAttributedString(string:normalText1, attributes:attrRegular)
271 - let RedString = NSMutableAttributedString(string: redText, attributes:attrRed)
272 -
273 - attributedString.append(RedString)
274 - expirationRedLabel.attributedText = attributedString
275 -
276 - } else {
277 - expirationLabel.isHidden = false
278 - expirationRedView.isHidden = true
279 - expirationLabel.text = "Ισχύει έως "+(coupon.expiration ?? "")
280 - }
281 - }
282 - }
283 -
284 - } else if (coupon.status == 0) { // Redeemed status 0
285 -// couponBgImage.image = UIImage(named: "coupon_bg_grey", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
286 -
287 - expirationLabel.isHidden = false
288 - expirationRedView.isHidden = true
289 - expirationLabel.text = "Το κουπόνι έληξε"
290 -
291 - couponImage.layer.opacity = 0.29
292 - borderView.layer.opacity = 0.29
293 - nameLabel.layer.opacity = 0.29
294 - dicountLabel.layer.opacity = 0.29
295 - discriptionLabel.layer.opacity = 0.29
296 -
297 - } else { // Expired status -1
298 -
299 - expirationLabel.isHidden = false
300 - expirationRedView.isHidden = true
301 - expirationLabel.text = "Το κουπόνι έληξε"
302 -
303 - couponImage.layer.opacity = 0.29
304 - borderView.layer.opacity = 0.29
305 - nameLabel.layer.opacity = 0.29
306 - dicountLabel.layer.opacity = 0.29
307 - discriptionLabel.layer.opacity = 0.29
308 -
309 - }
310 -
311 - let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList()
312 -
313 - nameLabel.text = ""
314 -
315 - for merchant in merchantList {
316 - if (merchant._uuid == coupon.merchant_uuid) {
317 - // couponImage.load(link: merchant._img_preview, placeholder: UIImage(), cache: URLCache())
318 -// self.postImageURL = merchant._img_preview
319 - nameLabel.text = merchant._admin_name
320 - break;
321 - }
322 - }
323 -
324 - self.postImageURL = couponSetData?.img_preview
325 -
326 -// let priceFloat = Float(round(100 * (Float(coupon.discount ?? "0.0") ?? 0.0 )) / 100)
327 -// var priceString = "0"
328 -// priceString = String(format: "%.2f", priceFloat).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
329 -// dicountLabel.text = priceString + "€"
330 -
331 - dicountLabel.text = (coupon.discount ?? "").replacingOccurrences(of: ".", with: ",", options: .literal, range: nil) + "€"
332 -
333 - let htmlText = coupon.inner_text ?? ""
334 - discriptionLabel.text = htmlText.htmlToString
335 -// discriptionLabel.text = coupon.inner_text ?? ""
336 -
337 - }
338 -
339 - func configureCell(coupon: swiftApi.CouponItemModel, isSMCoupon: Bool) {
340 -// COUPONSET: desc, img_preview, name, terms, merchant_uuid, discount_type, final_price
341 -// COUPON: coupon, expiration, discount, status
342 -// MERCHANT: _img_preview,_admin_name
343 -
344 - // Add shadow
345 - self.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
346 - self.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
347 - self.layer.shadowOpacity = 1.0
348 - self.layer.shadowRadius = 1.0
349 -
350 - let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList()
351 -
352 - let couponSetData: swiftApi.CouponSetItemModel? = coupon.couponset_data
353 -
354 - nameLabel.text = ""
355 -
356 - // for merchant in merchantList {
357 - // // if (merchant._uuid == couponSetData?.merchant_uuid) {
358 - // if (merchant._uuid == coupon.merchant_uuid) {
359 - // // couponImage.load(link: merchant._img_preview, placeholder: UIImage(), cache: URLCache())
360 - // self.postImageURL = merchant._img_preview
361 - // nameLabel.text = merchant._admin_name
362 - // break;
363 - // }
364 - // }
365 -
366 - let merchantDetails: swiftApi.MerchantModel? = coupon.merchant_details
367 - self.postImageURL = couponSetData?.img_preview
368 - nameLabel.text = merchantDetails?._admin_name
369 -
370 -// couponImage.load(link: couponSetData?.img_preview ?? "", placeholder: UIImage(), cache: URLCache())
371 -// nameLabel.text = couponSetData?.name ?? ""
372 - let discount = couponSetData?.discount_type == "value" ? ((coupon.discount ?? "") + "€")
373 - : couponSetData?.discount_type == "percentage" ? ((coupon.discount ?? "") + "%")
374 - : couponSetData?.discount_type == "plus_one" ? "1+1"
375 - : ((coupon.discount ?? "") + "€")
376 - dicountLabel.text = discount
377 - // let htmlText = couponSetData?.inner_text ?? ""
378 - // discriptionLabel.text = htmlText.htmlToString
379 - discriptionLabel.text = couponSetData?.inner_text ?? ""
380 - expirationLabel.text = "Ισχύει έως "+(coupon.expiration ?? "")
381 - }
382 -
383 - // Configure the cell with visibility of the selectView, a selected state, and select Button Action
384 - func showSelectButton(isSelectViewVisible: Bool, isSelected: Bool, buttonAction: @escaping () -> Void) {
385 - self.isSelectViewVisible = isSelectViewVisible
386 - self.isSelectedCell = isSelected
387 - self.selectButtonAction = buttonAction
388 -
389 - if (isSelected) {
390 - couponBgImage.image = UIImage(named: "coupon_bg_2_selected", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
391 - } else {
392 - couponBgImage.image = UIImage(named: "coupon_bg_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
393 - }
394 -
395 - // Set nameLabel constraints to not overlap selectView
396 - NSLayoutConstraint.activate([
397 - nameLabel.trailingAnchor.constraint(equalTo: selectView.leadingAnchor, constant: -5)
398 - ])
399 -
400 - }
401 -}
1 -//
2 -// CouponsViewController.swift
3 -// WarplySDKFrameworkIOS
4 -//
5 -// Created by Βασιλης Σκουρας on 4/5/22.
6 -//
7 -
8 -import Foundation
9 -import UIKit
10 -import SwiftEventBus
11 -
12 -@objc public class CouponsViewController: UIViewController {
13 - @IBOutlet weak var backgroundImage: UIImageView!
14 - @IBOutlet weak var tableView: UITableView!
15 - @IBOutlet weak var emptyView: UIView!
16 - @IBOutlet weak var emptyViewHeight: NSLayoutConstraint!
17 - @IBOutlet weak var emptyLabel: UILabel!
18 -
19 - public var coupons:Array<swiftApi.CouponItemModel> = []
20 -
21 - public override func viewDidLoad() {
22 - super.viewDidLoad()
23 -
24 - self.hidesBottomBarWhenPushed = true
25 -
26 - SwiftEventBus.onBackgroundThread(self, name: "coupons_fetched") { result in
27 -
28 - DispatchQueue.main.async {
29 - self.coupons = swiftApi().getCouponList()
30 - self.tableView.reloadData()
31 -
32 - self.handleEmptyView()
33 - }
34 - }
35 -
36 - getCouponsRequest()
37 -
38 - setBackButton()
39 -// setNavigationTitle("GIFTS FOR YOU")
40 - setNavigationTitle("FREE COUPONS")
41 -
42 -// backgroundImage.image = UIImage(named: "coupons_scrollview_dark", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
43 -
44 - tableView.delegate = self
45 - tableView.dataSource = self
46 -
47 -// tableView.clipsToBounds = true
48 -// tableView.layer.cornerRadius = 30
49 -// tableView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
50 - tableView.contentInset.top = 30
51 -
52 - emptyLabel.text = "Αυτήν τη στιγμή δεν έχεις κάποιο ενεργό κουπόνι. Στην ενότητα FOR YOU μπορείς να βρεις κουπόνια αποκλειστικά για σένα!"
53 - }
54 -
55 - public override func viewWillAppear(_ animated: Bool) {
56 - super.viewWillAppear(animated)
57 -
58 - swiftApi().logTrackersEvent("screen", "ActiveCouponsScreen")
59 -
60 - self.coupons = swiftApi().getCouponList()
61 - self.tableView.reloadData()
62 -
63 - self.handleEmptyView()
64 -
65 - self.navigationController?.hideHairline()
66 - }
67 -
68 - // MARK: - Functions
69 - func handleEmptyView() {
70 - if (self.coupons.count == 0) {
71 - self.emptyView.isHidden = false
72 - self.emptyViewHeight.constant = self.emptyView.intrinsicContentSize.height
73 - } else {
74 - self.emptyView.isHidden = true
75 - self.emptyViewHeight.constant = 0
76 - }
77 - }
78 -
79 - // MARK: - API Functions
80 - func getCouponsRequest() {
81 - swiftApi().getCouponsAsync(getCouponsCallback, failureCallback: {errorCode in
82 - self.coupons = []
83 - })
84 - }
85 -
86 - func getCouponsCallback (_ couponsData: Array<swiftApi.CouponItemModel>?) -> Void {
87 - if (couponsData != nil) {
88 - let activeCouponData = swiftApi().filterActiveCoupons(couponsData ?? [])
89 -
90 - self.coupons = activeCouponData
91 -
92 - DispatchQueue.main.async {
93 - SwiftEventBus.post("coupons_fetched")
94 - // self.tableView.reloadData()
95 -
96 - // self.handleEmptyView()
97 - }
98 - } else {
99 - self.coupons = []
100 - }
101 - }
102 -
103 -}
104 -
105 -// MARK: - TableView
106 -extension CouponsViewController: UITableViewDelegate, UITableViewDataSource{
107 -
108 - public func numberOfSections(in tableView: UITableView) -> Int {
109 - return 1
110 - }
111 -
112 - public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
113 - return self.coupons.count
114 - }
115 -
116 - public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
117 - return 130.0 + 8.0
118 -// return UITableViewAutomaticDimension
119 - }
120 -
121 - public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
122 - let cell = tableView.dequeueReusableCell(withIdentifier: "CouponsTableViewCellId", for: indexPath) as! CouponsTableViewCell
123 -
124 - cell.configureCell(coupon: coupons[indexPath.row])
125 -
126 - return cell
127 - }
128 -
129 - public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
130 -
131 - // SwiftEventBus.post("couponBarcodePressed", sender: coupons[indexPath.row])
132 -
133 - // Logs
134 - let couponSetData: swiftApi.CouponSetItemModel? = coupons[indexPath.row].couponset_data
135 - print("Coupon clicked: " + (coupons[indexPath.row].coupon ?? ""))
136 - print("Coupon Name clicked: " + (couponSetData?.name ?? ""))
137 - print("Coupon Description clicked: " + (couponSetData?.short_description ?? ""))
138 - print("Coupon Expiration clicked: " + (coupons[indexPath.row].expiration ?? ""))
139 -
140 - swiftApi().logTrackersEvent("click", ("Coupon:" + (couponSetData?.name ?? "")))
141 -
142 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
143 - let vc = storyboard.instantiateViewController(withIdentifier: "CouponBarcodeViewController") as! SwiftWarplyFramework.CouponBarcodeViewController
144 - vc.coupon = coupons[indexPath.row]
145 - self.navigationController?.pushViewController(vc, animated: true)
146 - }
147 -
148 -}
1 -//
2 -// DetailsViewController.swift
3 -// WarplySDKFrameworkIOS
4 -//
5 -// Created by Βασιλης Σκουρας on 5/5/22.
6 -//
7 -
8 -import Foundation
9 -import UIKit
10 -
11 -@objc public class DetailsViewController: UIViewController {
12 - public override func viewWillAppear(_ animated: Bool) {
13 - super.viewWillAppear(animated)
14 -
15 - self.hidesBottomBarWhenPushed = true
16 - setBackButton()
17 - setNavigationTitle("Ανάλυση")
18 - }
19 -}
1 -//
2 -// GiftsViewController.swift
3 -// WarplySDKFrameworkIOS
4 -//
5 -// Created by Βασιλης Σκουρας on 5/5/22.
6 -//
7 -
8 -import Foundation
9 -import UIKit
10 -import SwiftEventBus
11 -
12 -@objc public class GiftsViewController: UIViewController {
13 - @IBOutlet weak var mainView: UIView!
14 - @IBOutlet weak var tableView: UITableView!
15 - @IBOutlet weak var topBorderShadow: UIImageView!
16 -
17 - public var campaigns:Array<swiftApi.CampaignItemModel> = [] {
18 - didSet {
19 - DispatchQueue.main.async {
20 - self.tableView.reloadData()
21 - }
22 - }
23 - }
24 - public var seasonalList:Array<swiftApi.LoyaltyGiftsForYouPackage> = swiftApi().getSeasonalList()
25 - public var ccmsList:Array<swiftApi.LoyaltyContextualOfferModel> = swiftApi().getCCMSLoyaltyCampaigns()
26 - public var loyaltyList:Array<swiftApi.CampaignItemModel> = swiftApi().mergeGFYCCMSLoyaltyCampaigns(campaigns: swiftApi().getCCMSLoyaltyCampaigns())
27 -
28 - var timerGFY: DispatchSourceTimer?
29 - var seconds: Int = 0
30 -
31 - public override func viewDidLoad() {
32 - super.viewDidLoad()
33 -
34 - self.hidesBottomBarWhenPushed = true
35 -
36 - setBackButton()
37 - setNavigationTitle("GIFTS FOR YOU", "bold")
38 -
39 - tableView.delegate = self
40 - tableView.dataSource = self
41 -
42 - SwiftEventBus.onMainThread(self, name: "ccms_retrieved") { result in
43 - print("===== SwiftEventBus ccms_retrieved =====")
44 -
45 - self.refreshData()
46 -
47 - }
48 -
49 - SwiftEventBus.onMainThread(self, name: "campaigns_retrieved") { result in
50 - print("===== SwiftEventBus campaigns_retrieved =====")
51 -
52 - self.refreshData()
53 -
54 - }
55 -
56 - SwiftEventBus.onMainThread(self, name: "seasonals_retrieved") { result in
57 - print("===== SwiftEventBus seasonals_retrieved =====")
58 -
59 - self.refreshData()
60 -
61 - }
62 -
63 -// tableView.clipsToBounds = true
64 -// tableView.layer.cornerRadius = 30
65 -// tableView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
66 - tableView.contentInset.top = 25
67 -
68 - // Add Top left corner radius
69 -// mainView.clipsToBounds = true
70 -// mainView.layer.cornerRadius = 30
71 -// mainView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
72 - mainView.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1.00)
73 -
74 -// let image = UIImage(named: "top_border_shadow", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)!
75 -// var aspectR: CGFloat = 0.0
76 -//
77 -// aspectR = image.size.width/image.size.height
78 -//
79 -// topBorderShadow.translatesAutoresizingMaskIntoConstraints = false
80 -// topBorderShadow.image = image
81 -// topBorderShadow.contentMode = .scaleAspectFill
82 -//
83 -// NSLayoutConstraint.activate([
84 -// topBorderShadow.topAnchor.constraint(equalTo: mainView.topAnchor, constant: 0),
85 -// topBorderShadow.leadingAnchor.constraint(equalTo: mainView.leadingAnchor, constant: 0),
86 -// topBorderShadow.trailingAnchor.constraint(equalTo: mainView.trailingAnchor, constant: 0),
87 -// topBorderShadow.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.width),
88 -// topBorderShadow.heightAnchor.constraint(equalTo: topBorderShadow.widthAnchor, multiplier: 1/aspectR)
89 -// ])
90 -
91 - }
92 -
93 - public override func viewWillAppear(_ animated: Bool) {
94 - super.viewWillAppear(animated)
95 -
96 - swiftApi().logTrackersEvent("screen", "GiftsForYouScreen")
97 -
98 - self.refreshData()
99 -
100 - self.startTimer()
101 -
102 - self.navigationController?.hideHairline()
103 - }
104 -
105 - public override func viewWillDisappear(_ animated: Bool) {
106 - super.viewWillDisappear(animated)
107 -
108 - self.stopTimer()
109 - }
110 -
111 - // MARK: - Functions
112 - func refreshData() -> Void {
113 - var tempCampaigns:Array<swiftApi.CampaignItemModel> = []
114 - self.campaigns = []
115 - self.seasonalList = swiftApi().getSeasonalList()
116 - self.ccmsList = swiftApi().getCCMSLoyaltyCampaigns()
117 - self.loyaltyList = swiftApi().mergeGFYCCMSLoyaltyCampaigns(campaigns: swiftApi().getCCMSLoyaltyCampaigns())
118 -
119 - if (self.seasonalList.count > 0) {
120 - for seasonalItem in self.seasonalList {
121 - let newCampaign = swiftApi.CampaignItemModel()
122 - newCampaign._title = seasonalItem._title
123 - newCampaign._logo_url = seasonalItem._imageUrl
124 - newCampaign._loyaltyPackageId = seasonalItem._loyaltyPackageId
125 - tempCampaigns.append(newCampaign)
126 - }
127 - }
128 -
129 - if (self.ccmsList.count > 0) {
130 - for ccmsItem in self.ccmsList {
131 - if (((ccmsItem._loyaltyCampaignId == "") || (ccmsItem._loyaltyCampaignId == "NA")) && (ccmsItem._zone == "COSMOTE_APP_GIFTS4U")) {
132 - let newCampaign = swiftApi.CampaignItemModel()
133 - newCampaign._title = ccmsItem._title
134 - newCampaign._logo_url = ccmsItem._imageUrl
135 - newCampaign._ccms = ccmsItem
136 - tempCampaigns.append(newCampaign)
137 - }
138 - }
139 - }
140 -
141 - if (self.loyaltyList.count > 0) {
142 - tempCampaigns = tempCampaigns + self.loyaltyList
143 - }
144 -
145 - self.campaigns = tempCampaigns
146 - self.tableView.reloadData()
147 - }
148 -
149 - func startTimer() {
150 - print("========= GFY Timer Started! =========")
151 -
152 - let queue = DispatchQueue(label: Bundle.main.bundleIdentifier! + ".gfy.timer")
153 - timerGFY = DispatchSource.makeTimerSource(queue: queue)
154 - timerGFY!.schedule(deadline: .now(), repeating: .seconds(1))
155 - timerGFY!.setEventHandler { [weak self] in
156 - // do whatever stuff you want on the background queue here here
157 - print("========= GFY interval! =========")
158 -
159 - DispatchQueue.main.async {
160 - // update your model objects and/or UI here
161 - self?.seconds = (self?.seconds ?? 0) + 1
162 -
163 - }
164 - }
165 - timerGFY!.resume()
166 - }
167 -
168 - func stopTimer() {
169 - print("========= GFY Timer Stopped! =========")
170 - timerGFY?.cancel()
171 - timerGFY = nil
172 -
173 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
174 - firebaseEvent._eventName = "time_spent_on_loyalty_sdk"
175 - firebaseEvent.setParameter = ("name", "GiftsForYou")
176 - firebaseEvent.setParameter = ("seconds", String(seconds))
177 - SwiftEventBus.post("firebase", sender: firebaseEvent)
178 -
179 - seconds = 0
180 - }
181 -
182 -}
183 -
184 -// MARK: - TableView
185 -extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
186 -
187 - public func numberOfSections(in tableView: UITableView) -> Int {
188 - return 1
189 - }
190 -
191 - public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
192 - return self.campaigns.count
193 - }
194 -
195 - public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
196 - return 140.0 + 10.0
197 -// return UITableViewAutomaticDimension
198 - }
199 -
200 - public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
201 - let cell = tableView.dequeueReusableCell(withIdentifier: "InboxTableViewCellId", for: indexPath) as! InboxTableViewCell
202 -
203 - let isCcmsOffer = (campaigns[indexPath.row].ccms_offer != nil) && (campaigns[indexPath.row].ccms_offer != "") && (campaigns[indexPath.row].ccms_offer == "true")
204 -
205 - if (campaigns[indexPath.row]._type != nil && campaigns[indexPath.row]._type == "telco") {
206 - let ccmsCampaigns = swiftApi().getCCMSLoyaltyCampaigns()
207 - let loyaltyCampaignIdExists = ccmsCampaigns.contains { $0._loyaltyCampaignId == campaigns[indexPath.row].session_uuid }
208 -
209 - if (loyaltyCampaignIdExists == true) {
210 - for item in ccmsCampaigns {
211 - if (item._loyaltyCampaignId == campaigns[indexPath.row].session_uuid) {
212 - cell.configureCell(ccms: item)
213 - break;
214 - }
215 - }
216 - }
217 -
218 - } else if (campaigns[indexPath.row].session_uuid != nil && campaigns[indexPath.row].session_uuid != "" && isCcmsOffer) {
219 -
220 - let ccmsCampaigns = swiftApi().getCCMSLoyaltyCampaigns()
221 - let loyaltyCampaignIdExists = ccmsCampaigns.contains { $0._loyaltyCampaignId == campaigns[indexPath.row].session_uuid }
222 -
223 - if (loyaltyCampaignIdExists == true) {
224 - for item in ccmsCampaigns {
225 - if (item._loyaltyCampaignId == campaigns[indexPath.row].session_uuid) {
226 - cell.configureCell(ccms: item)
227 - break;
228 - }
229 - }
230 - }
231 -
232 - } else {
233 - cell.configureCell(campaign: campaigns[indexPath.row])
234 - }
235 -
236 - return cell
237 - }
238 -
239 - public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
240 - if (campaigns[indexPath.row]._ccms != nil) {
241 -
242 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
243 - firebaseEvent._eventName = "loyalty_sdk_offer_selected"
244 - firebaseEvent.setParameter = ("name", (campaigns[indexPath.row]._ccms?._title ?? ""))
245 - firebaseEvent.setParameter = ("type", "gift")
246 - SwiftEventBus.post("firebase", sender: firebaseEvent)
247 -
248 - swiftApi().logTrackersEvent("click", ("Contextual:" + (campaigns[indexPath.row]._ccms?._sessionId ?? "")))
249 -
250 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
251 - let vc = storyboard.instantiateViewController(withIdentifier: "ContextualViewController") as! SwiftWarplyFramework.ContextualViewController
252 - vc.ccms = campaigns[indexPath.row]._ccms
253 - self.navigationController?.pushViewController(vc, animated: true)
254 -
255 - if let sessionUuid = campaigns[indexPath.row].session_uuid {
256 - getSingleCampaignAsyncRequest(sessionUuid: sessionUuid)
257 - }
258 -
259 - } else if (campaigns[indexPath.row]._type != nil && campaigns[indexPath.row]._type == "telco") {
260 - let ccmsCampaigns = swiftApi().getCCMSLoyaltyCampaigns()
261 - let loyaltyCampaignIdExists = ccmsCampaigns.contains { $0._loyaltyCampaignId == campaigns[indexPath.row].session_uuid }
262 -
263 - if (loyaltyCampaignIdExists == true) {
264 - for item in ccmsCampaigns {
265 - if (item._loyaltyCampaignId == campaigns[indexPath.row].session_uuid) {
266 -
267 - swiftApi().logTrackersEvent("click", ("Telco:" + (item._sessionId)))
268 -
269 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
270 - firebaseEvent._eventName = "loyalty_sdk_offer_selected"
271 - firebaseEvent.setParameter = ("name", (item._title))
272 - firebaseEvent.setParameter = ("type", "gift")
273 - SwiftEventBus.post("firebase", sender: firebaseEvent)
274 -
275 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
276 - let vc = storyboard.instantiateViewController(withIdentifier: "TelcoViewController") as! SwiftWarplyFramework.TelcoViewController
277 - vc.ccms = item
278 - vc.campaign = campaigns[indexPath.row]
279 - self.navigationController?.pushViewController(vc, animated: true)
280 -
281 - if let sessionUuid = campaigns[indexPath.row].session_uuid {
282 - getSingleCampaignAsyncRequest(sessionUuid: sessionUuid)
283 - }
284 - break;
285 - }
286 - }
287 - }
288 -
289 - } else if (campaigns[indexPath.row]._campaign_type == "coupon") {
290 - let couponsetUuid = campaigns[indexPath.row]._couponset
291 -
292 - if (couponsetUuid != "" && couponsetUuid != nil) {
293 - let couponsetsList = swiftApi().getCouponSetList()
294 -
295 - for item in couponsetsList {
296 - if (item.uuid == couponsetUuid) {
297 -
298 - swiftApi().logTrackersEvent("click", ("Loyalty:" + (campaigns[indexPath.row].session_uuid ?? "")))
299 -
300 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
301 - firebaseEvent._eventName = "loyalty_sdk_offer_selected"
302 - firebaseEvent.setParameter = ("name", (item.name ?? ""))
303 - firebaseEvent.setParameter = ("type", "coupon")
304 - SwiftEventBus.post("firebase", sender: firebaseEvent)
305 -
306 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
307 - let vc = storyboard.instantiateViewController(withIdentifier: "CouponViewController") as! SwiftWarplyFramework.CouponViewController
308 - vc.couponset = item
309 - vc.campaign = campaigns[indexPath.row]
310 -
311 - let ccmsCampaigns = swiftApi().getCCMSLoyaltyCampaigns()
312 - let loyaltyCampaignIdExists = ccmsCampaigns.contains { $0._loyaltyCampaignId == campaigns[indexPath.row].session_uuid }
313 -
314 - if (loyaltyCampaignIdExists == true) {
315 - for item in ccmsCampaigns {
316 - if (item._loyaltyCampaignId == campaigns[indexPath.row].session_uuid) {
317 - vc.ccms = item
318 - break;
319 - }
320 - }
321 - }
322 -
323 - self.navigationController?.pushViewController(vc, animated: true)
324 -
325 - if let sessionUuid = campaigns[indexPath.row].session_uuid {
326 - getSingleCampaignAsyncRequest(sessionUuid: sessionUuid)
327 - }
328 -
329 - break;
330 - }
331 - }
332 - } else if (campaigns[indexPath.row].session_uuid != nil && campaigns[indexPath.row].session_uuid != "") {
333 -
334 - let status = swiftApi().getNetworkStatus()
335 - if (status == -1 || status == 0) {
336 - self.showDialog("Δεν υπάρχει σύνδεση","Αυτή τη στιγμή βρίσκεσαι εκτός σύνδεσης. Παρακαλούμε βεβαιώσου ότι είσαι συνδεδεμένος στο διαδίκτυο και προσπάθησε ξανά.")
337 - } else {
338 -
339 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
340 - let vc = storyboard.instantiateViewController(withIdentifier: "CampaignViewController") as! SwiftWarplyFramework.CampaignViewController
341 - var url = ""
342 - var params = ""
343 - let isCcmsOffer = (campaigns[indexPath.row].ccms_offer != nil) && (campaigns[indexPath.row].ccms_offer != "") && (campaigns[indexPath.row].ccms_offer == "true")
344 -
345 - if (isCcmsOffer) {
346 - let ccmsCampaigns = swiftApi().getCCMSLoyaltyCampaigns()
347 -
348 - let loyaltyCampaignIdExists = ccmsCampaigns.contains { $0._loyaltyCampaignId == campaigns[indexPath.row].session_uuid }
349 -
350 - if (loyaltyCampaignIdExists == true) {
351 - var ccmsCampaignFound:swiftApi.LoyaltyContextualOfferModel = swiftApi.LoyaltyContextualOfferModel()
352 - for item in ccmsCampaigns {
353 - if (item._loyaltyCampaignId == campaigns[indexPath.row].session_uuid) {
354 - ccmsCampaignFound = item
355 - }
356 - }
357 - swiftApi().logTrackersEvent("click", ("Contextual:" + (ccmsCampaignFound._sessionId)))
358 -
359 - url = swiftApi().constructCcmsUrl(campaigns[indexPath.row], ccmsCampaignFound)
360 - params = swiftApi().constructCcmsParams(campaigns[indexPath.row], ccmsCampaignFound)
361 -
362 - } else {
363 - url = swiftApi().constructCampaignUrl(campaigns[indexPath.row])
364 - params = swiftApi().constructCampaignParams(campaigns[indexPath.row])
365 -
366 - }
367 -
368 - let encoder = JSONEncoder()
369 - encoder.outputFormatting = .prettyPrinted
370 - let data = try! encoder.encode(campaigns[indexPath.row])
371 -
372 - print("CCMS_CLICK " + String(data: data, encoding: .utf8)!)
373 -
374 - } else {
375 - swiftApi().logTrackersEvent("click", ("Loyalty:" + (campaigns[indexPath.row].session_uuid ?? "")))
376 -
377 - url = swiftApi().constructCampaignUrl(campaigns[indexPath.row])
378 - params = swiftApi().constructCampaignParams(campaigns[indexPath.row])
379 -
380 - let encoder = JSONEncoder()
381 - encoder.outputFormatting = .prettyPrinted
382 - let data = try! encoder.encode(campaigns[indexPath.row])
383 -
384 - print("GFY_CLICK " + String(data: data, encoding: .utf8)!)
385 - }
386 - print("CampaignUrl url onclick: " + url)
387 - vc.campaignUrl = url
388 - vc.params = params
389 - self.navigationController?.pushViewController(vc, animated: true)
390 -
391 - if let sessionUuid = campaigns[indexPath.row].session_uuid {
392 - getSingleCampaignAsyncRequest(sessionUuid: sessionUuid)
393 - }
394 - }
395 -
396 - }
397 -
398 - } else {
399 - if (campaigns[indexPath.row].session_uuid != nil && campaigns[indexPath.row].session_uuid != "") {
400 -
401 - let status = swiftApi().getNetworkStatus()
402 - if (status == -1 || status == 0) {
403 - self.showDialog("Δεν υπάρχει σύνδεση","Αυτή τη στιγμή βρίσκεσαι εκτός σύνδεσης. Παρακαλούμε βεβαιώσου ότι είσαι συνδεδεμένος στο διαδίκτυο και προσπάθησε ξανά.")
404 - } else {
405 -
406 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
407 - let vc = storyboard.instantiateViewController(withIdentifier: "CampaignViewController") as! SwiftWarplyFramework.CampaignViewController
408 - var url = ""
409 - var params = ""
410 - let isCcmsOffer = (campaigns[indexPath.row].ccms_offer != nil) && (campaigns[indexPath.row].ccms_offer != "") && (campaigns[indexPath.row].ccms_offer == "true")
411 -
412 - if (isCcmsOffer) {
413 - let ccmsCampaigns = swiftApi().getCCMSLoyaltyCampaigns()
414 -
415 - let loyaltyCampaignIdExists = ccmsCampaigns.contains { $0._loyaltyCampaignId == campaigns[indexPath.row].session_uuid }
416 -
417 - if (loyaltyCampaignIdExists == true) {
418 - var ccmsCampaignFound:swiftApi.LoyaltyContextualOfferModel = swiftApi.LoyaltyContextualOfferModel()
419 - for item in ccmsCampaigns {
420 - if (item._loyaltyCampaignId == campaigns[indexPath.row].session_uuid) {
421 - ccmsCampaignFound = item
422 - }
423 - }
424 - swiftApi().logTrackersEvent("click", ("Contextual:" + (ccmsCampaignFound._sessionId)))
425 -
426 - url = swiftApi().constructCcmsUrl(campaigns[indexPath.row], ccmsCampaignFound)
427 - params = swiftApi().constructCcmsParams(campaigns[indexPath.row], ccmsCampaignFound)
428 -
429 - } else {
430 - url = swiftApi().constructCampaignUrl(campaigns[indexPath.row])
431 - params = swiftApi().constructCampaignParams(campaigns[indexPath.row])
432 -
433 - }
434 -
435 - let encoder = JSONEncoder()
436 - encoder.outputFormatting = .prettyPrinted
437 - let data = try! encoder.encode(campaigns[indexPath.row])
438 -
439 - print("CCMS_CLICK " + String(data: data, encoding: .utf8)!)
440 -
441 - } else {
442 - swiftApi().logTrackersEvent("click", ("Loyalty:" + (campaigns[indexPath.row].session_uuid ?? "")))
443 -
444 - url = swiftApi().constructCampaignUrl(campaigns[indexPath.row])
445 - params = swiftApi().constructCampaignParams(campaigns[indexPath.row])
446 -
447 - let encoder = JSONEncoder()
448 - encoder.outputFormatting = .prettyPrinted
449 - let data = try! encoder.encode(campaigns[indexPath.row])
450 -
451 - print("GFY_CLICK " + String(data: data, encoding: .utf8)!)
452 - }
453 - print("CampaignUrl url onclick: " + url)
454 - vc.campaignUrl = url
455 - vc.params = params
456 - self.navigationController?.pushViewController(vc, animated: true)
457 -
458 - if let sessionUuid = campaigns[indexPath.row].session_uuid {
459 - getSingleCampaignAsyncRequest(sessionUuid: sessionUuid)
460 - }
461 - }
462 -
463 - } else {
464 - let seasonalEvent = swiftApi.LoyaltyGiftsForYouOfferClickEvent()
465 - seasonalEvent._title = campaigns[indexPath.row]._title ?? ""
466 - seasonalEvent._imageUrl = campaigns[indexPath.row]._logo_url ?? ""
467 - seasonalEvent._loyaltyPackageId = campaigns[indexPath.row]._loyaltyPackageId ?? ""
468 - SwiftEventBus.post("seasonal", sender: seasonalEvent)
469 -
470 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
471 - firebaseEvent._eventName = "loyalty_sdk_offer_selected"
472 - firebaseEvent.setParameter = ("name", (campaigns[indexPath.row]._title ?? ""))
473 - firebaseEvent.setParameter = ("type", "seasonal")
474 - SwiftEventBus.post("firebase", sender: firebaseEvent)
475 - }
476 - }
477 - }
478 -
479 -
480 - func getSingleCampaignAsyncRequest(sessionUuid: String) {
481 - swiftApi().getSingleCampaignAsync(sessionUuid: sessionUuid, getSingleCampaignCallback)
482 - }
483 -
484 - func getSingleCampaignCallback (_ getSingleCampaignData: swiftApi.VerifyTicketResponseModel?) -> Void {
485 - if (getSingleCampaignData != nil) {
486 - DispatchQueue.main.async {
487 - }
488 - } else {
489 - }
490 - }
491 -
492 -
493 - func showDialog(_ alertTitle: String, _ alertSubTitle: String) -> Void {
494 -
495 - let alert = UIAlertController(title: alertTitle, message: alertSubTitle, preferredStyle: .alert)
496 - alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
497 - switch action.style{
498 - case .default:
499 - print("default")
500 -
501 - case .cancel:
502 - print("cancel")
503 -
504 - case .destructive:
505 - print("destructive")
506 -
507 - }
508 - }))
509 - self.present(alert, animated: true, completion: nil)
510 - }
511 -
512 -}
1 -//
2 -// HistoryViewController.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 18/7/22.
6 -//
7 -
8 -import UIKit
9 -
10 -class HistoryViewController: AnalysisChildViewController {
11 - var loading: Bool = false
12 - var items: Array<swiftApi.CouponItemModel> = swiftApi().getOldCouponList()
13 - var showMore = false
14 -
15 - // TODO: remove this when configuring model
16 - let hasMessage = true
17 -
18 - // lifecycle
19 - override func viewDidLoad() {
20 -
21 - super.viewDidLoad()
22 -
23 - self.tableView.delegate = self
24 - self.tableView.dataSource = self
25 -
26 - // Add shadow
27 - self.tableView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
28 - self.tableView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
29 - self.tableView.layer.shadowOpacity = 1.0
30 - self.tableView.layer.shadowRadius = 1.0
31 -
32 - self.refreshControl = UIRefreshControl()
33 - self.refreshControl?.addTarget(self, action: #selector(handleRefresh(_:)), for: .valueChanged)
34 -
35 - handleRefresh(self.refreshControl!)
36 - }
37 -
38 - // mvp
39 - @objc func load() {
40 -
41 - if (loading) {
42 - return;
43 - }
44 -
45 - showLoading()
46 -
47 - items = swiftApi().getOldCouponList()
48 -
49 - self.showMore = (self.items.count > 3)
50 -
51 - if (self.showMore == true) {
52 - self.items = Array(self.items[0...2])
53 - }
54 -
55 - showContent()
56 - self.tableView.reloadData()
57 - }
58 -
59 - private func showLoading() {
60 -
61 - loading = true
62 - if (self.refreshControl!.isRefreshing) {
63 - return;
64 - }
65 -
66 - self.refreshControl!.beginRefreshing()
67 - }
68 -
69 - private func showError() {
70 - }
71 -
72 - private func showContent() {
73 -
74 - loading = false
75 - self.refreshControl!.endRefreshing()
76 - }
77 -
78 - // private
79 - func responseCallback (_ data: Array<swiftApi.CouponItemModel>?) -> Void {
80 -
81 - self.items = data!
82 - self.showMore = (self.items.count > 3)
83 -
84 - if (self.showMore == true) {
85 - self.items = Array(self.items[0...2])
86 - }
87 - showContent()
88 - DispatchQueue.main.async {
89 - self.tableView.reloadData()
90 - }
91 - }
92 -
93 - @objc func handleRefresh(_ refreshControl: UIRefreshControl) {
94 -
95 - self.perform(_: #selector(load), with: nil, afterDelay: 0.5)
96 - }
97 -
98 - // MARK: - Table view data source
99 - override func numberOfSections(in tableView: UITableView) -> Int {
100 - return 2
101 - }
102 -
103 - override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
104 - if (section == 0) {
105 - return 1
106 - }
107 -
108 - if (self.showMore == true) {
109 - return 4
110 - }
111 - return items.count
112 - }
113 -
114 - override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
115 -// if (indexPath.section == 0) {
116 -//// return hasMessage ? (items.count > 0 ? 380.0 : 480.0) : 280
117 -// return hasMessage ? UITableView.automaticDimension : 280
118 -// }
119 -//
120 -//// return 140.0
121 - return UITableView.automaticDimension
122 - }
123 - override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
124 -
125 - // header
126 - if (indexPath.section == 0) {
127 - if (hasMessage) {
128 - let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisHeaderMessageViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisHeaderMessageViewCell
129 - cell.configureCell(isEmpty: items.count == 0, isMarket: false)
130 - return cell
131 - }
132 -
133 - return tableView.dequeueReusableCell(withIdentifier: "AnalysisHeaderViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisHeaderViewCell
134 - }
135 -
136 - if (self.showMore && indexPath.row == 3) {
137 - let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisMoreViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisMoreViewCell
138 - return cell
139 - }
140 -
141 - let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisItemViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisItemViewCell
142 - cell.configureCell(item: items[indexPath.row])
143 -
144 - return cell
145 - }
146 -
147 - override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
148 - if (indexPath.section == 0) {
149 - return
150 - }
151 -
152 - if (self.showMore && indexPath.row == 3) {
153 - self.items = swiftApi().getOldCouponList()
154 - self.showMore = false
155 - self.tableView.reloadData()
156 - }
157 - }
158 -
159 - override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
160 - if (section == 0){
161 - return nil
162 -
163 - } else if (section == 1) {
164 - if (self.items.count > 0) {
165 - let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 50))
166 -
167 - let viewBorder = UIView(frame: CGRect(x: 10, y: 0, width: view.frame.width-20, height: view.frame.height))
168 - viewBorder.backgroundColor = .white
169 - // viewBorder.backgroundColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00)
170 -
171 - viewBorder.layer.cornerRadius = 16.5
172 - viewBorder.layer.maskedCorners = [ .layerMinXMinYCorner, .layerMaxXMinYCorner] // Top left, bottom right corner radius
173 -
174 - let viewInner = UIView(frame: CGRect(x: 1, y: 1, width: viewBorder.frame.width-2, height: viewBorder.frame.height-1))
175 - viewInner.backgroundColor = .white
176 -
177 - viewInner.layer.cornerRadius = 16.5
178 - viewInner.layer.maskedCorners = [ .layerMinXMinYCorner, .layerMaxXMinYCorner] // Top left, bottom right corner radius
179 -
180 - let titleLabel = UILabel(frame: CGRect(x: 20, y: 20, width: viewInner.frame.width - 40, height: 20))
181 - titleLabel.font = UIFont(name: "BTCosmo-Bold", size: 20)
182 - titleLabel.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
183 - titleLabel.text = "Αναλυτικά"
184 -
185 - view.addSubview(viewBorder)
186 - viewBorder.addSubview(viewInner)
187 - viewInner.addSubview(titleLabel)
188 - return view
189 - } else {
190 - return nil
191 - }
192 -
193 -
194 - } else {
195 - return nil
196 - }
197 - }
198 -
199 - override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
200 - if (section == 0) {
201 - return 0.0
202 -
203 - } else if (section == 1) {
204 - if (self.items.count > 0) {
205 - return 50.0
206 - } else {
207 - return 0.0
208 - }
209 -
210 - } else {
211 - return 0.0
212 - }
213 - }
214 -
215 - override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
216 -// return CGFloat.leastNormalMagnitude
217 - if (section == 1 && self.items.count > 0) {
218 - return 20.0
219 - } else {
220 - return 0.0
221 - }
222 - }
223 -
224 - override func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
225 - if (section == 1) {
226 - if (self.items.count > 0) {
227 - let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 30))
228 -
229 - let viewBorder = UIView(frame: CGRect(x: 10, y: 0, width: view.frame.width-20, height: view.frame.height))
230 - viewBorder.backgroundColor = .white
231 - // viewBorder.backgroundColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00)
232 -
233 - viewBorder.layer.cornerRadius = 16.5
234 - viewBorder.layer.maskedCorners = [ .layerMinXMaxYCorner, .layerMaxXMaxYCorner] // bottom left, bottom right corner radius
235 -
236 - let viewInner = UIView(frame: CGRect(x: 1, y: 0, width: viewBorder.frame.width-2, height: viewBorder.frame.height-1))
237 - viewInner.backgroundColor = .white
238 -
239 - viewInner.layer.cornerRadius = 16.5
240 - viewInner.layer.maskedCorners = [ .layerMinXMaxYCorner, .layerMaxXMaxYCorner] // bottom left, bottom right corner radius
241 -
242 - view.addSubview(viewBorder)
243 - viewBorder.addSubview(viewInner)
244 - return view
245 - } else {
246 - return nil
247 - }
248 -
249 - } else {
250 - return nil
251 - }
252 - }
253 -}
1 -//
2 -// InboxTableViewCell.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 24/6/22.
6 -//
7 -
8 -import UIKit
9 -
10 -@objc public class InboxTableViewCell: UITableViewCell {
11 - @IBOutlet weak var inboxView: UIView!
12 - @IBOutlet weak var campaignImage: UIImageView!
13 - @IBOutlet weak var newBadgeImage: UIImageView!
14 - @IBOutlet weak var campaignTitleLabel: UILabel!
15 -
16 - var postImageURL: String? {
17 - didSet {
18 - if let url = postImageURL {
19 - self.campaignImage.image = UIImage() // UIImage(named: "loading")
20 -
21 - UIImage.loadImageUsingCacheWithUrlString(url) { image in
22 - // set the image only when we are still displaying the content for the image we finished downloading
23 - if url == self.postImageURL {
24 - self.campaignImage.image = image
25 - }
26 - }
27 - }
28 - else {
29 - self.campaignImage.image = nil
30 - }
31 - }
32 - }
33 -
34 - public override func awakeFromNib() {
35 - super.awakeFromNib()
36 -
37 - // Add shadow
38 - self.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
39 - self.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
40 - self.layer.shadowOpacity = 1.0
41 - self.layer.shadowRadius = 1.0
42 -
43 - inboxView.layer.cornerRadius = 16.0
44 - inboxView.clipsToBounds = true
45 -
46 - newBadgeImage.image = UIImage(named: "new_icon_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
47 -
48 - newBadgeImage.isHidden = true
49 - }
50 -
51 - public override func setSelected(_ selected: Bool, animated: Bool) {
52 - super.setSelected(selected, animated: animated)
53 -
54 - // Configure the view for the selected state
55 - }
56 -
57 - public override func layoutSubviews() {
58 - super.layoutSubviews()
59 - //set the values for top,left,bottom,right margins
60 - let margins = UIEdgeInsets(top: 0, left: 0, bottom: 10, right: 0)
61 - contentView.frame = contentView.frame.inset(by: margins)
62 - }
63 -
64 -
65 - func configureCell(campaign: swiftApi.CampaignItemModel) {
66 - // campaignImage.load(link: campaign.logo_url ?? "", placeholder: UIImage(), cache: URLCache())
67 - self.postImageURL = campaign.logo_url ?? ""
68 -
69 - campaignTitleLabel.text = campaign.title ?? ""
70 -
71 - if (campaign.is_new == true) {
72 - newBadgeImage.isHidden = false
73 - } else{
74 - newBadgeImage.isHidden = true
75 - }
76 - }
77 -
78 - func configureCell(ccms: swiftApi.LoyaltyContextualOfferModel) {
79 - // campaignImage.load(link: ccms._imageUrl , placeholder: UIImage(), cache: URLCache())
80 - self.postImageURL = ccms._imageUrl
81 -
82 - campaignTitleLabel.text = ccms._title
83 -
84 - newBadgeImage.isHidden = true
85 - }
86 -
87 -}
1 -//
2 -// LoyaltyAnalysisViewController.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 18/7/22.
6 -//
7 -
8 -import UIKit
9 -import SwiftEventBus
10 -
11 -@objc public class LoyaltyAnalysisViewController: UIViewController {
12 -
13 - @IBOutlet weak var leftButton: UIButton!
14 - @IBOutlet weak var rightButton: UIButton!
15 - @IBOutlet weak var leftLineView: UIView!
16 - @IBOutlet weak var rightLineView: UIView!
17 - @IBOutlet weak var contentView: UIView!
18 - var pageController: UIPageViewController!
19 - var tabSelected = 0
20 -
21 - var timerHistory: DispatchSourceTimer?
22 - var seconds: Int = 0
23 -
24 - public override func viewDidLoad() {
25 - super.viewDidLoad()
26 -
27 - self.hidesBottomBarWhenPushed = true
28 -
29 - // setup view
30 - setBackButton()
31 - setNavigationTitle("Ανάλυση")
32 -
33 - // tab
34 - leftButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 15)
35 - leftButton.setTitle("Εξαργυρωμένα", for:.normal)
36 - leftButton.backgroundColor = . clear
37 - leftButton.setTitleColor(UIColor(rgb: 0x212121), for:.normal)
38 -
39 - rightButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 15)
40 - rightButton.setTitle("Μοιρασμένα δώρα", for:.normal)
41 - rightButton.backgroundColor = . clear
42 - rightButton.setTitleColor(UIColor(rgb: 0x848484), for:.normal)
43 -
44 -// leftLineView.applyGradient(colours: [UIColor(rgb: 0x1DA6B9), UIColor(rgb: 0xB2CE69)], gradient: GradientOrientation.horizontal, cornerRadius: 0.0)
45 -// rightLineView.applyGradient(colours: [UIColor(rgb: 0x1DA6B9), UIColor(rgb: 0xB2CE69)], gradient: GradientOrientation.horizontal, cornerRadius: 0.0)
46 -
47 - leftLineView.isHidden = false
48 - rightLineView.isHidden = true
49 -
50 - // pages
51 - pageController = UIPageViewController(transitionStyle:.scroll, navigationOrientation:.horizontal)
52 - pageController.dataSource = self;
53 - pageController.delegate = self;
54 -
55 - pageController.view.frame = contentView.bounds;
56 - addChild(pageController)
57 - contentView.addSubview(pageController.view)
58 - pageController .didMove(toParent: self)
59 -
60 - let analysisVC = self.viewControllerAt(0)
61 - pageController.setViewControllers([analysisVC!], direction:.forward, animated:false)
62 - }
63 -
64 - public override func viewWillAppear(_ animated: Bool) {
65 - super.viewWillAppear(animated)
66 -
67 - swiftApi().logTrackersEvent("screen", "LoyaltyHistoryScreen")
68 -
69 - self.startTimer()
70 -
71 - self.navigationController?.hideHairline()
72 - }
73 -
74 - public override func viewWillDisappear(_ animated: Bool) {
75 - super.viewWillDisappear(animated)
76 -
77 - self.stopTimer()
78 - }
79 -
80 - // MARK: - Functions
81 - func startTimer() {
82 - print("========= GiftsCalculator Timer Started! =========")
83 -
84 - let queue = DispatchQueue(label: Bundle.main.bundleIdentifier! + ".history.timer")
85 - timerHistory = DispatchSource.makeTimerSource(queue: queue)
86 - timerHistory!.schedule(deadline: .now(), repeating: .seconds(1))
87 - timerHistory!.setEventHandler { [weak self] in
88 - // do whatever stuff you want on the background queue here here
89 - print("========= GiftsCalculator interval! =========")
90 -
91 - DispatchQueue.main.async {
92 - // update your model objects and/or UI here
93 - self?.seconds = (self?.seconds ?? 0) + 1
94 -
95 - }
96 - }
97 - timerHistory!.resume()
98 - }
99 -
100 - func stopTimer() {
101 - print("========= GiftsCalculator Timer Stopped! =========")
102 - timerHistory?.cancel()
103 - timerHistory = nil
104 -
105 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
106 - firebaseEvent._eventName = "time_spent_on_loyalty_sdk"
107 - firebaseEvent.setParameter = ("name", "GiftsCalculator")
108 - firebaseEvent.setParameter = ("seconds", String(seconds))
109 - SwiftEventBus.post("firebase", sender: firebaseEvent)
110 -
111 - seconds = 0
112 - }
113 -
114 - ////////////////////////////////////////////////////////////////////////////////
115 - private func viewControllerAt(_ index:Int) -> AnalysisChildViewController?
116 - {
117 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
118 -
119 - if (index == 1) {
120 - swiftApi().logTrackersEvent("click", ("LoyaltyHistoryScreen:" + "TabShared"))
121 -
122 - let analysisVC = storyboard.instantiateViewController(withIdentifier:"SharingHistoryViewController") as! SwiftWarplyFramework.SharingHistoryViewController
123 - analysisVC.index = index;
124 -
125 - return analysisVC;
126 - }
127 -
128 - swiftApi().logTrackersEvent("click", ("LoyaltyHistoryScreen:" + "TabExpired"))
129 -
130 - let analysisVC = storyboard.instantiateViewController(withIdentifier:"HistoryViewController") as! SwiftWarplyFramework.HistoryViewController
131 - analysisVC.index = index;
132 -
133 - return analysisVC;
134 - }
135 -
136 - // MARK: - Handlers
137 - @IBAction func handleLeft() {
138 - if (tabSelected != 0) {
139 - self.tabSelected = 0
140 -
141 - UIView.animate(withDuration: 2.0, delay: 0.0) {
142 -
143 - self.leftLineView.isHidden = false
144 - self.rightLineView.isHidden = true
145 -
146 - self.leftButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 15)
147 - self.rightButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 15)
148 -
149 - self.leftButton.setTitleColor(UIColor(rgb: 0x212121), for:.normal)
150 - self.rightButton.setTitleColor(UIColor(rgb: 0x848484), for:.normal)
151 - }
152 - let analysisVC = self.viewControllerAt(0)
153 - pageController.setViewControllers([analysisVC!], direction:.reverse, animated:true)
154 - }
155 - }
156 -
157 - @IBAction func handleRight() {
158 - if (tabSelected != 1) {
159 - self.tabSelected = 1
160 -
161 - UIView.animate(withDuration: 2.0, delay: 0.0) {
162 -
163 - self.leftLineView.isHidden = true
164 - self.rightLineView.isHidden = false
165 -
166 - self.leftButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 15)
167 - self.rightButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 15)
168 -
169 - self.rightButton.setTitleColor(UIColor(rgb: 0x212121), for:.normal)
170 - self.leftButton.setTitleColor(UIColor(rgb: 0x848484), for:.normal)
171 - }
172 - let analysisVC = self.viewControllerAt(1)
173 - pageController.setViewControllers([analysisVC!], direction:.forward, animated:true)
174 - }
175 - }
176 -}
177 -
178 -// MARK: - PageViewController
179 -extension LoyaltyAnalysisViewController: UIPageViewControllerDataSource, UIPageViewControllerDelegate {
180 -
181 - public func pageViewController(_ pageViewController: UIPageViewController, viewControllerBefore viewController: UIViewController) -> UIViewController? {
182 -
183 - if let analysisVC = viewController as? AnalysisChildViewController {
184 - var index = analysisVC.index
185 - if (index == 0) {
186 - return nil;
187 - }
188 -
189 - index -= 1;
190 - return viewControllerAt(index);
191 - }
192 -
193 - return nil;
194 - }
195 -
196 - public func pageViewController(_ pageViewController: UIPageViewController, viewControllerAfter viewController: UIViewController) -> UIViewController? {
197 -
198 - if let analysisVC = viewController as? AnalysisChildViewController {
199 - var index = analysisVC.index
200 - if (index == 1) {
201 - return nil;
202 - }
203 -
204 - index += 1;
205 - return viewControllerAt(index);
206 - }
207 -
208 - return nil;
209 - }
210 -
211 -
212 - public func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) {
213 -
214 - if (!completed) {
215 - return;
216 - }
217 -
218 - if let childVCs = pageViewController.viewControllers as? [AnalysisChildViewController] {
219 - let currentIndex = childVCs[0].index
220 - if (currentIndex == 0) {
221 - self.leftButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 15)
222 - self.rightButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 15)
223 - self.leftButton.setTitleColor(UIColor(rgb: 0x212121), for:.normal)
224 - self.rightButton.setTitleColor(UIColor(rgb: 0x848484), for:.normal)
225 - self.tabSelected = 0
226 - self.leftLineView.isHidden = false
227 - self.rightLineView.isHidden = true
228 -
229 - } else {
230 - self.leftButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 15)
231 - self.rightButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 15)
232 - self.rightButton.setTitleColor(UIColor(rgb: 0x212121), for:.normal)
233 - self.leftButton.setTitleColor(UIColor(rgb: 0x848484), for:.normal)
234 - self.tabSelected = 1
235 - self.leftLineView.isHidden = true
236 - self.rightLineView.isHidden = false
237 - }
238 - }
239 - }
240 -}
1 -//
2 -// LoyaltyHistoryViewController.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 25/10/23.
6 -//
7 -
8 -import Foundation
9 -import UIKit
10 -import SwiftEventBus
11 -
12 -@objc public class LoyaltyHistoryViewController: UIViewController {
13 - @IBOutlet weak var sectionTitleLabel: UILabel!
14 - @IBOutlet weak var historySectionView: UIView!
15 -
16 - @IBOutlet weak var sumBadgeImage: UIImageView!
17 - @IBOutlet weak var sumBadgeLabel: UILabel!
18 - @IBOutlet weak var sumBannerLabel: UILabel!
19 -
20 - @IBOutlet weak var dfyBannerParentView: UIView!
21 - @IBOutlet weak var dfyBannerInnerParentView: UIView!
22 - @IBOutlet weak var dfyBannerInnerView: UIView!
23 - @IBOutlet weak var dfyBadgeImage: UIImageView!
24 - @IBOutlet weak var dfyBadgeLabel: UILabel!
25 - @IBOutlet weak var dfyBannerLabel: UILabel!
26 -
27 - @IBOutlet weak var marketBannerParentView: UIView!
28 - @IBOutlet weak var marketBannerInnerView: UIView!
29 - @IBOutlet weak var marketBadgeImage: UIImageView!
30 - @IBOutlet weak var marketBadgeLabel: UILabel!
31 - @IBOutlet weak var marketBannerLabel: UILabel!
32 -
33 - @IBOutlet weak var gfyBannerParentView: UIView!
34 - @IBOutlet weak var gfyBannerInnerView: UIView!
35 - @IBOutlet weak var couponBadgeImage: UIImageView!
36 - @IBOutlet weak var couponBadgeLabel: UILabel!
37 - @IBOutlet weak var gfyBannerLabel: UILabel!
38 -
39 - @IBOutlet weak var boxBannerParentView: UIView!
40 - @IBOutlet weak var boxBannerInnerParentView: UIView!
41 - @IBOutlet weak var boxBannerInnerView: UIView!
42 - @IBOutlet weak var boxBadgeImage: UIImageView!
43 - @IBOutlet weak var boxBadgeLabel: UILabel!
44 - @IBOutlet weak var boxBannerLabel: UILabel!
45 -
46 - public var coupons:Array<swiftApi.CouponItemModel> = swiftApi().getCouponList()
47 - public var dfyCoupons:Array<swiftApi.ActiveDFYCouponModel> = swiftApi().getActiveDFYCoupons()
48 - public var unifiedCoupons:Array<swiftApi.UnifiedCouponModel> = []
49 - public var loyaltyBadge:swiftApi.LoyaltyBadgeModel = swiftApi().getLoyaltyBadge()
50 - public var boxCoupons:Array<swiftApi.ActiveBoxCouponModel> = swiftApi().getActiveBoxCoupons()
51 -
52 - var totalCouponValue = swiftApi().getDealsCouponsSum()
53 - var totalCouponDiscount = Float(round(100 * swiftApi().getLoyaltyBadge()._value) / 100)
54 - var unifiedCouponsDiscount:Float = 0.0
55 - var boxCouponValue = swiftApi().getBoxCouponsSum()
56 -
57 -
58 - public override func viewDidLoad() {
59 - super.viewDidLoad()
60 -
61 - self.hidesBottomBarWhenPushed = true
62 -
63 - SwiftEventBus.onBackgroundThread(self, name: "coupons_fetched") { result in
64 -
65 - DispatchQueue.main.async {
66 - self.coupons = swiftApi().getCouponList()
67 - self.totalCouponDiscount = Float(round(100 * swiftApi().getLoyaltyBadge()._value) / 100)
68 - self.loyaltyBadge = swiftApi().getLoyaltyBadge()
69 -// self.tableView.reloadData()
70 - self.updateUI()
71 - }
72 - }
73 -
74 - SwiftEventBus.onBackgroundThread(self, name: "unified_coupons_fetched") { result in
75 -
76 - DispatchQueue.main.async {
77 - self.unifiedCoupons = swiftApi().getUnifiedCouponList()
78 -
79 - self.matchOldSMCoupons()
80 - self.updateMarketBadge()
81 -// self.tableView.reloadData()
82 - self.updateUI()
83 - }
84 - }
85 -
86 - SwiftEventBus.onBackgroundThread(self, name: "navigation_back") { result in
87 -
88 - DispatchQueue.main.async {
89 - self.navigationController?.popViewController(animated: true)
90 - }
91 - }
92 -
93 -// setBackButton()
94 - setBackButton("ic_close_3")
95 - setNavigationTitle("Ιστορικό")
96 -
97 - // === images === //
98 -
99 - sumBadgeImage.image = UIImage(named: "history_heart", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
100 - dfyBadgeImage.image = UIImage(named: "history_banner_dfy", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
101 - marketBadgeImage.image = UIImage(named: "history_banner_sm", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
102 - couponBadgeImage.image = UIImage(named: "history_banner_gfy", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
103 - boxBadgeImage.image = UIImage(named: "history_banner_box", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
104 -
105 - sectionTitleLabel.text = "Εξαργυρωμένα κουπόνια"
106 -
107 - historySectionView.backgroundColor = .white
108 - historySectionView.layer.cornerRadius = 16.0
109 - // historySectionView.layer.borderWidth = 1
110 - // historySectionView.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor
111 -
112 - // Add shadow
113 - historySectionView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
114 - historySectionView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
115 - historySectionView.layer.shadowOpacity = 1.0
116 - historySectionView.layer.shadowRadius = 2.0
117 -
118 - }
119 -
120 - public override func viewWillAppear(_ animated: Bool) {
121 - super.viewWillAppear(animated)
122 -
123 - swiftApi().logTrackersEvent("screen", "LoyaltyHistoryScreen")
124 -
125 - // addNavShadow()
126 - self.navigationController?.hideHairline()
127 -
128 - self.coupons = swiftApi().getCouponList()
129 - self.unifiedCoupons = swiftApi().getUnifiedCouponList()
130 - self.dfyCoupons = swiftApi().getActiveDFYCoupons()
131 - self.boxCoupons = swiftApi().getActiveBoxCoupons()
132 -
133 - self.matchOldSMCoupons()
134 - self.updateMarketBadge()
135 -// self.tableView.reloadData()
136 - self.updateUI()
137 - }
138 -
139 -// public override func viewWillDisappear(_ animated: Bool) {
140 -// super.viewWillDisappear(animated)
141 -//
142 -// self.navigationController?.navigationBar.layer.shadowOpacity = 0.0
143 -//
144 -// }
145 -
146 - // MARK: - Functions
147 - func updateMarketBadge() {
148 - unifiedCouponsDiscount = 0.0
149 -// for smCouponSet in swiftApi().getCouponSetsDealsList() {
150 -// for oldCoupon in swiftApi().getAllOldCouponList() {
151 -// if (smCouponSet.uuid != "" && oldCoupon.couponset_uuid != "" && smCouponSet.uuid == oldCoupon.couponset_uuid) {
152 -//
153 -// oldCoupon.setCouponSetData(smCouponSet);
154 -//
155 -// if let discountFloat = Float(oldCoupon.discount ?? "0.0") {
156 -// unifiedCouponsDiscount += discountFloat
157 -// }
158 -// break;
159 -// }
160 -// }
161 -// }
162 -
163 - for coupon in swiftApi().getOldUnifiedCouponList() {
164 - if let discountFloat = Float(coupon.discount ?? "0.0") {
165 - unifiedCouponsDiscount += discountFloat
166 - }
167 - }
168 -
169 - // TODO: UNCOMMENT if emptyView is needed again
170 -// if (totalCouponValue == 0.0 && loyaltyBadge._couponCount == 0 && dfyCoupons.count == 0 && coupons.count == 0 && unifiedCoupons.count == 0 && unifiedCouponsDiscount == 0.0) {
171 -// emptyView.isHidden = false
172 -// emptyViewHeight.constant = emptyView.intrinsicContentSize.height
173 -// } else {
174 -// emptyView.isHidden = true
175 -// emptyViewHeight.constant = 0
176 -// }
177 - }
178 -
179 - func matchOldSMCoupons() {
180 - var oldUnifiedCouponsArray:Array<swiftApi.CouponItemModel> = []
181 -
182 - // TODO: Check - Old implementation
183 -// for smCouponSet in swiftApi().getCouponSetsDealsList() {
184 -// for oldCoupon in swiftApi().getAllOldCouponList() {
185 -// if (smCouponSet.uuid != "" && oldCoupon.couponset_uuid != "" && smCouponSet.uuid == oldCoupon.couponset_uuid) {
186 -//
187 -// oldCoupon.setCouponSetData(smCouponSet);
188 -// oldUnifiedCouponsArray.append(oldCoupon);
189 -//
190 -// break;
191 -// }
192 -// }
193 -// }
194 -
195 - // TODO: DELETE - TEST
196 -// oldUnifiedCouponsArray = swiftApi().getAllOldCouponList().filter({ return $0.couponset_data?.couponset_type == "supermarket" })
197 - oldUnifiedCouponsArray = swiftApi().getSMOldCouponList()
198 -
199 - oldUnifiedCouponsArray.sort(by: {
200 - let date1 = $0.redeemed_date
201 - let date2 = $1.redeemed_date
202 -
203 - if ((date1 != nil) && (date2 != nil)) {
204 - return date1!.compare(date2!) == .orderedDescending
205 - } else {
206 - return false
207 - }
208 -
209 - })
210 - swiftApi().setOldUnifiedCouponList(oldUnifiedCouponsArray)
211 - }
212 -
213 - func updateUI() {
214 - let attrRegular = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-Regular", size: 14) ?? UIFont.systemFont(ofSize: 13), NSAttributedString.Key.foregroundColor: UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)]
215 - let attrBold = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-SBold", size: 14) ?? UIFont.boldSystemFont(ofSize: 13), NSAttributedString.Key.foregroundColor: UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)]
216 -
217 - // === SUM banner === //
218 -
219 - let sumRewards = totalCouponValue + totalCouponDiscount + unifiedCouponsDiscount + boxCouponValue
220 -
221 -// sumRewards = Float(round(100 * sumRewards) / 100)
222 - var sumRewardsString = "0"
223 - sumRewardsString = String(format: "%.2f", sumRewards).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
224 - sumBadgeLabel.text = sumRewardsString + "€"
225 -
226 - sumBannerLabel.text = "Δες αναλυτικά το συνολικό όφελός σου έως τώρα από κουπόνια"
227 -
228 - // === DFY banner === //
229 -
230 - dfyBannerParentView.backgroundColor = .clear
231 - dfyBannerInnerParentView.backgroundColor = .white
232 -// dfyBannerInnerView.backgroundColor = UIColor(red: 0.46, green: 0.75, blue: 0.45, alpha: 0.05)
233 - dfyBannerInnerView.backgroundColor = .white
234 - dfyBannerInnerParentView.layer.cornerRadius = 16.0
235 - dfyBannerInnerView.layer.cornerRadius = 16.0
236 - // dfyBannerInnerView.layer.borderWidth = 1
237 - // dfyBannerInnerView.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor
238 -
239 - dfyBannerParentView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
240 - dfyBannerParentView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
241 - dfyBannerParentView.layer.shadowOpacity = 1.0
242 - dfyBannerParentView.layer.shadowRadius = 2.0
243 -
244 - let totalCouponValueFixed = Float(round(100 * totalCouponValue) / 100)
245 - var totalCouponValueString = "0"
246 - totalCouponValueString = String(format: "%.2f", totalCouponValueFixed).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
247 - dfyBadgeLabel.text = totalCouponValueString + "€"
248 -
249 - let dfyNormalText1 = "Μέχρι τώρα έχεις όφελος "
250 - let dfyBoldText = totalCouponValueString + "€"
251 - let dfyNormalText2 = " από τα DEALS FOR YOU"
252 -
253 - let dfyAttributedString = NSMutableAttributedString(string:dfyNormalText1, attributes:attrRegular)
254 - let dfyBoldString = NSMutableAttributedString(string: dfyBoldText, attributes:attrBold)
255 - let dfyNormalString = NSMutableAttributedString(string:dfyNormalText2, attributes:attrRegular)
256 -
257 - dfyAttributedString.append(dfyBoldString)
258 - dfyAttributedString.append(dfyNormalString)
259 - dfyBannerLabel.attributedText = dfyAttributedString
260 -
261 - // === MARKET banner === //
262 -
263 - marketBannerParentView.backgroundColor = .clear
264 -// marketBannerInnerView.backgroundColor = UIColor(red: 1.00, green: 0.99, blue: 0.97, alpha: 1.00)
265 - marketBannerInnerView.backgroundColor = .white
266 - marketBannerInnerView.layer.cornerRadius = 16.0
267 - // marketBannerInnerView.layer.borderWidth = 1
268 - // marketBannerInnerView.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor
269 -
270 - marketBannerParentView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
271 - marketBannerParentView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
272 - marketBannerParentView.layer.shadowOpacity = 1.0
273 - marketBannerParentView.layer.shadowRadius = 2.0
274 -
275 - let marketDiscount = Float(round(100 * unifiedCouponsDiscount) / 100)
276 - var marketDiscountString = "0"
277 - marketDiscountString = String(format: "%.2f", marketDiscount).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
278 -
279 - self.marketBadgeLabel.text = marketDiscountString + "€"
280 -
281 - let marketNormalText1 = "Μέχρι τώρα έχεις όφελος "
282 - let marketBoldText = marketDiscountString + "€"
283 - let marketNormalText2 = " από τα SUPERMARKET DEALS!"
284 -
285 - let marketAttributedString = NSMutableAttributedString(string:marketNormalText1, attributes:attrRegular)
286 - let marketBoldString = NSMutableAttributedString(string: marketBoldText, attributes:attrBold)
287 - let marketNormalString = NSMutableAttributedString(string:marketNormalText2, attributes:attrRegular)
288 -
289 - marketAttributedString.append(marketBoldString)
290 - marketAttributedString.append(marketNormalString)
291 - marketBannerLabel.attributedText = marketAttributedString
292 -
293 - // === GFY banner === //
294 -
295 - gfyBannerParentView.backgroundColor = .clear
296 -// gfyBannerInnerView.backgroundColor = UIColor(red: 0.96, green: 0.97, blue: 0.98, alpha: 1.00)
297 - gfyBannerInnerView.backgroundColor = .white
298 - gfyBannerInnerView.layer.cornerRadius = 16.0
299 - // gfyBannerInnerView.layer.borderWidth = 1
300 - // gfyBannerInnerView.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor
301 -
302 - gfyBannerParentView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
303 - gfyBannerParentView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
304 - gfyBannerParentView.layer.shadowOpacity = 1.0
305 - gfyBannerParentView.layer.shadowRadius = 2.0
306 -
307 - var totalCouponDiscountString = "0"
308 - totalCouponDiscountString = String(format: "%.2f", totalCouponDiscount).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
309 - couponBadgeLabel.text = totalCouponDiscountString + "€"
310 -
311 - let gfyNormalText1 = "Μέχρι τώρα έχεις όφελος "
312 - let gfyBoldText = totalCouponDiscountString + "€"
313 - let gfyNormalText2 = " από τα FREE COUPONS"
314 -// let gfyNormalText2 = " από τα GIFTS FOR YOU"
315 -
316 - let gfyAttributedString = NSMutableAttributedString(string:gfyNormalText1, attributes:attrRegular)
317 - let gfyBoldString = NSMutableAttributedString(string: gfyBoldText, attributes:attrBold)
318 - let gfyNormalString = NSMutableAttributedString(string:gfyNormalText2, attributes:attrRegular)
319 -
320 - gfyAttributedString.append(gfyBoldString)
321 - gfyAttributedString.append(gfyNormalString)
322 - gfyBannerLabel.attributedText = gfyAttributedString
323 -
324 - // === BOX banner === //
325 -
326 - boxBannerParentView.backgroundColor = .clear
327 - boxBannerInnerParentView.backgroundColor = .white
328 -// boxBannerInnerView.backgroundColor = UIColor(red: 0.46, green: 0.75, blue: 0.45, alpha: 0.05)
329 - boxBannerInnerView.backgroundColor = .white
330 - boxBannerInnerParentView.layer.cornerRadius = 16.0
331 - boxBannerInnerView.layer.cornerRadius = 16.0
332 - // boxBannerInnerView.layer.borderWidth = 1
333 - // boxBannerInnerView.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor
334 -
335 - boxBannerParentView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
336 - boxBannerParentView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
337 - boxBannerParentView.layer.shadowOpacity = 1.0
338 - boxBannerParentView.layer.shadowRadius = 2.0
339 -
340 - let boxCouponValueFixed = Float(round(100 * boxCouponValue) / 100)
341 - var boxCouponValueString = "0"
342 - boxCouponValueString = String(format: "%.2f", boxCouponValueFixed).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
343 - boxBadgeLabel.text = boxCouponValueString + "€"
344 -
345 - let boxNormalText1 = "Μέχρι τώρα έχεις όφελος "
346 - let boxBoldText = boxCouponValueString + "€"
347 - let boxNormalText2 = " από το BOX"
348 -
349 - let boxAttributedString = NSMutableAttributedString(string:boxNormalText1, attributes:attrRegular)
350 - let boxBoldString = NSMutableAttributedString(string: boxBoldText, attributes:attrBold)
351 - let boxNormalString = NSMutableAttributedString(string:boxNormalText2, attributes:attrRegular)
352 -
353 - boxAttributedString.append(boxBoldString)
354 - boxAttributedString.append(boxNormalString)
355 - boxBannerLabel.attributedText = boxAttributedString
356 -
357 - }
358 -
359 - // MARK: - Actions
360 - @IBAction func dfyBannerButtonAction(_ sender: Any) {
361 -// var totalCouponValue = swiftApi().getDealsCouponsSum()
362 -// if (totalCouponValue > 0.0) {
363 - print("DFY coupon banner pressed!")
364 - // analysis_pressed event
365 - let dealsAnalysis = swiftApi.WarplyDealsAnalysisEventModel()
366 - dealsAnalysis._isPressed = true
367 - SwiftEventBus.post("analysis_pressed", sender: dealsAnalysis)
368 -
369 -// let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
370 -// firebaseEvent._eventName = "did_tap_gifts_for_you_badge"
371 -// firebaseEvent.setParameter = ("screen", "Loyalty History")
372 -// SwiftEventBus.post("firebase", sender: firebaseEvent)
373 -
374 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
375 - firebaseEvent._eventName = "did_tap_deals_for_you_badge"
376 - firebaseEvent.setParameter = ("screen", "Loyalty History")
377 - SwiftEventBus.post("firebase", sender: firebaseEvent)
378 -
379 - swiftApi().logTrackersEvent("click", ("LoyaltyHistoryScreen:" + "DealsBanner"))
380 -// }
381 - }
382 -
383 - @IBAction func gfyBannerButtonAction(_ sender: Any) {
384 -// if (loyaltyBadge._couponCount > 0) {
385 -// let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
386 -// firebaseEvent._eventName = "did_tap_deals_for_you_badge"
387 -// firebaseEvent.setParameter = ("screen", "Loyalty History")
388 -// SwiftEventBus.post("firebase", sender: firebaseEvent)
389 -
390 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
391 - firebaseEvent._eventName = "did_tap_gifts_for_you_badge"
392 - firebaseEvent.setParameter = ("screen", "Loyalty History")
393 - SwiftEventBus.post("firebase", sender: firebaseEvent)
394 -
395 - swiftApi().logTrackersEvent("click", ("LoyaltyHistoryScreen:" + "LoyaltyBanner"))
396 -
397 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
398 - let vc = storyboard.instantiateViewController(withIdentifier: "LoyaltyAnalysisViewController") as! SwiftWarplyFramework.LoyaltyAnalysisViewController
399 - self.navigationController?.pushViewController(vc, animated: true)
400 -// }
401 - }
402 -
403 - @IBAction func marketBannerButtonAction(_ sender: Any) {
404 -// if (self.unifiedCouponsDiscount > 0.0) {
405 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
406 - firebaseEvent._eventName = "did_tap_market_badge"
407 - firebaseEvent.setParameter = ("screen", "Loyalty History")
408 - SwiftEventBus.post("firebase", sender: firebaseEvent)
409 -
410 - swiftApi().logTrackersEvent("click", ("LoyaltyHistoryScreen:" + "MarketBanner"))
411 -
412 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
413 - let vc = storyboard.instantiateViewController(withIdentifier: "MarketLoyaltyAnalysisViewController") as! SwiftWarplyFramework.MarketLoyaltyAnalysisViewController
414 - self.navigationController?.pushViewController(vc, animated: true)
415 -// }
416 - }
417 -
418 - @IBAction func boxBannerButtonAction(_ sender: Any) {
419 - print("BOX coupon banner pressed!")
420 -
421 - // box_analysis_pressed event
422 - let dealsAnalysis = swiftApi.WarplyBoxAnalysisEventModel(self)
423 - dealsAnalysis._isPressed = true
424 - SwiftEventBus.post("box_analysis_pressed", sender: dealsAnalysis)
425 - // SwiftEventBus.post("box_analysis_pressed")
426 -
427 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
428 - firebaseEvent._eventName = "did_tap_box_badge"
429 - firebaseEvent.setParameter = ("screen", "Loyalty History")
430 - SwiftEventBus.post("firebase", sender: firebaseEvent)
431 -
432 - swiftApi().logTrackersEvent("click", ("LoyaltyHistoryScreen:" + "BoxBanner"))
433 - }
434 -}
1 -//
2 -// MFYInboxTableViewCell.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 24/6/22.
6 -//
7 -
8 -import UIKit
9 -
10 -@objc public class MFYInboxTableViewCell: UITableViewCell {
11 - @IBOutlet weak var inboxView: UIView!
12 - @IBOutlet weak var campaignImage: UIImageView!
13 - @IBOutlet weak var newBadgeImage: UIImageView!
14 - @IBOutlet weak var campaignTitleLabel: UILabel!
15 - @IBOutlet weak var curvedBgImage: UIImageView!
16 - @IBOutlet weak var subtitleLabel: UILabel!
17 - @IBOutlet weak var descriptionLabel: UILabel!
18 -
19 - var postImageURL: String? {
20 - didSet {
21 - if let url = postImageURL {
22 - self.campaignImage.image = UIImage() // UIImage(named: "loading")
23 -
24 - UIImage.loadImageUsingCacheWithUrlString(url) { image in
25 - // set the image only when we are still displaying the content for the image we finished downloading
26 - if url == self.postImageURL {
27 - self.campaignImage.image = image
28 - }
29 - }
30 - }
31 - else {
32 - self.campaignImage.image = nil
33 - }
34 - }
35 - }
36 -
37 - public override func awakeFromNib() {
38 - super.awakeFromNib()
39 -
40 -// inboxView.layer.cornerRadius = 5.0
41 -// inboxView.clipsToBounds = true
42 -
43 - // Add shadow
44 - self.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
45 - self.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
46 - self.layer.shadowOpacity = 1.0
47 - self.layer.shadowRadius = 1.0
48 -
49 - newBadgeImage.image = UIImage(named: "new_icon_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
50 - curvedBgImage.image = UIImage(named: "curved_bg_white_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
51 -
52 - newBadgeImage.isHidden = true
53 - }
54 -
55 - public override func setSelected(_ selected: Bool, animated: Bool) {
56 - super.setSelected(selected, animated: animated)
57 -
58 - // Configure the view for the selected state
59 - }
60 -
61 - public override func layoutSubviews() {
62 - super.layoutSubviews()
63 - //set the values for top,left,bottom,right margins
64 - let margins = UIEdgeInsets(top: 0, left: 0, bottom: 10, right: 0)
65 - contentView.frame = contentView.frame.inset(by: margins)
66 -
67 - // Add different corner radius - Do it here, otherwise it won't be applied to all cells
68 - inboxView.roundCorners(topLeft: 20, topRight: 45, bottomLeft: 20, bottomRight: 0)
69 -
70 -// // Delete extra borderLayers added
71 -// for layer in (inboxView.layer.sublayers ?? []) {
72 -// if(layer.name == "MFYItemBorderLayer"){
73 -// layer.removeFromSuperlayer()
74 -// }
75 -// }
76 -//
77 -// // Add borderLayer
78 -// let borderLayer = CAShapeLayer()
79 -// borderLayer.path = (inboxView.layer.mask! as! CAShapeLayer).path! // Reuse the Bezier path
80 -// borderLayer.strokeColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor
81 -// borderLayer.fillColor = UIColor.clear.cgColor
82 -// borderLayer.lineWidth = 1
83 -// borderLayer.frame = inboxView.bounds
84 -// borderLayer.name = "MFYItemBorderLayer"
85 -// inboxView.layer.addSublayer(borderLayer)
86 - }
87 -
88 -
89 - func configureCell(campaign: swiftApi.CampaignItemModel) {
90 - // campaignImage.load(link: campaign.logo_url ?? "", placeholder: UIImage(), cache: URLCache())
91 - self.postImageURL = campaign.logo_url ?? ""
92 -
93 - campaignTitleLabel.text = campaign.title ?? ""
94 - campaignTitleLabel.font = UIFont(name: "BTCosmo-Bold", size: 17)
95 - subtitleLabel.text = campaign.subtitle ?? ""
96 - subtitleLabel.font = UIFont(name: "PeridotPE-Regular", size: 15)
97 - descriptionLabel.text = campaign.message ?? ""
98 - descriptionLabel.font = UIFont(name: "PeridotPE-SBold", size: 15)
99 -
100 - if (campaign.is_new == true) {
101 - newBadgeImage.isHidden = false
102 - } else{
103 - newBadgeImage.isHidden = true
104 - }
105 - }
106 -
107 - func configureCell(ccms: swiftApi.LoyaltyContextualOfferModel) {
108 - // campaignImage.load(link: ccms._imageUrl , placeholder: UIImage(), cache: URLCache())
109 - self.postImageURL = ccms._imageUrl
110 -
111 - campaignTitleLabel.text = ccms._title
112 - campaignTitleLabel.font = UIFont(name: "BTCosmo-Bold", size: 17)
113 - subtitleLabel.text = ccms._subtitle
114 - subtitleLabel.font = UIFont(name: "PeridotPE-Regular", size: 15)
115 - descriptionLabel.text = ccms._description
116 - descriptionLabel.font = UIFont(name: "PeridotPE-SBold", size: 15)
117 -
118 - newBadgeImage.isHidden = true
119 - }
120 -
121 -}
1 -//
2 -// MFYViewController.swift
3 -// WarplySDKFrameworkIOS
4 -//
5 -// Created by Βασιλης Σκουρας on 5/5/22.
6 -//
7 -
8 -import Foundation
9 -import UIKit
10 -import SwiftEventBus
11 -
12 -@objc public class MFYViewController: UIViewController {
13 - @IBOutlet weak var mainView: UIView!
14 - @IBOutlet weak var tableView: UITableView!
15 - @IBOutlet weak var topBorderShadow: UIImageView!
16 -
17 - var categories: Array<CampaignCategory> = [CampaignCategory]() {
18 - didSet {
19 - DispatchQueue.main.async {
20 - self.tableView.reloadData()
21 - }
22 - }
23 - }
24 -
25 - public var campaigns:Array<swiftApi.CampaignItemModel> = []
26 - public var loyaltyList:Array<swiftApi.CampaignItemModel> = swiftApi().mergeMFYCCMSLoyaltyCampaigns(campaigns: swiftApi().getCCMSLoyaltyCampaigns())
27 - public var ccmsList:Array<swiftApi.LoyaltyContextualOfferModel> = swiftApi().getCCMSLoyaltyCampaigns()
28 -
29 - var timerMFY: DispatchSourceTimer?
30 - var seconds: Int = 0
31 -
32 -
33 - public override func viewDidLoad() {
34 - super.viewDidLoad()
35 -
36 - self.hidesBottomBarWhenPushed = true
37 -
38 - setBackButton()
39 - setNavigationTitle("MORE FOR YOU", "bold")
40 -
41 - tableView.delegate = self
42 - tableView.dataSource = self
43 -
44 - SwiftEventBus.onMainThread(self, name: "ccms_retrieved") { result in
45 - print("===== SwiftEventBus ccms_retrieved =====")
46 - self.refreshData()
47 - }
48 -
49 - SwiftEventBus.onMainThread(self, name: "campaigns_retrieved") { result in
50 - print("===== SwiftEventBus campaigns_retrieved =====")
51 - self.refreshData()
52 - }
53 -
54 -// tableView.clipsToBounds = true
55 -// tableView.layer.cornerRadius = 30
56 -// tableView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
57 - tableView.contentInset.top = 10
58 -
59 - // Add Top left corner radius
60 -// mainView.clipsToBounds = true
61 -// mainView.layer.cornerRadius = 30
62 -// mainView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
63 - mainView.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1.00)
64 -
65 -// let image = UIImage(named: "top_border_shadow", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)!
66 -// var aspectR: CGFloat = 0.0
67 -//
68 -// aspectR = image.size.width/image.size.height
69 -//
70 -// topBorderShadow.translatesAutoresizingMaskIntoConstraints = false
71 -// topBorderShadow.image = image
72 -// topBorderShadow.contentMode = .scaleAspectFill
73 -//
74 -// NSLayoutConstraint.activate([
75 -// topBorderShadow.topAnchor.constraint(equalTo: mainView.topAnchor, constant: 0),
76 -// topBorderShadow.leadingAnchor.constraint(equalTo: mainView.leadingAnchor, constant: 0),
77 -// topBorderShadow.trailingAnchor.constraint(equalTo: mainView.trailingAnchor, constant: 0),
78 -// topBorderShadow.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.width),
79 -// topBorderShadow.heightAnchor.constraint(equalTo: topBorderShadow.widthAnchor, multiplier: 1/aspectR)
80 -// ])
81 -
82 - }
83 -
84 - public override func viewWillAppear(_ animated: Bool) {
85 - super.viewWillAppear(animated)
86 -
87 - swiftApi().logTrackersEvent("screen", "MoreForYouScreen")
88 -
89 - self.refreshData()
90 -
91 - self.startTimer()
92 -
93 - self.navigationController?.hideHairline()
94 - }
95 -
96 - public override func viewWillDisappear(_ animated: Bool) {
97 - super.viewWillDisappear(animated)
98 -
99 - self.stopTimer()
100 - }
101 -
102 - // MARK: - Functions
103 - func refreshData() -> Void {
104 - self.loyaltyList = swiftApi().mergeMFYCCMSLoyaltyCampaigns(campaigns: swiftApi().getCCMSLoyaltyCampaigns())
105 - self.ccmsList = swiftApi().getCCMSLoyaltyCampaigns()
106 - // var tempCampaigns:Array<swiftApi.CampaignItemModel> = loyaltyList
107 -
108 - var newData = [CampaignCategory]()
109 -
110 - // parse campaigns
111 - var campaignsDict = [String:CampaignCategory]()
112 - for item in loyaltyList {
113 - guard let title = item._category_title else {
114 - continue
115 - }
116 -
117 - if (title.isEmpty) {
118 - continue
119 - }
120 -
121 - var category = campaignsDict[title]
122 - if (category == nil) {
123 - category = CampaignCategory(title)
124 - campaignsDict[title] = category
125 - newData.append(category!)
126 - }
127 -
128 - category?.items.append(item)
129 - }
130 - newData = newData.sorted(by: { $0.index < $1.index })
131 -
132 - // parse ccms
133 - if (self.ccmsList.count > 0) {
134 - let category = CampaignCategory("ΑΛΛΕΣ")
135 - for ccmsItem in self.ccmsList {
136 - if (((ccmsItem._loyaltyCampaignId == "") || (ccmsItem._loyaltyCampaignId == "NA")) && (ccmsItem._zone == "COSMOTE_APP_MORE4U")) {
137 - let newCampaign = swiftApi.CampaignItemModel()
138 - newCampaign._title = ccmsItem._title
139 - newCampaign._logo_url = ccmsItem._imageUrl
140 - newCampaign._subtitle = ccmsItem._subtitle
141 - newCampaign._message = ccmsItem._message
142 - newCampaign._ccms = ccmsItem
143 - // tempCampaigns.append(newCampaign)
144 - category.items.append(newCampaign)
145 - }
146 - }
147 -
148 - if (category.items.count > 0) {
149 - newData.append(category)
150 - }
151 - }
152 -
153 - // self.campaigns = tempCampaigns
154 - self.categories = newData
155 - self.tableView.reloadData()
156 - }
157 -
158 - func startTimer() {
159 - print("========= MFY Timer Started! =========")
160 -
161 - let queue = DispatchQueue(label: Bundle.main.bundleIdentifier! + ".mfy.timer")
162 - timerMFY = DispatchSource.makeTimerSource(queue: queue)
163 - timerMFY!.schedule(deadline: .now(), repeating: .seconds(1))
164 - timerMFY!.setEventHandler { [weak self] in
165 - // do whatever stuff you want on the background queue here here
166 - print("========= MFY interval! =========")
167 -
168 - DispatchQueue.main.async {
169 - // update your model objects and/or UI here
170 - self?.seconds = (self?.seconds ?? 0) + 1
171 -
172 - }
173 - }
174 - timerMFY!.resume()
175 - }
176 -
177 - func stopTimer() {
178 - print("========= MFY Timer Stopped! =========")
179 - timerMFY?.cancel()
180 - timerMFY = nil
181 -
182 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
183 - firebaseEvent._eventName = "time_spent_on_loyalty_sdk"
184 - firebaseEvent.setParameter = ("name", "MoreForYou")
185 - firebaseEvent.setParameter = ("seconds", String(seconds))
186 - SwiftEventBus.post("firebase", sender: firebaseEvent)
187 -
188 - seconds = 0
189 - }
190 -
191 -}
192 -
193 -// MARK: - TableView
194 -extension MFYViewController: UITableViewDelegate, UITableViewDataSource{
195 -
196 - public func numberOfSections(in tableView: UITableView) -> Int {
197 - // return 1
198 - return self.categories.count
199 - }
200 -
201 - public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
202 - // return self.campaigns.count
203 - return self.categories[section].items.count
204 - }
205 -
206 - public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
207 - return 220.0 + 10.0
208 -// return UITableViewAutomaticDimension
209 - }
210 -
211 - public func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
212 - let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 43))
213 - view.backgroundColor = .clear
214 -
215 - let titleLabel = UILabel(frame: CGRect(x: 20, y: 5, width: view.frame.width - 20, height: 43))
216 - titleLabel.font = UIFont(name: "BTCosmo-Bold", size: 15)
217 - titleLabel.textColor = UIColor(rgb: 0x212121)
218 - titleLabel.text = categories[section].name
219 -
220 - view.addSubview(titleLabel)
221 - return view
222 - }
223 -
224 - public func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
225 - return 43
226 - }
227 -
228 - public func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
229 - return CGFloat.leastNormalMagnitude
230 - }
231 -
232 - public func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
233 - return nil
234 - }
235 -
236 - public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
237 - let cell = tableView.dequeueReusableCell(withIdentifier: "MFYInboxTableViewCellId", for: indexPath) as! MFYInboxTableViewCell
238 -
239 - let campaign = categories[indexPath.section].items[indexPath.row]
240 -
241 - let isCcmsOffer = (campaign.ccms_offer != nil) && (campaign.ccms_offer != "") && (campaign.ccms_offer == "true")
242 -
243 - if (campaign._type != nil && campaign._type == "telco") {
244 - let ccmsCampaigns = swiftApi().getCCMSLoyaltyCampaigns()
245 - let loyaltyCampaignIdExists = ccmsCampaigns.contains { $0._loyaltyCampaignId == campaign.session_uuid }
246 -
247 - if (loyaltyCampaignIdExists == true) {
248 - for item in ccmsCampaigns {
249 - if (item._loyaltyCampaignId == campaign.session_uuid) {
250 - cell.configureCell(ccms: item)
251 - break;
252 - }
253 - }
254 - }
255 -
256 - } else if (campaign.session_uuid != nil && campaign.session_uuid != "" && isCcmsOffer) {
257 -
258 - let ccmsCampaigns = swiftApi().getCCMSLoyaltyCampaigns()
259 - let loyaltyCampaignIdExists = ccmsCampaigns.contains { $0._loyaltyCampaignId == campaign.session_uuid }
260 -
261 - if (loyaltyCampaignIdExists == true) {
262 - for item in ccmsCampaigns {
263 - if (item._loyaltyCampaignId == campaign.session_uuid) {
264 - cell.configureCell(ccms: item)
265 - break;
266 - }
267 - }
268 - }
269 -
270 - } else {
271 - cell.configureCell(campaign: campaign)
272 - }
273 -
274 - return cell
275 - }
276 -
277 - public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
278 - let campaign = categories[indexPath.section].items[indexPath.row]
279 -
280 - if (campaign._ccms != nil) {
281 -
282 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
283 - firebaseEvent._eventName = "loyalty_sdk_offer_selected"
284 - firebaseEvent.setParameter = ("name", (campaign._ccms?._title ?? ""))
285 - firebaseEvent.setParameter = ("type", "gift")
286 - SwiftEventBus.post("firebase", sender: firebaseEvent)
287 -
288 - swiftApi().logTrackersEvent("click", ("Contextual:" + (campaign._ccms?._sessionId ?? "")))
289 -
290 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
291 - let vc = storyboard.instantiateViewController(withIdentifier: "ContextualViewController") as! SwiftWarplyFramework.ContextualViewController
292 - vc.ccms = campaign._ccms
293 - self.navigationController?.pushViewController(vc, animated: true)
294 -
295 - if let sessionUuid = campaign.session_uuid {
296 - getSingleCampaignAsyncRequest(sessionUuid: sessionUuid)
297 - }
298 -
299 - } else if (campaign._type != nil && campaign._type == "telco") {
300 - let ccmsCampaigns = swiftApi().getCCMSLoyaltyCampaigns()
301 - let loyaltyCampaignIdExists = ccmsCampaigns.contains { $0._loyaltyCampaignId == campaign.session_uuid }
302 -
303 - if (loyaltyCampaignIdExists == true) {
304 - for item in ccmsCampaigns {
305 - if (item._loyaltyCampaignId == campaign.session_uuid) {
306 -
307 - swiftApi().logTrackersEvent("click", ("Telco:" + (item._sessionId)))
308 -
309 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
310 - firebaseEvent._eventName = "loyalty_sdk_offer_selected"
311 - firebaseEvent.setParameter = ("name", (item._title))
312 - firebaseEvent.setParameter = ("type", "gift")
313 - SwiftEventBus.post("firebase", sender: firebaseEvent)
314 -
315 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
316 - let vc = storyboard.instantiateViewController(withIdentifier: "TelcoViewController") as! SwiftWarplyFramework.TelcoViewController
317 - vc.ccms = item
318 - vc.campaign = campaign
319 - self.navigationController?.pushViewController(vc, animated: true)
320 -
321 - if let sessionUuid = campaign.session_uuid {
322 - getSingleCampaignAsyncRequest(sessionUuid: sessionUuid)
323 - }
324 - }
325 - }
326 - }
327 -
328 - } else if (campaign._campaign_type == "coupon" && campaign._couponset != "" && campaign._couponset != nil) {
329 - let couponsetUuid = campaign._couponset
330 -
331 - if (couponsetUuid != "" && couponsetUuid != nil) {
332 - let couponsetsList = swiftApi().getCouponSetList()
333 -
334 - for item in couponsetsList {
335 - if (item.uuid == couponsetUuid) {
336 -
337 - swiftApi().logTrackersEvent("click", ("Loyalty:" + (campaign.session_uuid ?? "")))
338 -
339 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
340 - firebaseEvent._eventName = "loyalty_sdk_offer_selected"
341 - firebaseEvent.setParameter = ("name", (item.name ?? ""))
342 - firebaseEvent.setParameter = ("type", "coupon")
343 - SwiftEventBus.post("firebase", sender: firebaseEvent)
344 -
345 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
346 - let vc = storyboard.instantiateViewController(withIdentifier: "CouponViewController") as! SwiftWarplyFramework.CouponViewController
347 - vc.couponset = item
348 - vc.campaign = campaign
349 -
350 - let ccmsCampaigns = swiftApi().getCCMSLoyaltyCampaigns()
351 - let loyaltyCampaignIdExists = ccmsCampaigns.contains { $0._loyaltyCampaignId == campaign.session_uuid }
352 -
353 - if (loyaltyCampaignIdExists == true) {
354 - for item in ccmsCampaigns {
355 - if (item._loyaltyCampaignId == campaign.session_uuid) {
356 - vc.ccms = item
357 - break;
358 - }
359 - }
360 - }
361 -
362 - self.navigationController?.pushViewController(vc, animated: true)
363 -
364 - if let sessionUuid = campaign.session_uuid {
365 - getSingleCampaignAsyncRequest(sessionUuid: sessionUuid)
366 - }
367 -
368 - break;
369 - }
370 - }
371 - }
372 -
373 - } else {
374 - let status = swiftApi().getNetworkStatus()
375 - if (status == -1 || status == 0) {
376 - self.showDialog("Δεν υπάρχει σύνδεση","Αυτή τη στιγμή βρίσκεσαι εκτός σύνδεσης. Παρακαλούμε βεβαιώσου ότι είσαι συνδεδεμένος στο διαδίκτυο και προσπάθησε ξανά.")
377 - } else {
378 - // let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
379 - // let vc = storyboard.instantiateViewController(withIdentifier: "CampaignViewController") as! SwiftWarplyFramework.CampaignViewController
380 - // let url = swiftApi().constructCampaignUrl(campaign)
381 - // print("CampaignUrl url onclick: " + url)
382 - // vc.campaignUrl = url
383 - // self.navigationController?.pushViewController(vc, animated: true)
384 -
385 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
386 - let vc = storyboard.instantiateViewController(withIdentifier: "CampaignViewController") as! SwiftWarplyFramework.CampaignViewController
387 - var url = ""
388 - var params = ""
389 - let isCcmsOffer = (campaign.ccms_offer != nil) && (campaign.ccms_offer != "") && (campaign.ccms_offer == "true")
390 -
391 - if (isCcmsOffer) {
392 - let ccmsCampaigns = swiftApi().getCCMSLoyaltyCampaigns()
393 -
394 - let loyaltyCampaignIdExists = ccmsCampaigns.contains { $0._loyaltyCampaignId == campaign.session_uuid }
395 -
396 - if (loyaltyCampaignIdExists == true) {
397 - var ccmsCampaignFound:swiftApi.LoyaltyContextualOfferModel = swiftApi.LoyaltyContextualOfferModel()
398 - for item in ccmsCampaigns {
399 - if (item._loyaltyCampaignId == campaign.session_uuid) {
400 - ccmsCampaignFound = item
401 - }
402 - }
403 -
404 - swiftApi().logTrackersEvent("click", ("Contextual:" + (ccmsCampaignFound._sessionId)))
405 -
406 - url = swiftApi().constructCcmsUrl(campaign, ccmsCampaignFound)
407 - params = swiftApi().constructCcmsParams(campaign, ccmsCampaignFound)
408 -
409 - } else {
410 - url = swiftApi().constructCampaignUrl(campaign)
411 - params = swiftApi().constructCampaignParams(campaign)
412 -
413 - }
414 -
415 - let encoder = JSONEncoder()
416 - encoder.outputFormatting = .prettyPrinted
417 - let data = try! encoder.encode(campaign)
418 -
419 - print("CCMS_CLICK " + String(data: data, encoding: .utf8)!)
420 -
421 - } else {
422 - swiftApi().logTrackersEvent("click", ("Loyalty:" + (campaign.session_uuid ?? "")))
423 -
424 - url = swiftApi().constructCampaignUrl(campaign)
425 - params = swiftApi().constructCampaignParams(campaign)
426 -
427 - let encoder = JSONEncoder()
428 - encoder.outputFormatting = .prettyPrinted
429 - let data = try! encoder.encode(campaign)
430 -
431 - print("GFY_CLICK " + String(data: data, encoding: .utf8)!)
432 - }
433 - print("CampaignUrl url onclick: " + url)
434 - vc.campaignUrl = url
435 - vc.params = params
436 - self.navigationController?.pushViewController(vc, animated: true)
437 -
438 - if let sessionUuid = campaign.session_uuid {
439 - getSingleCampaignAsyncRequest(sessionUuid: sessionUuid)
440 - }
441 - }
442 - }
443 - }
444 -
445 -
446 - func getSingleCampaignAsyncRequest(sessionUuid: String) {
447 - swiftApi().getSingleCampaignAsync(sessionUuid: sessionUuid, getSingleCampaignCallback)
448 - }
449 -
450 - func getSingleCampaignCallback (_ getSingleCampaignData: swiftApi.VerifyTicketResponseModel?) -> Void {
451 - if (getSingleCampaignData != nil) {
452 - DispatchQueue.main.async {
453 - }
454 - } else {
455 - }
456 - }
457 -
458 - func showDialog(_ alertTitle: String, _ alertSubTitle: String) -> Void {
459 -
460 - let alert = UIAlertController(title: alertTitle, message: alertSubTitle, preferredStyle: .alert)
461 - alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
462 - switch action.style{
463 - case .default:
464 - print("default")
465 -
466 - case .cancel:
467 - print("cancel")
468 -
469 - case .destructive:
470 - print("destructive")
471 -
472 - }
473 - }))
474 - self.present(alert, animated: true, completion: nil)
475 - }
476 -
477 -}
This diff could not be displayed because it is too large.
1 -//
2 -// MakeItAPresentViewController.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Βασιλης Σκουρας on 11/5/22.
6 -//
7 -
8 -import Foundation
9 -import UIKit
10 -
11 -@objc public class MakeItAPresentViewController: UIViewController {
12 -
13 - public override func viewWillAppear(_ animated: Bool) {
14 - super.viewWillAppear(animated)
15 -
16 - self.hidesBottomBarWhenPushed = true
17 - setBackButton()
18 - setNavigationTitle("Κάνε δώρο")
19 - }
20 -
21 -
22 -}
1 -//
2 -// MapsViewController.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 20/9/22.
6 -//
7 -
8 -import UIKit
9 -import MapKit
10 -
11 -@objc public class MapsViewController: UIViewController, MKMapViewDelegate {
12 - // ui
13 - @IBOutlet weak var mainView: UIView!
14 - @IBOutlet weak var backgroundImage: UIImageView!
15 - @IBOutlet private var mapView: MKMapView!
16 -
17 - @IBOutlet weak var closeButton: UIButton!
18 - @IBOutlet private var titleView: UILabel!
19 - @IBOutlet private var nameImageView: UIImageView!
20 - @IBOutlet private var nameView: UILabel!
21 - @IBOutlet private var hoursView: UILabel!
22 - @IBOutlet private var phoneView: UILabel!
23 - @IBOutlet private var addressView: UILabel!
24 - @IBOutlet private var directionsButton: UIButton!
25 - @IBOutlet private var infoTopConstraint: NSLayoutConstraint!
26 - @IBOutlet weak var topBorderLine: UIImageView!
27 - @IBOutlet weak var phoneImageView: UIImageView!
28 - @IBOutlet weak var addressImageView: UIImageView!
29 -
30 - // public
31 - public var coupon: swiftApi.CouponItemModel?
32 - public var isMarket: Bool? = false
33 - var merchantsArray:Array<swiftApi.MerchantModel> = []
34 - var selectedMerchant: swiftApi.MerchantModel?
35 - var annotationGroup = [MKPointAnnotation]()
36 - var parentMerchant: swiftApi.MerchantModel?
37 - var parentMerchantsArray:Array<swiftApi.MerchantModel> = []
38 -
39 - //
40 - var loading: Bool = false
41 - let initialLocation = CLLocation(latitude: 37.9641262, longitude: 23.7468592) // greece
42 - //
43 - public override func viewDidLoad() {
44 - super.viewDidLoad()
45 -
46 - self.hidesBottomBarWhenPushed = true
47 -
48 - self.infoTopConstraint.constant = 0
49 -
50 - setBackButton()
51 - setNavigationTitle("Καταστήματα")
52 -
53 - backgroundImage.image = UIImage(named: "coupons_scrollview_white", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
54 - phoneImageView.image = UIImage(named: "ic_phone", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
55 - addressImageView.image = UIImage(named: "ic_address", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
56 -
57 - mapView.delegate = self
58 - mapView.centerToLocation(initialLocation, regionRadius: 1000000)
59 -
60 -// mapView.clipsToBounds = true
61 -// mapView.layer.cornerRadius = 30
62 -// mapView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
63 -
64 -// let image = UIImage(named: "top_border_line", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)!
65 -// var aspectR: CGFloat = 0.0
66 -//
67 -// aspectR = image.size.width/image.size.height
68 -
69 -// topBorderLine.translatesAutoresizingMaskIntoConstraints = false
70 -// topBorderLine.image = image
71 -// topBorderLine.contentMode = .scaleAspectFill
72 -//
73 -// NSLayoutConstraint.activate([
74 -// topBorderLine.topAnchor.constraint(equalTo: mainView.topAnchor, constant: 0),
75 -// topBorderLine.leadingAnchor.constraint(equalTo: mainView.leadingAnchor, constant: 0),
76 -// topBorderLine.trailingAnchor.constraint(equalTo: mainView.trailingAnchor, constant: 0),
77 -// topBorderLine.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.width),
78 -// topBorderLine.heightAnchor.constraint(equalTo: topBorderLine.widthAnchor, multiplier: 1/aspectR)
79 -// ])
80 -
81 -
82 - closeButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
83 - closeButton.setImage(UIImage(named: "ic_close_3", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
84 -
85 - titleView.font = UIFont(name: "PFSquareSansPro-Bold", size: 19)
86 - titleView.textColor = UIColor(rgb: 0x757575)
87 -
88 - nameView.font = UIFont(name: "PFSquareSansPro-Medium", size: 18)
89 - nameView.textColor = UIColor(rgb: 0x415564)
90 -
91 - hoursView.font = UIFont(name: "PFSquareSansPro-Regular", size: 18)
92 - hoursView.textColor = UIColor(rgb: 0xAEAEAE)
93 -
94 - hoursView.font = UIFont(name: "PFSquareSansPro-Medium", size: 18)
95 - hoursView.textColor = UIColor(rgb: 0x415564)
96 -
97 - addressView.font = UIFont(name: "PFSquareSansPro-Medium", size: 18)
98 - addressView.textColor = UIColor(rgb: 0x415564)
99 -
100 - //directionsButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 16)
101 - directionsButton.setTitle("Οδηγίες", for: .normal)
102 - directionsButton.setImage(UIImage(named: "ic_directions", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
103 -
104 -// directionsButton.sizeToFit()
105 - directionsButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 18)
106 - directionsButton.setTitleColor(.white, for: .normal)
107 - directionsButton.tintColor = .white
108 - directionsButton.backgroundColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00)
109 - directionsButton.layer.cornerRadius = 16.0
110 -// directionsButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 5);
111 -// directionsButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0);
112 - directionsButton.frame = CGRect(x: 0.0, y: 0.0, width: directionsButton.intrinsicContentSize.width+10, height: 50)
113 -// directionsButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 15, bottom: 0, right: 15)
114 - directionsButton.setInsets(forContentPadding: UIEdgeInsets(top: 0, left: 15, bottom: 0, right: 15), imageTitlePadding: 10)
115 -
116 - load()
117 - }
118 -
119 - public override func viewWillAppear(_ animated: Bool) {
120 - super.viewWillAppear(animated)
121 -
122 - swiftApi().logTrackersEvent("screen", "ShopsScreen")
123 -
124 - self.navigationController?.hideHairline()
125 - }
126 -
127 - // mvp
128 - @objc func load() {
129 -
130 - if (loading) {
131 - return;
132 - }
133 - showLoading()
134 -
135 - if (coupon != nil) {
136 - if let merchantUuid: String = coupon?.merchant_uuid {
137 - swiftApi().getMultilingualMerchantsAsync([], false, 0.0, [], "", 0, [merchantUuid], getMerchantsCallback)
138 - showContent()
139 - }
140 - } else {
141 - let appUuid = swiftApi().getAppUuid()
142 -
143 - // 2a6adade35f1484994a3d4c8f006b909 category is for SM only
144 - var categoryUuids = [""]
145 - if (self.isMarket == true) {
146 - categoryUuids = appUuid == "0086a2088301440792091b9f814c2267" ? ["2a6adade35f1484994a3d4c8f006b909"] : ["adcace6cab6049c7b7271bc85bc2b26d"]
147 - } else {
148 - categoryUuids = appUuid == "0086a2088301440792091b9f814c2267" ? [""] : ["adcace6cab6049c7b7271bc85bc2b26d"]
149 - }
150 -
151 - swiftApi().getMultilingualMerchantsAsync(categoryUuids, false, 0.0, [], "", 0, [], getMerchantsCallback)
152 - showContent()
153 - }
154 -
155 - }
156 -
157 - func getMerchantsCallback (_ merchantsData: Array<swiftApi.MerchantModel>?) -> Void {
158 - if (merchantsData != nil) {
159 - DispatchQueue.main.async {
160 -
161 - let filteredMerchants = (merchantsData ?? []).filter({ return (($0._latitude != 0.0) && ($0._longitude != 0.0)) })
162 - let parentMerchants = (merchantsData ?? []).filter({ return (($0._latitude == 0.0) && ($0._longitude == 0.0)) })
163 -
164 -// if (self.isMarket == true) {
165 - self.merchantsArray = filteredMerchants
166 - self.parentMerchantsArray = parentMerchants
167 -
168 -// if let parent = (merchantsData ?? []).first(where: {(($0._latitude == 0.0) && ($0._longitude == 0.0))}) {
169 -// self.parentMerchant = parent
170 -// }
171 -
172 -// } else {
173 -// self.merchantsArray = merchantsData ?? []
174 -// }
175 -
176 - self.loadMapPins()
177 -
178 -// let filteredMerchants = self.merchantsArray.filter({ return (($0._latitude != 0.0) && ($0._longitude != 0.0)) })
179 - if (filteredMerchants.count == 0) {
180 - self.showDialog("Καταστήματα συνεργάτη", "Ο συνεργάτης διαθέτει μόνο ηλεκτρονικό κατάστημα για ηλεκτρονικές παραγγελίες.")
181 - }
182 - }
183 -
184 - return
185 - }
186 - }
187 -
188 - func showDialog(_ alertTitle: String, _ alertSubTitle: String) -> Void {
189 -
190 - let alert = UIAlertController(title: alertTitle, message: alertSubTitle, preferredStyle: .alert)
191 -
192 - let cancelButton = UIAlertAction(title: "Άκυρο", style: .default, handler: { action in
193 - switch action.style{
194 - case .default:
195 - self.navigationController?.popViewController(animated: true)
196 - // self.dismiss(animated: true, completion: {})
197 -
198 - case .cancel:
199 - print("cancel")
200 -
201 - case .destructive:
202 - print("destructive")
203 -
204 - }
205 - })
206 - // cancelButton.setValue(UIColor(rgb: 0xFC5757), forKey: "titleTextColor")
207 - alert.addAction(cancelButton)
208 -
209 - alert.addAction(UIAlertAction(title: "Δες το eshop", style: .default, handler: { action in
210 - switch action.style{
211 - case .default:
212 - if (self.coupon != nil) {
213 - // if let merchantUuid: String = self.coupon?.merchant_uuid {
214 - // for item in swiftApi().getMerchantList() {
215 - // if (item._uuid == merchantUuid) {
216 -
217 - // let eshopWebsite = item._website
218 -
219 - // if (eshopWebsite != "") {
220 - // guard let websiteUrl = URL(string: eshopWebsite) else {
221 - // print("Error creating URL")
222 - // return
223 - // }
224 -
225 - // // check if link can be opened.
226 - // guard UIApplication.shared.canOpenURL(websiteUrl) else {
227 - // return
228 - // }
229 -
230 - // swiftApi().logTrackersEvent("click", "SeeShopWebsite")
231 - // UIApplication.shared.open(websiteUrl, options: [:], completionHandler: nil)
232 - // break;
233 - // }
234 - // }
235 - // }
236 - // }
237 -
238 - let merchantDetails: swiftApi.MerchantModel? = self.coupon?.merchant_details
239 - let eshopWebsite = merchantDetails?._website ?? ""
240 -
241 - if (eshopWebsite != "") {
242 - guard let websiteUrl = URL(string: eshopWebsite) else {
243 - print("Error creating URL")
244 - return
245 - }
246 -
247 - // check if link can be opened.
248 - guard UIApplication.shared.canOpenURL(websiteUrl) else {
249 - return
250 - }
251 -
252 - swiftApi().logTrackersEvent("click", "SeeShopWebsite")
253 - UIApplication.shared.open(websiteUrl, options: [:], completionHandler: nil)
254 - break;
255 - }
256 - }
257 -// if (self.merchantsArray.count > 0) {
258 -// for item in self.merchantsArray {
259 -// let eshopWebsite = item._website
260 -//
261 -// if (eshopWebsite != "") {
262 -// guard let websiteUrl = URL(string: eshopWebsite) else {
263 -// print("Error creating URL")
264 -// return
265 -// }
266 -//
267 -// // check if link can be opened.
268 -// guard UIApplication.shared.canOpenURL(websiteUrl) else {
269 -// return
270 -// }
271 -//
272 -// swiftApi().logTrackersEvent("click", "SeeShopWebsite")
273 -// UIApplication.shared.open(websiteUrl, options: [:], completionHandler: nil)
274 -// break;
275 -// }
276 -// }
277 -// }
278 -
279 - case .cancel:
280 - print("cancel")
281 -
282 - case .destructive:
283 - print("destructive")
284 -
285 - }
286 - }))
287 - self.present(alert, animated: true, completion: nil)
288 - }
289 -
290 - private func showLoading() {
291 -
292 - loading = true
293 - }
294 -
295 - private func showError() {
296 - }
297 -
298 - private func showContent() {
299 -
300 - loading = false
301 - }
302 -
303 - // private
304 - @IBAction func closeButtonAction(_ sender: Any) {
305 - print("closeButton Pressed!!!")
306 - hidePinDetailsView()
307 -
308 - let selectedAnnotations = mapView.selectedAnnotations
309 - for annotation in selectedAnnotations {
310 - mapView.deselectAnnotation(annotation, animated: false)
311 - }
312 - }
313 -
314 - @IBAction func directionsButtomAction(_ sender: Any) {
315 -
316 - guard let lon = selectedMerchant?._longitude, let lat = selectedMerchant?._latitude else {
317 - return
318 - }
319 -
320 - // guard your URL instances
321 -// guard let googleMapsUrl = URL(string: String(format: "https://www.google.com/maps/@%.6f,%.6f,6z", lat, lon)),
322 -// let appleMapsUrl = URL(string: String(format: "http://maps.apple.com/?ll=%.6f,%.6f", lat, lon)) else {
323 -// print("Error creating URLs")
324 -// return
325 -// }
326 -
327 -// guard let googleMapsUrl = URL(string: "https://www.google.co.in/maps/dir/?saddr=&daddr=\(lat),\(lon)&directionsmode=driving"),
328 -// let appleMapsUrl = URL(string: "http://maps.apple.com/?daddr=\(lat),\(lon)") else {
329 -// print("Error creating URLs")
330 -// return
331 -// }
332 -//
333 -// // check if link can be opened with google maps.
334 -// guard UIApplication.shared.canOpenURL(googleMapsUrl) else {
335 -// UIApplication.shared.open(appleMapsUrl, options: [:], completionHandler: nil)
336 -// return
337 -// }
338 -//
339 -// UIApplication.shared.open(googleMapsUrl, options: [:], completionHandler: nil)
340 -
341 - guard let appleMapsUrl = URL(string: "http://maps.apple.com/?daddr=\(lat),\(lon)") else {
342 - print("Error creating URLs")
343 - return
344 - }
345 -
346 - UIApplication.shared.open(appleMapsUrl, options: [:], completionHandler: nil)
347 -
348 - }
349 -
350 - private func loadMapPins() {
351 - for item in merchantsArray {
352 - let pin = MerchantAnnotation(item)
353 - mapView.addAnnotation(pin)
354 -
355 -// self.annotationGroup.append(pin)
356 -// self.mapView.addAnnotations(self.annotationGroup)
357 -// self.mapView.showAnnotations(self.annotationGroup, animated: true)
358 -
359 -// let annotation = MKPointAnnotation()
360 -// annotation.coordinate.longitude = item._longitude
361 -// annotation.coordinate.latitude = item._latitude
362 -// annotation.title = item._admin_name //This is the line to remove the optional annotation.title? from.
363 -// annotation.subtitle = item._admin_name
364 -// self.annotationGroup.append(annotation)
365 -// self.mapView.addAnnotations(self.annotationGroup)
366 -// self.mapView.showAnnotations(self.annotationGroup, animated: true)
367 -
368 -// let annotation = MKPointAnnotation()
369 -// let centerCoordinate = CLLocationCoordinate2D(latitude: item._latitude, longitude: item._longitude)
370 -// annotation.coordinate = centerCoordinate
371 -// annotation.title = "Pass Title here"
372 -// mapView.addAnnotation(annotation)
373 - }
374 -// mapView.showAnnotations(mapView.annotations, animated: true)
375 - }
376 -
377 - private func loadPinDetailsView(_ annotation: MerchantAnnotation) {
378 - self.selectedMerchant = annotation.model
379 -
380 - if let parent = self.parentMerchantsArray.first(where: {($0._uuid == self.selectedMerchant?._parent)}) {
381 - self.parentMerchant = parent
382 - }
383 -
384 -// self.titleView.text = self.selectedMerchant?._admin_name
385 - self.titleView.text = self.parentMerchant?._admin_name
386 -
387 - if (self.isMarket == true) {
388 - self.nameImageView.load(link: self.parentMerchant?._img_preview ?? "", placeholder: UIImage(), cache: URLCache())
389 - } else {
390 - self.nameImageView.load(link: self.selectedMerchant?._img_preview ?? "", placeholder: UIImage(), cache: URLCache())
391 - }
392 -
393 - self.nameView.text = self.selectedMerchant?._name
394 - // TODO: Make dynamic
395 - self.hoursView.text = ""
396 - self.phoneView.text = self.selectedMerchant?._telephone
397 - self.addressView.text = self.selectedMerchant?._address
398 - }
399 -
400 - private func showPinDetailsView() {
401 - self.infoTopConstraint.constant = -320
402 - UIView.animate(withDuration: 1.0) {
403 - self.view.layoutIfNeeded()
404 - }
405 - }
406 -
407 - private func hidePinDetailsView() {
408 - self.selectedMerchant = nil
409 -
410 - self.infoTopConstraint.constant = 0
411 - UIView.animate(withDuration: 1.0) {
412 - self.view.layoutIfNeeded()
413 - }
414 - }
415 -
416 - // map view delegate
417 -// public func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
418 -//
419 -//// guard !(annotation is MKUserLocation) else {
420 -//// return nil
421 -//// }
422 -//
423 -// var annotationView = mapView.dequeueReusableAnnotationView(withIdentifier: "warply_custom")
424 -// if (annotationView == nil) {
425 -// print("=== annotationView == nil ===")
426 -//
427 -// annotationView = MKAnnotationView(annotation: annotation, reuseIdentifier: "warply_custom")
428 -// annotationView?.canShowCallout = false
429 -// } else {
430 -// print("=== annotationView != nil ===")
431 -//
432 -// annotationView?.annotation = annotation
433 -// }
434 -//
435 -// // TODO: add custom pin image?
436 -// //annotationView?.image = UIImage(named: "custom")
437 -//
438 -// print("=== returned annotation ===")
439 -// print(annotation)
440 -//
441 -// return annotationView
442 -// }
443 -
444 - // map view delegate
445 - public func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
446 -
447 -// guard !(annotation is MKUserLocation) else {
448 -// return nil
449 -// }
450 -
451 - var annotationView = mapView.dequeueReusableAnnotationView(withIdentifier: "warply_custom")
452 - if (annotationView == nil) {
453 - annotationView = MKAnnotationView(annotation: annotation, reuseIdentifier: "warply_custom")
454 - annotationView?.canShowCallout = false
455 -
456 - } else {
457 - annotationView?.annotation = annotation
458 - }
459 -
460 - // Add custom pin image
461 - annotationView?.frame = CGRect(x: 0, y: 0, width: 45, height: 60)
462 -
463 - let pinImageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 45, height: 60))
464 - pinImageView.contentMode = .scaleAspectFit
465 -
466 - if let pinImg = UIImage(named: "map_pin", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) {
467 - pinImageView.image = pinImg
468 - }
469 -
470 - let logoImageView = UIImageView(frame: CGRect(x: 5, y: 5, width: 35, height: 35))
471 - logoImageView.contentMode = .scaleAspectFit
472 -
473 - let merchant = annotation as? MerchantAnnotation
474 - if let merchantModel = merchant?.model {
475 -
476 - let currentMerchant = merchantModel
477 -
478 - if (self.isMarket == true) {
479 - if let parent = self.parentMerchantsArray.first(where: {($0._uuid == currentMerchant._parent)}) {
480 - let currentMerchantParent = parent
481 -
482 - logoImageView.load(link: currentMerchantParent._img_preview , placeholder: UIImage(), cache: URLCache())
483 -
484 - pinImageView.addSubview(logoImageView)
485 - annotationView?.addSubview(pinImageView)
486 -
487 - return annotationView
488 - } else {
489 - return nil
490 - }
491 -
492 - } else {
493 - logoImageView.load(link: currentMerchant._img_preview , placeholder: UIImage(), cache: URLCache())
494 -
495 - pinImageView.addSubview(logoImageView)
496 - annotationView?.addSubview(pinImageView)
497 -
498 - return annotationView
499 - }
500 -
501 - } else {
502 - return nil
503 - }
504 - }
505 -
506 - public func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) {
507 - let merchant = view.annotation as? MerchantAnnotation
508 - let merchantModel = merchant!.model
509 - swiftApi().logTrackersEvent("click", ("ShopsScreenMarker:" + (merchantModel._uuid)))
510 -
511 - loadPinDetailsView(merchant!)
512 - showPinDetailsView()
513 - }
514 -
515 - public func mapView(_ mapView: MKMapView, didDeselect view: MKAnnotationView) {
516 - hidePinDetailsView()
517 - }
518 -}
519 -
520 -private extension MKMapView {
521 -
522 - func centerToLocation(_ location: CLLocation, regionRadius: CLLocationDistance = 1000) {
523 - let coordinateRegion = MKCoordinateRegion(
524 - center: location.coordinate,
525 - latitudinalMeters: regionRadius,
526 - longitudinalMeters: regionRadius)
527 - setRegion(coordinateRegion, animated: true)
528 - }
529 -}
1 -<?xml version="1.0" encoding="UTF-8"?>
2 -<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
3 - <device id="retina6_1" orientation="portrait" appearance="light"/>
4 - <dependencies>
5 - <deployment identifier="iOS"/>
6 - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
7 - <capability name="Safe area layout guides" minToolsVersion="9.0"/>
8 - <capability name="System colors in document resources" minToolsVersion="11.0"/>
9 - <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
10 - </dependencies>
11 - <objects>
12 - <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MapsViewController" customModule="SwiftWarplyFramework" customModuleProvider="target">
13 - <connections>
14 - <outlet property="addressImageView" destination="Bic-c4-J9E" id="pOr-y5-qYi"/>
15 - <outlet property="addressView" destination="syP-Hv-OGD" id="LUw-pI-3va"/>
16 - <outlet property="backgroundImage" destination="tVJ-fk-ani" id="ETq-VL-6q7"/>
17 - <outlet property="closeButton" destination="lEb-V2-2FC" id="aEd-fS-pbO"/>
18 - <outlet property="directionsButton" destination="bw3-J9-wHr" id="sSi-OK-KTA"/>
19 - <outlet property="hoursView" destination="u9U-A7-lbO" id="xm5-gQ-zjh"/>
20 - <outlet property="infoTopConstraint" destination="9av-UX-8VL" id="uKX-lw-OTH"/>
21 - <outlet property="mainView" destination="rKl-bF-Zpf" id="ghc-id-sqV"/>
22 - <outlet property="mapView" destination="F1c-ck-cQa" id="cdx-31-BiL"/>
23 - <outlet property="nameImageView" destination="eDV-A1-pOO" id="JYq-eT-kEG"/>
24 - <outlet property="nameView" destination="MsK-eg-pkk" id="60t-lm-O8m"/>
25 - <outlet property="phoneImageView" destination="KhY-nt-uwH" id="1lt-DL-aRN"/>
26 - <outlet property="phoneView" destination="knh-D9-CuM" id="ES2-6e-vRx"/>
27 - <outlet property="titleView" destination="oVh-dv-f7a" id="dst-Ku-EFw"/>
28 - <outlet property="topBorderLine" destination="Z8H-fT-Lo9" id="Vl0-Nb-YhC"/>
29 - <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
30 - </connections>
31 - </placeholder>
32 - <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
33 - <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
34 - <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
35 - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
36 - <subviews>
37 - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rKl-bF-Zpf" userLabel="Main View">
38 - <rect key="frame" x="0.0" y="48" width="414" height="848"/>
39 - <subviews>
40 - <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="coupons_scrollview_white" translatesAutoresizingMaskIntoConstraints="NO" id="tVJ-fk-ani">
41 - <rect key="frame" x="0.0" y="0.0" width="414" height="852"/>
42 - </imageView>
43 - <mapView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" mapType="standard" translatesAutoresizingMaskIntoConstraints="NO" id="F1c-ck-cQa">
44 - <rect key="frame" x="0.0" y="0.0" width="414" height="848"/>
45 - </mapView>
46 - <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Z8H-fT-Lo9">
47 - <rect key="frame" x="0.0" y="420" width="414" height="11.5"/>
48 - </imageView>
49 - </subviews>
50 - <color key="backgroundColor" systemColor="systemBackgroundColor"/>
51 - <constraints>
52 - <constraint firstAttribute="bottom" secondItem="tVJ-fk-ani" secondAttribute="bottom" id="5cR-5W-AwC"/>
53 - <constraint firstItem="tVJ-fk-ani" firstAttribute="top" secondItem="rKl-bF-Zpf" secondAttribute="top" id="EMb-Ay-M18"/>
54 - <constraint firstItem="Z8H-fT-Lo9" firstAttribute="leading" secondItem="rKl-bF-Zpf" secondAttribute="leading" id="Kwp-fj-9nx"/>
55 - <constraint firstAttribute="trailing" secondItem="tVJ-fk-ani" secondAttribute="trailing" id="LLM-SY-Ejo"/>
56 - <constraint firstItem="F1c-ck-cQa" firstAttribute="leading" secondItem="rKl-bF-Zpf" secondAttribute="leading" id="P7b-Km-FIn"/>
57 - <constraint firstItem="Z8H-fT-Lo9" firstAttribute="top" secondItem="rKl-bF-Zpf" secondAttribute="top" id="VAV-Go-hI2"/>
58 - <constraint firstItem="F1c-ck-cQa" firstAttribute="top" secondItem="rKl-bF-Zpf" secondAttribute="top" id="X2Z-Vc-V9u"/>
59 - <constraint firstAttribute="trailing" secondItem="F1c-ck-cQa" secondAttribute="trailing" id="dcT-Pn-T5v"/>
60 - <constraint firstItem="tVJ-fk-ani" firstAttribute="leading" secondItem="rKl-bF-Zpf" secondAttribute="leading" id="eVM-4A-gJc"/>
61 - <constraint firstAttribute="bottom" secondItem="F1c-ck-cQa" secondAttribute="bottom" id="ipi-oy-9jV"/>
62 - <constraint firstAttribute="trailing" secondItem="Z8H-fT-Lo9" secondAttribute="trailing" id="nUU-tN-OvE"/>
63 - </constraints>
64 - <variation key="default">
65 - <mask key="subviews">
66 - <exclude reference="tVJ-fk-ani"/>
67 - <exclude reference="Z8H-fT-Lo9"/>
68 - </mask>
69 - </variation>
70 - </view>
71 - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Zc1-ew-qcl">
72 - <rect key="frame" x="0.0" y="576" width="414" height="320"/>
73 - <subviews>
74 - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="INTERSPORT" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oVh-dv-f7a" userLabel="Title">
75 - <rect key="frame" x="30" y="20" width="304" height="30"/>
76 - <constraints>
77 - <constraint firstAttribute="height" constant="30" id="Gf2-VN-pNV"/>
78 - </constraints>
79 - <fontDescription key="fontDescription" type="boldSystem" pointSize="19"/>
80 - <nil key="textColor"/>
81 - <nil key="highlightedColor"/>
82 - </label>
83 - <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="right" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="lEb-V2-2FC" userLabel="Close">
84 - <rect key="frame" x="354" y="15" width="40" height="40"/>
85 - <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
86 - <constraints>
87 - <constraint firstAttribute="width" constant="40" id="gnd-qn-qo5"/>
88 - <constraint firstAttribute="height" constant="40" id="oeu-zs-b1J"/>
89 - </constraints>
90 - <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
91 - <state key="normal" title="B" image="ic_close_3">
92 - <color key="titleColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
93 - </state>
94 - <connections>
95 - <action selector="closeButtonAction:" destination="-1" eventType="touchUpInside" id="bIB-NN-rUr"/>
96 - </connections>
97 - </button>
98 - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="F55-qj-PDc" userLabel="LineTop">
99 - <rect key="frame" x="10" y="61.5" width="394" height="1"/>
100 - <constraints>
101 - <constraint firstAttribute="height" constant="1" id="18a-J3-UZm"/>
102 - </constraints>
103 - </view>
104 - <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="eDV-A1-pOO" userLabel="NameLogo">
105 - <rect key="frame" x="30" y="87.5" width="30" height="30"/>
106 - <constraints>
107 - <constraint firstAttribute="width" constant="30" id="IjG-Iw-fIq"/>
108 - <constraint firstAttribute="height" constant="30" id="LnS-gV-hIi"/>
109 - </constraints>
110 - </imageView>
111 - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" text="Intersport Χαλανδρίου" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MsK-eg-pkk" userLabel="NameLabel">
112 - <rect key="frame" x="70" y="82" width="314" height="21.5"/>
113 - <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
114 - <nil key="textColor"/>
115 - <nil key="highlightedColor"/>
116 - </label>
117 - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="SHs-vI-jD7" userLabel="LineMiddle">
118 - <rect key="frame" x="10" y="142.5" width="394" height="1"/>
119 - <color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
120 - <constraints>
121 - <constraint firstAttribute="height" constant="1" id="hMo-qH-T2k"/>
122 - </constraints>
123 - </view>
124 - <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_phone" translatesAutoresizingMaskIntoConstraints="NO" id="KhY-nt-uwH" userLabel="phoneIcon">
125 - <rect key="frame" x="30" y="173.5" width="20" height="20"/>
126 - <constraints>
127 - <constraint firstAttribute="height" constant="20" id="1rt-pN-Dld"/>
128 - <constraint firstAttribute="width" constant="20" id="3Rd-ir-r7Q"/>
129 - </constraints>
130 - </imageView>
131 - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" text="210-6230543" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="knh-D9-CuM" userLabel="phoneLabel">
132 - <rect key="frame" x="60" y="163.5" width="324" height="40"/>
133 - <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
134 - <nil key="textColor"/>
135 - <nil key="highlightedColor"/>
136 - </label>
137 - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="sAf-f8-8jc" userLabel="LineBottom">
138 - <rect key="frame" x="10" y="223.5" width="394" height="1"/>
139 - <color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
140 - <constraints>
141 - <constraint firstAttribute="height" constant="1" id="vSP-6I-Lz6"/>
142 - </constraints>
143 - </view>
144 - <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_address" translatesAutoresizingMaskIntoConstraints="NO" id="Bic-c4-J9E" userLabel="AddressIcon">
145 - <rect key="frame" x="30" y="245.5" width="20" height="20"/>
146 - <constraints>
147 - <constraint firstAttribute="height" constant="20" id="A8o-MY-I6f"/>
148 - <constraint firstAttribute="width" constant="20" id="Xma-bp-6IZ"/>
149 - </constraints>
150 - </imageView>
151 - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" text="ΕΘΝΙΚΗΣ ΑΝΤΙΣΤΑΣΕΩΣ 4 41" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="syP-Hv-OGD" userLabel="AddressLabel">
152 - <rect key="frame" x="60" y="244.5" width="246" height="21.5"/>
153 - <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
154 - <nil key="textColor"/>
155 - <nil key="highlightedColor"/>
156 - </label>
157 - <button opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" horizontalCompressionResistancePriority="751" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bw3-J9-wHr" userLabel="Directions">
158 - <rect key="frame" x="340" y="238.5" width="54" height="34"/>
159 - <constraints>
160 - <constraint firstAttribute="height" constant="34" id="9wg-ge-pC0"/>
161 - </constraints>
162 - <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
163 - <state key="normal" title="Button"/>
164 - <connections>
165 - <action selector="directionsButtomAction:" destination="-1" eventType="touchUpInside" id="nMR-Jk-Wm4"/>
166 - </connections>
167 - </button>
168 - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" text="Δευτέρα - Τετάρτη" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="u9U-A7-lbO" userLabel="HoursLabel">
169 - <rect key="frame" x="70" y="102" width="314" height="21.5"/>
170 - <fontDescription key="fontDescription" type="system" pointSize="18"/>
171 - <color key="textColor" systemColor="systemGray2Color"/>
172 - <nil key="highlightedColor"/>
173 - </label>
174 - </subviews>
175 - <viewLayoutGuide key="safeArea" id="XS2-AR-3j9"/>
176 - <color key="backgroundColor" systemColor="systemBackgroundColor"/>
177 - <constraints>
178 - <constraint firstItem="u9U-A7-lbO" firstAttribute="leading" secondItem="eDV-A1-pOO" secondAttribute="trailing" constant="10" id="0Z2-uE-kRe"/>
179 - <constraint firstItem="XS2-AR-3j9" firstAttribute="trailing" secondItem="MsK-eg-pkk" secondAttribute="trailing" constant="30" id="1qW-i8-MRk"/>
180 - <constraint firstItem="knh-D9-CuM" firstAttribute="top" secondItem="SHs-vI-jD7" secondAttribute="bottom" constant="20" id="61g-5C-XbI"/>
181 - <constraint firstItem="sAf-f8-8jc" firstAttribute="leading" secondItem="XS2-AR-3j9" secondAttribute="leading" constant="10" id="7W6-cn-WdZ"/>
182 - <constraint firstItem="bw3-J9-wHr" firstAttribute="centerY" secondItem="Bic-c4-J9E" secondAttribute="centerY" id="AHw-0D-gur"/>
183 - <constraint firstItem="SHs-vI-jD7" firstAttribute="top" secondItem="eDV-A1-pOO" secondAttribute="bottom" constant="25" id="D8j-Qh-CHB"/>
184 - <constraint firstItem="KhY-nt-uwH" firstAttribute="leading" secondItem="XS2-AR-3j9" secondAttribute="leading" constant="30" id="Dok-gZ-xf1"/>
185 - <constraint firstItem="SHs-vI-jD7" firstAttribute="leading" secondItem="Zc1-ew-qcl" secondAttribute="leading" constant="10" id="Lj8-XN-HTj"/>
186 - <constraint firstAttribute="trailing" secondItem="F55-qj-PDc" secondAttribute="trailing" constant="10" id="MCj-ek-cnb"/>
187 - <constraint firstAttribute="trailing" secondItem="lEb-V2-2FC" secondAttribute="trailing" constant="20" id="NcX-rr-7OU"/>
188 - <constraint firstItem="syP-Hv-OGD" firstAttribute="leading" secondItem="Bic-c4-J9E" secondAttribute="trailing" constant="10" id="Rl4-cn-VTG"/>
189 - <constraint firstAttribute="trailing" secondItem="SHs-vI-jD7" secondAttribute="trailing" constant="10" id="Smw-Bv-Qlr"/>
190 - <constraint firstItem="lEb-V2-2FC" firstAttribute="leading" secondItem="oVh-dv-f7a" secondAttribute="trailing" constant="20" id="ULP-b9-ToV"/>
191 - <constraint firstItem="bw3-J9-wHr" firstAttribute="centerY" secondItem="syP-Hv-OGD" secondAttribute="centerY" id="VMT-7b-JjS"/>
192 - <constraint firstItem="MsK-eg-pkk" firstAttribute="leading" secondItem="eDV-A1-pOO" secondAttribute="trailing" constant="10" id="Vg7-xl-oA2"/>
193 - <constraint firstItem="oVh-dv-f7a" firstAttribute="leading" secondItem="Zc1-ew-qcl" secondAttribute="leading" constant="30" id="Zd1-SB-SlA"/>
194 - <constraint firstItem="KhY-nt-uwH" firstAttribute="top" secondItem="SHs-vI-jD7" secondAttribute="bottom" constant="30" id="a6s-J0-5rJ"/>
195 - <constraint firstItem="knh-D9-CuM" firstAttribute="leading" secondItem="KhY-nt-uwH" secondAttribute="trailing" constant="10" id="aeR-MK-4WB"/>
196 - <constraint firstItem="eDV-A1-pOO" firstAttribute="leading" secondItem="XS2-AR-3j9" secondAttribute="leading" constant="30" id="bkK-59-wXK"/>
197 - <constraint firstAttribute="height" constant="320" id="eIo-xG-BnE"/>
198 - <constraint firstItem="u9U-A7-lbO" firstAttribute="centerY" secondItem="eDV-A1-pOO" secondAttribute="centerY" constant="10" id="gFw-90-gXL"/>
199 - <constraint firstItem="oVh-dv-f7a" firstAttribute="top" secondItem="Zc1-ew-qcl" secondAttribute="top" constant="20" id="gIA-8o-Pv8"/>
200 - <constraint firstItem="XS2-AR-3j9" firstAttribute="trailing" secondItem="u9U-A7-lbO" secondAttribute="trailing" constant="30" id="hZz-zi-NzM"/>
201 - <constraint firstItem="XS2-AR-3j9" firstAttribute="trailing" secondItem="sAf-f8-8jc" secondAttribute="trailing" constant="10" id="hn5-U5-rvW"/>
202 - <constraint firstItem="sAf-f8-8jc" firstAttribute="top" secondItem="SHs-vI-jD7" secondAttribute="bottom" constant="80" id="htI-gJ-mSm"/>
203 - <constraint firstAttribute="trailing" secondItem="bw3-J9-wHr" secondAttribute="trailing" constant="20" id="hya-Ns-ldi"/>
204 - <constraint firstItem="Bic-c4-J9E" firstAttribute="leading" secondItem="Zc1-ew-qcl" secondAttribute="leading" constant="30" id="iUf-BZ-0kl"/>
205 - <constraint firstItem="F55-qj-PDc" firstAttribute="leading" secondItem="Zc1-ew-qcl" secondAttribute="leading" constant="10" id="jK6-2e-p3v"/>
206 - <constraint firstItem="lEb-V2-2FC" firstAttribute="centerY" secondItem="oVh-dv-f7a" secondAttribute="centerY" id="lnJ-gm-ewM"/>
207 - <constraint firstItem="XS2-AR-3j9" firstAttribute="bottom" secondItem="syP-Hv-OGD" secondAttribute="bottom" constant="20" id="luv-Gm-76K"/>
208 - <constraint firstItem="sAf-f8-8jc" firstAttribute="top" secondItem="knh-D9-CuM" secondAttribute="bottom" constant="20" id="m6I-QE-hbq"/>
209 - <constraint firstItem="eDV-A1-pOO" firstAttribute="top" secondItem="F55-qj-PDc" secondAttribute="bottom" constant="25" id="nAA-6u-CUo"/>
210 - <constraint firstItem="XS2-AR-3j9" firstAttribute="trailing" secondItem="knh-D9-CuM" secondAttribute="trailing" constant="30" id="pFB-4b-xx9"/>
211 - <constraint firstItem="MsK-eg-pkk" firstAttribute="centerY" secondItem="eDV-A1-pOO" secondAttribute="centerY" constant="-10" id="wpA-Xv-RdU"/>
212 - <constraint firstItem="syP-Hv-OGD" firstAttribute="top" secondItem="sAf-f8-8jc" secondAttribute="bottom" constant="20" id="xD6-zI-9Nl"/>
213 - <constraint firstItem="SHs-vI-jD7" firstAttribute="top" secondItem="F55-qj-PDc" secondAttribute="bottom" constant="80" id="xPl-UV-cMd"/>
214 - <constraint firstItem="bw3-J9-wHr" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="syP-Hv-OGD" secondAttribute="trailing" constant="10" id="zAU-89-R2t"/>
215 - </constraints>
216 - </view>
217 - </subviews>
218 - <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
219 - <color key="backgroundColor" systemColor="systemBackgroundColor"/>
220 - <constraints>
221 - <constraint firstItem="Zc1-ew-qcl" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="0dW-tS-Vxe"/>
222 - <constraint firstItem="Zc1-ew-qcl" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="bottom" constant="-320" id="9av-UX-8VL"/>
223 - <constraint firstItem="Zc1-ew-qcl" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="LKw-N3-e8B"/>
224 - <constraint firstItem="rKl-bF-Zpf" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="W3y-NU-vli"/>
225 - <constraint firstItem="rKl-bF-Zpf" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="cMl-Pz-ulj"/>
226 - <constraint firstAttribute="bottom" secondItem="rKl-bF-Zpf" secondAttribute="bottom" id="pOF-9Z-ipf"/>
227 - <constraint firstAttribute="trailing" secondItem="rKl-bF-Zpf" secondAttribute="trailing" id="xaW-C2-dLe"/>
228 - </constraints>
229 - <point key="canvasLocation" x="137.68115942028987" y="120.53571428571428"/>
230 - </view>
231 - </objects>
232 - <resources>
233 - <image name="coupons_scrollview_white" width="214" height="462"/>
234 - <image name="ic_address" width="12.5" height="17"/>
235 - <image name="ic_close_3" width="17" height="17.5"/>
236 - <image name="ic_phone" width="15.5" height="15.5"/>
237 - <systemColor name="systemBackgroundColor">
238 - <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
239 - </systemColor>
240 - <systemColor name="systemGray2Color">
241 - <color red="0.68235294117647061" green="0.68235294117647061" blue="0.69803921568627447" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
242 - </systemColor>
243 - </resources>
244 -</document>
1 -//
2 -// MarketAnalysisItemViewCell.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 14/1/25.
6 -//
7 -
8 -import UIKit
9 -
10 -class MarketAnalysisItemViewCell: UITableViewCell {
11 -
12 - @IBOutlet weak var dateLabel: UILabel!
13 - @IBOutlet weak var itemImage: UIImageView!
14 - @IBOutlet weak var titleLabel: UILabel!
15 - @IBOutlet weak var priceLabel: UILabel!
16 - @IBOutlet weak var subtitleLabel: UILabel!
17 - @IBOutlet weak var productTitleLabel: UILabel!
18 -
19 - var postImageURL: String? {
20 - didSet {
21 - if let url = postImageURL {
22 - self.itemImage.image = UIImage() // UIImage(named: "loading")
23 -
24 - UIImage.loadImageUsingCacheWithUrlString(url) { image in
25 - // set the image only when we are still displaying the content for the image we finished downloading
26 - if url == self.postImageURL {
27 - self.itemImage.image = image
28 - }
29 - }
30 - }
31 - else {
32 - self.itemImage.image = nil
33 - }
34 - }
35 - }
36 -
37 - // lifecycle
38 - override func awakeFromNib() {
39 - super.awakeFromNib()
40 -
41 - // date
42 - dateLabel.textColor = UIColor(rgb: 0x212121)
43 - dateLabel.font = UIFont(name: "PeridotPE-Bold", size: 12.0)
44 -
45 - // title
46 - titleLabel.textColor = UIColor(rgb: 0x212121)
47 - titleLabel.font = UIFont(name: "PeridotPE-SBold", size: 17.0)
48 -
49 - // price
50 - priceLabel.textColor = UIColor(rgb: 0x212121)
51 - priceLabel.font = UIFont(name: "PeridotPE-Bold", size: 17.0)
52 -
53 - // subtitle
54 -// subtitleLabel.textColor = UIColor(rgb: 0x9D9D9C)
55 - subtitleLabel.textColor = UIColor(rgb: 0x212121)
56 - subtitleLabel.font = UIFont(name: "PeridotPE-SBold", size: 14.0)
57 -
58 - // productTitleLabel
59 - productTitleLabel.textColor = UIColor(rgb: 0x212121)
60 - productTitleLabel.font = UIFont(name: "PeridotPE-Regular", size: 14.0)
61 - }
62 -}
63 -
64 -extension MarketAnalysisItemViewCell {
65 - func configureCell(item: swiftApi.CouponItemModel) {
66 -
67 -// COUPONSET: desc, img_preview, name, terms, merchant_uuid
68 -// COUPON: coupon, expiration, discount, status
69 -// MERCHANT: _img_preview,_admin_name
70 -
71 - let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList()
72 - let couponSetData: swiftApi.CouponSetItemModel? = item.couponset_data
73 -
74 - titleLabel.text = ""
75 -
76 - // for merchant in merchantList {
77 - // // if (merchant._uuid == couponSetData?.merchant_uuid) {
78 - // if (merchant._uuid == item.merchant_uuid) {
79 - // // itemImage.load(link: merchant._img_preview, placeholder: UIImage(), cache: URLCache())
80 - // self.postImageURL = merchant._img_preview
81 - // titleLabel.text = merchant._admin_name
82 - // break;
83 - // }
84 - // }
85 -
86 - let merchantDetails: swiftApi.MerchantModel? = item.merchant_details
87 - self.postImageURL = merchantDetails?._img_preview
88 - titleLabel.text = merchantDetails?._admin_name
89 -
90 - dateLabel.text = item.redeemed ?? "" // expiration
91 -// itemImage.load(link: couponSetData?.img_preview ?? "", placeholder: UIImage(), cache: URLCache())
92 -// titleLabel.text = couponSetData?.name ?? ""
93 -
94 - let priceFloat = Float(round(100 * (Float(couponSetData?.final_price ?? 0.0) )) / 100)
95 - var priceString = "0"
96 - priceString = String(format: "%.2f", priceFloat).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
97 - priceLabel.text = priceString + "€"
98 -
99 -// subtitleLabel.text = "Έκπτωτικό κουπόνι"
100 - subtitleLabel.text = item.redeemed_merchant_details?._name ?? ""
101 -// subtitleLabel.text = couponSetData?.short_description ?? ""
102 - // OR
103 -// let htmlText = couponSetData?.inner_text ?? ""
104 -// subtitleLabel.text = htmlText.htmlToString
105 -
106 - let htmlText = couponSetData?.inner_text ?? ""
107 - productTitleLabel.text = htmlText.htmlToString
108 -
109 - }
110 -
111 - func configureCell(item: swiftApi.CouponItemModel, isMarket: Bool) {
112 -
113 -// COUPONSET: desc, img_preview, name, terms, merchant_uuid
114 -// COUPON: coupon, expiration, discount, status
115 -// MERCHANT: _img_preview,_admin_name
116 -
117 - let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList()
118 -// let couponSetData: swiftApi.CouponSetItemModel? = item.couponset_data
119 -
120 - titleLabel.text = ""
121 -
122 - // for merchant in merchantList {
123 - // if (merchant._uuid == item.merchant_uuid) {
124 - // // itemImage.load(link: merchant._img_preview, placeholder: UIImage(), cache: URLCache())
125 - // self.postImageURL = merchant._img_preview
126 - // titleLabel.text = merchant._admin_name
127 - // break;
128 - // }
129 - // }
130 -
131 - let merchantDetails: swiftApi.MerchantModel? = item.merchant_details
132 - self.postImageURL = merchantDetails?._img_preview
133 - titleLabel.text = merchantDetails?._admin_name
134 -
135 -// titleLabel.text = item.name
136 -// self.postImageURL = item.image
137 -
138 - dateLabel.text = item.redeemed ?? ""
139 -
140 - let priceFloat = Float(round(100 * (Float(item.discount ?? "0.0") ?? 0.0 )) / 100)
141 - var priceString = "0"
142 - priceString = String(format: "%.2f", priceFloat).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
143 - priceLabel.text = priceString + "€"
144 -
145 -// subtitleLabel.text = "Έκπτωτικό κουπόνι"
146 - subtitleLabel.text = item.redeemed_merchant_details?._name ?? ""
147 -// subtitleLabel.text = couponSetData?.short_description ?? ""
148 - // OR
149 -// let htmlText = couponSetData?.inner_text ?? ""
150 -// subtitleLabel.text = htmlText.htmlToString
151 -
152 - }
153 -}
154 -
1 -//
2 -// MarketHistoryViewController.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 5/4/23.
6 -//
7 -
8 -import UIKit
9 -
10 -class MarketHistoryViewController: AnalysisChildViewController {
11 - var loading: Bool = false
12 - var items: Array<swiftApi.CouponItemModel> = swiftApi().getOldUnifiedCouponList()
13 - var showMore = false
14 -
15 - // TODO: remove this when configuring model
16 - let hasMessage = true
17 -
18 - // lifecycle
19 - override func viewDidLoad() {
20 -
21 - super.viewDidLoad()
22 -
23 - self.tableView.delegate = self
24 - self.tableView.dataSource = self
25 -
26 - // Add shadow
27 - self.tableView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
28 - self.tableView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
29 - self.tableView.layer.shadowOpacity = 1.0
30 - self.tableView.layer.shadowRadius = 1.0
31 -
32 - self.refreshControl = UIRefreshControl()
33 - self.refreshControl?.addTarget(self, action: #selector(handleRefresh(_:)), for: .valueChanged)
34 -
35 - handleRefresh(self.refreshControl!)
36 - }
37 -
38 - // mvp
39 - @objc func load() {
40 -
41 - if (loading) {
42 - return;
43 - }
44 -
45 - showLoading()
46 -
47 -// items = swiftApi().getOldUnifiedCouponList()
48 - items = swiftApi().getOldUnifiedCouponList()
49 -
50 - self.showMore = (self.items.count > 3)
51 -
52 - if (self.showMore == true) {
53 - self.items = Array(self.items[0...2])
54 - }
55 -
56 - showContent()
57 - self.tableView.reloadData()
58 - }
59 -
60 - private func showLoading() {
61 -
62 - loading = true
63 - if (self.refreshControl!.isRefreshing) {
64 - return;
65 - }
66 -
67 - self.refreshControl!.beginRefreshing()
68 - }
69 -
70 - private func showError() {
71 - }
72 -
73 - private func showContent() {
74 -
75 - loading = false
76 - self.refreshControl!.endRefreshing()
77 - }
78 -
79 - // private
80 - func responseCallback (_ data: Array<swiftApi.CouponItemModel>?) -> Void {
81 -
82 - self.items = data!
83 - self.showMore = (self.items.count > 3)
84 -
85 - if (self.showMore == true) {
86 - self.items = Array(self.items[0...2])
87 - }
88 - showContent()
89 - DispatchQueue.main.async {
90 - self.tableView.reloadData()
91 - }
92 - }
93 -
94 - @objc func handleRefresh(_ refreshControl: UIRefreshControl) {
95 -
96 - self.perform(_: #selector(load), with: nil, afterDelay: 0.5)
97 - }
98 -
99 - // MARK: - Table view data source
100 - override func numberOfSections(in tableView: UITableView) -> Int {
101 - return 2
102 - }
103 -
104 - override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
105 - if (section == 0) {
106 - return 1
107 - }
108 -
109 - if (self.showMore == true) {
110 - return 4
111 - }
112 - return items.count
113 - }
114 -
115 - override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
116 -// if (indexPath.section == 0) {
117 -// return hasMessage ? (items.count > 0 ? 380.0 : 480.0) : 280
118 -// }
119 -//
120 -// return 140.0
121 - return UITableView.automaticDimension
122 - }
123 -
124 - override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
125 -
126 - // header
127 - if (indexPath.section == 0) {
128 - if (hasMessage) {
129 - let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisHeaderMessageViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisHeaderMessageViewCell
130 - cell.configureCell(isEmpty: items.count == 0, isMarket: true)
131 - return cell
132 - }
133 -
134 - return tableView.dequeueReusableCell(withIdentifier: "AnalysisHeaderViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisHeaderViewCell
135 - }
136 -
137 - if (self.showMore && indexPath.row == 3) {
138 - let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisMoreViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisMoreViewCell
139 - return cell
140 - }
141 -
142 - let cell = tableView.dequeueReusableCell(withIdentifier: "MarketAnalysisItemViewCell", for: indexPath) as! SwiftWarplyFramework.MarketAnalysisItemViewCell
143 -// cell.configureCell(item: items[indexPath.row], isMarket: true)
144 - cell.configureCell(item: items[indexPath.row])
145 -
146 - return cell
147 - }
148 -
149 - override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
150 - if (indexPath.section == 0) {
151 - return
152 - }
153 -
154 - if (self.showMore && indexPath.row == 3) {
155 - self.items = swiftApi().getOldUnifiedCouponList()
156 - self.showMore = false
157 - self.tableView.reloadData()
158 - }
159 - }
160 -
161 - override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
162 - if (section == 0){
163 - return nil
164 -
165 - } else if (section == 1) {
166 - if (self.items.count > 0) {
167 - let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 50))
168 -
169 - let viewBorder = UIView(frame: CGRect(x: 10, y: 0, width: view.frame.width-20, height: view.frame.height))
170 - viewBorder.backgroundColor = .white
171 - // viewBorder.backgroundColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00)
172 -
173 - viewBorder.layer.cornerRadius = 16.5
174 - viewBorder.layer.maskedCorners = [ .layerMinXMinYCorner, .layerMaxXMinYCorner] // Top left, bottom right corner radius
175 -
176 - let viewInner = UIView(frame: CGRect(x: 1, y: 1, width: viewBorder.frame.width-2, height: viewBorder.frame.height-1))
177 - viewInner.backgroundColor = .white
178 -
179 - viewInner.layer.cornerRadius = 16.5
180 - viewInner.layer.maskedCorners = [ .layerMinXMinYCorner, .layerMaxXMinYCorner] // Top left, bottom right corner radius
181 -
182 - let titleLabel = UILabel(frame: CGRect(x: 20, y: 20, width: viewInner.frame.width - 40, height: 20))
183 - titleLabel.font = UIFont(name: "BTCosmo-Bold", size: 20)
184 - titleLabel.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
185 - titleLabel.text = "Αναλυτικά"
186 -
187 - view.addSubview(viewBorder)
188 - viewBorder.addSubview(viewInner)
189 - viewInner.addSubview(titleLabel)
190 - return view
191 - } else {
192 - return nil
193 - }
194 -
195 -
196 - } else {
197 - return nil
198 - }
199 - }
200 -
201 - override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
202 - if (section == 0) {
203 - return 0.0
204 -
205 - } else if (section == 1) {
206 - if (self.items.count > 0) {
207 - return 50.0
208 - } else {
209 - return 0.0
210 - }
211 -
212 - } else {
213 - return 0.0
214 - }
215 - }
216 -
217 - override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
218 -// return CGFloat.leastNormalMagnitude
219 - if (section == 1 && self.items.count > 0) {
220 - return 20.0
221 - } else {
222 - return 0.0
223 - }
224 - }
225 -
226 - override func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
227 - if (section == 1) {
228 - if (self.items.count > 0) {
229 - let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 30))
230 -
231 - let viewBorder = UIView(frame: CGRect(x: 10, y: 0, width: view.frame.width-20, height: view.frame.height))
232 - viewBorder.backgroundColor = .white
233 - // viewBorder.backgroundColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00)
234 -
235 - viewBorder.layer.cornerRadius = 16.5
236 - viewBorder.layer.maskedCorners = [ .layerMinXMaxYCorner, .layerMaxXMaxYCorner] // bottom left, bottom right corner radius
237 -
238 - let viewInner = UIView(frame: CGRect(x: 1, y: 0, width: viewBorder.frame.width-2, height: viewBorder.frame.height-1))
239 - viewInner.backgroundColor = .white
240 -
241 - viewInner.layer.cornerRadius = 16.5
242 - viewInner.layer.maskedCorners = [ .layerMinXMaxYCorner, .layerMaxXMaxYCorner] // bottom left, bottom right corner radius
243 -
244 - view.addSubview(viewBorder)
245 - viewBorder.addSubview(viewInner)
246 - return view
247 - } else {
248 - return nil
249 - }
250 -
251 - } else {
252 - return nil
253 - }
254 - }
255 -}
1 -//
2 -// MarketLoyaltyAnalysisViewController.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 5/4/23.
6 -//
7 -
8 -import UIKit
9 -import SwiftEventBus
10 -
11 -@objc public class MarketLoyaltyAnalysisViewController: UIViewController {
12 -
13 - @IBOutlet weak var leftButton: UIButton!
14 - @IBOutlet weak var rightButton: UIButton!
15 - @IBOutlet weak var leftLineView: UIView!
16 - @IBOutlet weak var rightLineView: UIView!
17 - @IBOutlet weak var contentView: UIView!
18 - @IBOutlet weak var contentViewHeight: NSLayoutConstraint!
19 -
20 - var pageController: UIPageViewController!
21 - var tabSelected = 0
22 -
23 - var timerHistory: DispatchSourceTimer?
24 - var seconds: Int = 0
25 -
26 - public override func viewDidLoad() {
27 - super.viewDidLoad()
28 -
29 - self.hidesBottomBarWhenPushed = true
30 -
31 - // setup view
32 - setBackButton()
33 - setNavigationTitle("Ανάλυση")
34 -
35 - // TODO: DELETE if tabs needed again
36 - contentViewHeight.constant = 0
37 -
38 - // tab
39 - leftButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 15)
40 - leftButton.setTitle("Εξαργυρωμένα", for:.normal)
41 - leftButton.backgroundColor = . clear
42 - leftButton.setTitleColor(UIColor(rgb: 0x212121), for:.normal)
43 -
44 - rightButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 15)
45 - rightButton.setTitle("Μοιρασμένα δώρα", for:.normal)
46 - rightButton.backgroundColor = . clear
47 - rightButton.setTitleColor(UIColor(rgb: 0x848484), for:.normal)
48 -
49 -// leftLineView.applyGradient(colours: [UIColor(rgb: 0x1DA6B9), UIColor(rgb: 0xB2CE69)], gradient: GradientOrientation.horizontal, cornerRadius: 0.0)
50 -// rightLineView.applyGradient(colours: [UIColor(rgb: 0x1DA6B9), UIColor(rgb: 0xB2CE69)], gradient: GradientOrientation.horizontal, cornerRadius: 0.0)
51 -
52 - leftLineView.isHidden = false
53 - rightLineView.isHidden = true
54 -
55 - // TODO: UNCOMMENT if tabs needed again
56 - // pages
57 -// pageController = UIPageViewController(transitionStyle:.scroll, navigationOrientation:.horizontal)
58 -// pageController.dataSource = self;
59 -// pageController.delegate = self;
60 -//
61 -// pageController.view.frame = contentView.bounds;
62 -// addChild(pageController)
63 -// contentView.addSubview(pageController.view)
64 -// pageController .didMove(toParent: self)
65 -//
66 -// let analysisVC = self.viewControllerAt(0)
67 -// pageController.setViewControllers([analysisVC!], direction:.forward, animated:false)
68 - // <==
69 -
70 - // TODO: DELETE if tabs needed again ==>
71 - // Instantiate the child view controller
72 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
73 - let childVC = storyboard.instantiateViewController(withIdentifier:"MarketHistoryViewController") as! SwiftWarplyFramework.MarketHistoryViewController
74 -
75 - // Add the child view controller
76 - addChild(childVC)
77 -
78 - // Add the child view controller's view to the container
79 - contentView.addSubview(childVC.view)
80 -
81 - // Set up constraints for the child view to match the container view
82 - childVC.view.translatesAutoresizingMaskIntoConstraints = false
83 - NSLayoutConstraint.activate([
84 - childVC.view.topAnchor.constraint(equalTo: contentView.topAnchor),
85 - childVC.view.bottomAnchor.constraint(equalTo: contentView.bottomAnchor),
86 - childVC.view.leadingAnchor.constraint(equalTo: contentView.leadingAnchor),
87 - childVC.view.trailingAnchor.constraint(equalTo: contentView.trailingAnchor),
88 - ])
89 -
90 - // Notify the child view controller that it has been moved to the parent
91 - childVC.didMove(toParent: self)
92 - // <==
93 - }
94 -
95 - public override func viewWillAppear(_ animated: Bool) {
96 - super.viewWillAppear(animated)
97 -
98 - swiftApi().logTrackersEvent("screen", "LoyaltyHistoryScreen")
99 -
100 - self.startTimer()
101 -
102 - self.navigationController?.hideHairline()
103 - }
104 -
105 - public override func viewWillDisappear(_ animated: Bool) {
106 - super.viewWillDisappear(animated)
107 -
108 - self.stopTimer()
109 - }
110 -
111 - // MARK: - Functions
112 - func startTimer() {
113 - print("========= GiftsCalculator Timer Started! =========")
114 -
115 - let queue = DispatchQueue(label: Bundle.main.bundleIdentifier! + ".history.timer")
116 - timerHistory = DispatchSource.makeTimerSource(queue: queue)
117 - timerHistory!.schedule(deadline: .now(), repeating: .seconds(1))
118 - timerHistory!.setEventHandler { [weak self] in
119 - // do whatever stuff you want on the background queue here here
120 - print("========= GiftsCalculator interval! =========")
121 -
122 - DispatchQueue.main.async {
123 - // update your model objects and/or UI here
124 - self?.seconds = (self?.seconds ?? 0) + 1
125 -
126 - }
127 - }
128 - timerHistory!.resume()
129 - }
130 -
131 - func stopTimer() {
132 - print("========= GiftsCalculator Timer Stopped! =========")
133 - timerHistory?.cancel()
134 - timerHistory = nil
135 -
136 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
137 - firebaseEvent._eventName = "time_spent_on_loyalty_sdk"
138 - firebaseEvent.setParameter = ("name", "GiftsCalculator")
139 - firebaseEvent.setParameter = ("seconds", String(seconds))
140 - SwiftEventBus.post("firebase", sender: firebaseEvent)
141 -
142 - seconds = 0
143 - }
144 -
145 - ////////////////////////////////////////////////////////////////////////////////
146 - private func viewControllerAt(_ index:Int) -> AnalysisChildViewController?
147 - {
148 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
149 -
150 - if (index == 1) {
151 - swiftApi().logTrackersEvent("click", ("LoyaltyHistoryScreen:" + "TabShared"))
152 -
153 - let analysisVC = storyboard.instantiateViewController(withIdentifier:"MarketSharingHistoryViewController") as! SwiftWarplyFramework.MarketSharingHistoryViewController
154 - analysisVC.index = index;
155 -
156 - return analysisVC;
157 - }
158 -
159 - swiftApi().logTrackersEvent("click", ("LoyaltyHistoryScreen:" + "TabExpired"))
160 -
161 - let analysisVC = storyboard.instantiateViewController(withIdentifier:"MarketHistoryViewController") as! SwiftWarplyFramework.MarketHistoryViewController
162 - analysisVC.index = index;
163 -
164 - return analysisVC;
165 - }
166 -
167 - // MARK: - Handlers
168 - @IBAction func handleLeft() {
169 - if (tabSelected != 0) {
170 - self.tabSelected = 0
171 -
172 - UIView.animate(withDuration: 2.0, delay: 0.0) {
173 -
174 - self.leftLineView.isHidden = false
175 - self.rightLineView.isHidden = true
176 -
177 - self.leftButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 15)
178 - self.rightButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 15)
179 -
180 - self.leftButton.setTitleColor(UIColor(rgb: 0x212121), for:.normal)
181 - self.rightButton.setTitleColor(UIColor(rgb: 0x848484), for:.normal)
182 - }
183 - let analysisVC = self.viewControllerAt(0)
184 - pageController.setViewControllers([analysisVC!], direction:.reverse, animated:true)
185 - }
186 - }
187 -
188 - @IBAction func handleRight() {
189 - if (tabSelected != 1) {
190 - self.tabSelected = 1
191 -
192 - UIView.animate(withDuration: 2.0, delay: 0.0) {
193 -
194 - self.leftLineView.isHidden = true
195 - self.rightLineView.isHidden = false
196 -
197 - self.leftButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 15)
198 - self.rightButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 15)
199 -
200 - self.rightButton.setTitleColor(UIColor(rgb: 0x212121), for:.normal)
201 - self.leftButton.setTitleColor(UIColor(rgb: 0x848484), for:.normal)
202 - }
203 - let analysisVC = self.viewControllerAt(1)
204 - pageController.setViewControllers([analysisVC!], direction:.forward, animated:true)
205 - }
206 - }
207 -}
208 -
209 -// MARK: - PageViewController
210 -extension MarketLoyaltyAnalysisViewController: UIPageViewControllerDataSource, UIPageViewControllerDelegate {
211 -
212 - public func pageViewController(_ pageViewController: UIPageViewController, viewControllerBefore viewController: UIViewController) -> UIViewController? {
213 -
214 - if let analysisVC = viewController as? AnalysisChildViewController {
215 - var index = analysisVC.index
216 - if (index == 0) {
217 - return nil;
218 - }
219 -
220 - index -= 1;
221 - return viewControllerAt(index);
222 - }
223 -
224 - return nil;
225 - }
226 -
227 - public func pageViewController(_ pageViewController: UIPageViewController, viewControllerAfter viewController: UIViewController) -> UIViewController? {
228 -
229 - if let analysisVC = viewController as? AnalysisChildViewController {
230 - var index = analysisVC.index
231 - if (index == 1) {
232 - return nil;
233 - }
234 -
235 - index += 1;
236 - return viewControllerAt(index);
237 - }
238 -
239 - return nil;
240 - }
241 -
242 -
243 - public func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) {
244 -
245 - if (!completed) {
246 - return;
247 - }
248 -
249 -
250 - if let childVCs = pageViewController.viewControllers as? [AnalysisChildViewController] {
251 - let currentIndex = childVCs[0].index
252 - if (currentIndex == 0) {
253 - self.leftButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 15)
254 - self.rightButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 15)
255 - self.leftButton.setTitleColor(UIColor(rgb: 0x212121), for:.normal)
256 - self.rightButton.setTitleColor(UIColor(rgb: 0x848484), for:.normal)
257 - self.tabSelected = 0
258 - self.leftLineView.isHidden = false
259 - self.rightLineView.isHidden = true
260 -
261 - } else {
262 - self.leftButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 15)
263 - self.rightButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 15)
264 - self.rightButton.setTitleColor(UIColor(rgb: 0x212121), for:.normal)
265 - self.leftButton.setTitleColor(UIColor(rgb: 0x848484), for:.normal)
266 - self.tabSelected = 1
267 - self.leftLineView.isHidden = true
268 - self.rightLineView.isHidden = false
269 - }
270 - }
271 - }
272 -}
1 -//
2 -// MarketPassInfoViewController.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 14/1/25.
6 -//
7 -
8 -import UIKit
9 -
10 -@objc public class MarketPassInfoViewController: UIViewController {
11 - @IBOutlet weak var heroImage: UIImageView!
12 - @IBOutlet weak var heroTitleLabel: UILabel!
13 - @IBOutlet weak var storeInfoImage: UIImageView!
14 - @IBOutlet weak var storeInfoTitleLabel: UILabel!
15 - @IBOutlet weak var storeInfoSubtitleLabel: UILabel!
16 - @IBOutlet weak var eshopInfoImage: UIImageView!
17 - @IBOutlet weak var eshopInfoTitleLabel: UILabel!
18 - @IBOutlet weak var eshopInfoSubtitleLabel: UILabel!
19 - @IBOutlet weak var abInfoImage: UIImageView!
20 - @IBOutlet weak var abInfoTitleLabel: UILabel!
21 - @IBOutlet weak var abInfoSubtitleLabel: UILabel!
22 - @IBOutlet weak var okButton: UIButton!
23 -
24 - public override func viewDidLoad() {
25 - super.viewDidLoad()
26 -
27 - self.hidesBottomBarWhenPushed = true
28 -
29 - setBackButton()
30 - setNavigationTitle("Οδηγίες χρήσης")
31 -
32 - setupUI()
33 - }
34 -
35 - public override func viewWillAppear(_ animated: Bool) {
36 - super.viewWillAppear(animated)
37 -
38 - swiftApi().logTrackersEvent("screen", "MarketPassInfoScreen")
39 -
40 - self.navigationController?.hideHairline()
41 - }
42 -
43 - // MARK: - Functions
44 - func setupUI() {
45 - heroImage.image = UIImage(named: "pass_info_hero", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
46 - storeInfoImage.image = UIImage(named: "pass_info_cart", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
47 - eshopInfoImage.image = UIImage(named: "pass_info_globe", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
48 - abInfoImage.image = UIImage(named: "pass_info_ab", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
49 -
50 - heroTitleLabel.text = "Πως λειτουργεί:"
51 - heroTitleLabel.font = UIFont(name: "BTCosmo-Bold", size: 24)
52 - heroTitleLabel.textColor = UIColor(rgb: 0x212121)
53 -
54 - // StoreInfoView
55 - storeInfoTitleLabel.text = "Εξαργύρωση σε φυσικά καταστήματα"
56 - storeInfoTitleLabel.font = UIFont(name: "PeridotPE-Bold", size: 19.0)
57 - storeInfoTitleLabel.textColor = UIColor(rgb: 0x212121)
58 -
59 - storeInfoSubtitleLabel.text = "Σκάναρε το barcode από το κινητό σου στο ταμείο του καταστήματος και κέρδισε απευθείας έκπτωση από τα διαθέσιμα κουπόνια."
60 - storeInfoSubtitleLabel.font = UIFont(name: "PeridotPE-Regular", size: 17.0)
61 - storeInfoSubtitleLabel.textColor = UIColor(rgb: 0x212121)
62 -
63 - // EshopInfoView
64 - eshopInfoTitleLabel.text = "Εξαργύρωση στο eshop"
65 - eshopInfoTitleLabel.font = UIFont(name: "PeridotPE-Bold", size: 19.0)
66 - eshopInfoTitleLabel.textColor = UIColor(rgb: 0x212121)
67 -
68 - eshopInfoSubtitleLabel.text = "Πληκτρολόγησε τον κωδικό σου στο αντίστοιχο πεδίο κατά το checkout στο eshop και κέρδισε απευθείας έκπτωση από τα διαθέσιμα κουπόνια."
69 - eshopInfoSubtitleLabel.font = UIFont(name: "PeridotPE-Regular", size: 17.0)
70 - eshopInfoSubtitleLabel.textColor = UIColor(rgb: 0x212121)
71 -
72 - // ABInfoView
73 - abInfoTitleLabel.text = "Ειδικά για τον ΑΒ"
74 - abInfoTitleLabel.font = UIFont(name: "PeridotPE-Bold", size: 19.0)
75 - abInfoTitleLabel.textColor = UIColor(rgb: 0x212121)
76 -
77 - abInfoSubtitleLabel.text = "1. Eνεργοποίησε τον κωδικό στην κάρτα ΑΒ PLUS στο kiosk του καταστήματος ή μέσω eshop / app στην ενοτητα στην ενότητα Συνεργασίες – SUPERMARKET DEALS.\n\n2. Κάνε τις αγορές σου και κέρδισε απευθείας έκπτωση με χρήση της AB PLUS από τα διαθέσιμα κουπόνια."
78 - abInfoSubtitleLabel.font = UIFont(name: "PeridotPE-Regular", size: 17.0)
79 - abInfoSubtitleLabel.textColor = UIColor(rgb: 0x212121)
80 -
81 - // okButton
82 - okButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 15)
83 - okButton.setTitle("Επιστροφή στο Supermarket Deals", for: .normal)
84 - okButton.setTitleColor(.white, for: .normal)
85 - okButton.backgroundColor = UIColor(rgb: 0x0EA600)
86 - okButton.layer.cornerRadius = 10.0
87 - }
88 -
89 - // MARK: - Actions
90 - @IBAction func okButtonAction(_ sender: Any) {
91 - self.navigationController?.popViewController(animated: true)
92 - }
93 -}
1 -//
2 -// MarketPassViewController.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 14/1/25.
6 -//
7 -
8 -import UIKit
9 -import RSBarcodes_Swift
10 -import AVFoundation
11 -import SwiftEventBus
12 -
13 -@objc public class MarketPassViewController: UIViewController {
14 - @IBOutlet weak var passContainerView: UIView!
15 - @IBOutlet weak var passTitleLabel: UILabel!
16 - @IBOutlet weak var passSubtitleLabel: UILabel!
17 - @IBOutlet weak var barcodeView: UIView!
18 - @IBOutlet weak var barcodeImage: UIImageView!
19 - @IBOutlet weak var barcodeImageHeight: NSLayoutConstraint!
20 - @IBOutlet weak var barcodeLabel: UILabel!
21 - @IBOutlet weak var couponsValueLabel: UILabel!
22 - @IBOutlet weak var smLogosView: UIView!
23 - @IBOutlet weak var mapButton: UIButton!
24 -
25 - var marketPassDetails:swiftApi.MarketPassDetailsModel? = swiftApi().getMarketPassDetails()
26 -
27 - // let spinner = SpinnerViewController()
28 -
29 - let uiscreen: CGRect = UIScreen.main.bounds
30 -
31 - public override func viewDidLoad() {
32 - super.viewDidLoad()
33 -
34 - self.hidesBottomBarWhenPushed = true
35 -
36 - passContainerView.isHidden = true
37 - // getMarketPassDetailsRequest()
38 -
39 - SwiftEventBus.onBackgroundThread(self, name: "market_pass_details_fetched") { result in
40 -
41 - DispatchQueue.main.async {
42 - if let tempMarketPassDetails = swiftApi().getMarketPassDetails() {
43 - self.marketPassDetails = tempMarketPassDetails
44 - self.updateUI()
45 - } else {
46 - // self.showDialog("Αποτυχία","Κάτι πήγε στραβά")
47 - }
48 - }
49 - }
50 -
51 - setBackButton()
52 - setNavigationTitle("SUPERMARKET DEALS")
53 - // Setup the info button with an action
54 - setNavBarRightInfoButton() {
55 - // This closure is the action that will be executed when the info button is tapped
56 -
57 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
58 - let vc = storyboard.instantiateViewController(withIdentifier: "MarketPassInfoViewController") as! SwiftWarplyFramework.MarketPassInfoViewController
59 - self.navigationController?.pushViewController(vc, animated: true)
60 - }
61 -
62 - setupUI()
63 - }
64 -
65 - public override func viewWillAppear(_ animated: Bool) {
66 - super.viewWillAppear(animated)
67 -
68 - swiftApi().logTrackersEvent("screen", "MarketPassScreen")
69 -
70 - self.navigationController?.hideHairline()
71 - }
72 -
73 - // MARK: - Functions
74 - func setupUI() {
75 - passContainerView.backgroundColor = UIColor(rgb: 0x36B32B)
76 - passContainerView.layer.cornerRadius = 16.0
77 - // Add shadow
78 - passContainerView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.31).cgColor
79 - passContainerView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
80 - passContainerView.layer.shadowOpacity = 1.0
81 - passContainerView.layer.shadowRadius = 3.0
82 -
83 - passTitleLabel.text = "SUPERMARKET DEALS CARD"
84 -// passTitleLabel.font = UIFont(name: "BTCosmo-Bold", size: 23)
85 - passTitleLabel.font = UIFont(name: "BTCosmo-Bold", size: 22)
86 - passTitleLabel.textColor = .white
87 -
88 - passSubtitleLabel.text = "Χρησιμοποίησε τον κωδικό σου και κέρδισε έκπτωση στις αγορές σου!"
89 - passSubtitleLabel.font = UIFont(name: "PeridotPE-Regular", size: 17.0)
90 - passSubtitleLabel.textColor = .white
91 -
92 - barcodeView.backgroundColor = .white
93 - barcodeView.layer.cornerRadius = 16.0
94 - barcodeView.layer.borderWidth = 2
95 - barcodeView.layer.borderColor = UIColor(rgb: 0xDADDE4).cgColor
96 -
97 - let barcodeString = ""
98 - barcodeLabel.text = barcodeString
99 - barcodeLabel.font = UIFont(name: "PeridotPE-Regular", size: 19.0)
100 - barcodeLabel.textColor = UIColor(rgb: 0x212121)
101 -
102 -// if let barcodeUIImage = RSUnifiedCodeGenerator.shared.generateCode(barcodeString, machineReadableCodeObjectType: AVMetadataObject.ObjectType.ean13.rawValue, targetSize: CGSize(width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.12)) {
103 -// // if let barcodeUIImage = RSUnifiedCodeGenerator.shared.generateCode(barcodeString, machineReadableCodeObjectType: AVMetadataObject.ObjectType.ean13.rawValue, targetSize: CGSize(width: 110, height: 83)) {
104 -// barcodeImage.image = barcodeUIImage
105 -
106 -// barcodeImageHeight.constant = self.uiscreen.height * 0.12
107 -// // barcodeImageHeight.constant = 83
108 -
109 -// } else {
110 -// barcodeImageHeight.constant = 0
111 -// }
112 -
113 - let couponsValueString = "0.00"
114 - let attrRegular = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-Regular", size: 17) ?? UIFont.systemFont(ofSize: 16), NSAttributedString.Key.foregroundColor: UIColor.white]
115 - let attrBold = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-Bold", size: 17) ?? UIFont.boldSystemFont(ofSize: 16), NSAttributedString.Key.foregroundColor: UIColor.white]
116 -
117 - let couponsValueNormalText1 = "Έχεις κουπόνια συνολικής αξίας "
118 - let couponsValueBoldText = couponsValueString + "€"
119 -
120 - let couponsValueAttributedString = NSMutableAttributedString(string:couponsValueNormalText1, attributes:attrRegular)
121 - let couponsValueBoldString = NSMutableAttributedString(string: couponsValueBoldText, attributes:attrBold)
122 -
123 - couponsValueAttributedString.append(couponsValueBoldString)
124 - couponsValueLabel.attributedText = couponsValueAttributedString
125 -
126 - mapButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 16)
127 - mapButton.setTitle("Δες στο χάρτη", for: .normal)
128 - mapButton.setTitleColor(UIColor(rgb: 0x006D26), for: .normal)
129 - mapButton.layer.cornerRadius = 10.0
130 - mapButton.frame = CGRect(x: 0.0, y: 0.0, width: 148, height: 48)
131 -// mapButton.frame = CGRect(x: 0.0, y: 0.0, width: mapButton.intrinsicContentSize.width, height: 55)
132 -// mapButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 25, bottom: 0, right: 25)
133 - mapButton.backgroundColor = .clear
134 - mapButton.layer.borderWidth = 2
135 - mapButton.layer.borderColor = UIColor(rgb: 0x006D26).cgColor
136 -
137 - smLogosView.layer.cornerRadius = 16.0
138 - smLogosView.layer.maskedCorners = [ .layerMinXMaxYCorner, .layerMaxXMaxYCorner] // Bottom left, right corner radius
139 -
140 - // TODO: FIX - Replace with dynamic images
141 -// let imageNames = ["active_code_logo_2", "active_code_logo_2", "active_code_logo_2"]
142 -// // let images = imageNames.compactMap { UIImage(named: $0) }
143 -// let images = imageNames.compactMap { UIImage(named: $0, in: MyEmptyClass.resourceBundle(), compatibleWith: nil) }
144 -
145 -// // Create a horizontal stack view
146 -// let stackView = UIStackView()
147 -// stackView.axis = .horizontal
148 -// stackView.spacing = 15 // Spacing between images
149 -// stackView.alignment = .center
150 -// stackView.distribution = .equalSpacing
151 -
152 -// // Add UIImageViews to the stack view
153 -// for image in images {
154 -// let imageView = UIImageView(image: image)
155 -// imageView.contentMode = .scaleAspectFit
156 -// imageView.widthAnchor.constraint(equalToConstant: 40).isActive = true // Set a width
157 -// imageView.heightAnchor.constraint(equalToConstant: 40).isActive = true // Set a height
158 -// stackView.addArrangedSubview(imageView)
159 -// }
160 -
161 -// // Add the stack view to your main view
162 -// smLogosView.addSubview(stackView)
163 -
164 -// // Set up constraints for the stack view
165 -// stackView.translatesAutoresizingMaskIntoConstraints = false
166 -// NSLayoutConstraint.activate([
167 -// stackView.leadingAnchor.constraint(equalTo: smLogosView.leadingAnchor, constant: 25),
168 -// stackView.centerYAnchor.constraint(equalTo: smLogosView.centerYAnchor),
169 -// ])
170 -
171 - if let tempMarketPassDetails = swiftApi().getMarketPassDetails() {
172 - self.marketPassDetails = tempMarketPassDetails
173 - self.updateUI()
174 - } else {
175 - self.showDialog("Αποτυχία","Κάτι πήγε στραβά")
176 - }
177 - }
178 -
179 - func updateUI() {
180 -// let barcodeString = constructBarcode(coupon: marketPassDetails?._barcode) ?? ""
181 - let barcodeString = marketPassDetails?._barcode ?? ""
182 - barcodeLabel.text = barcodeString
183 - barcodeLabel.frame.size.width = barcodeLabel.intrinsicContentSize.width
184 - barcodeLabel.frame.size.height = barcodeLabel.intrinsicContentSize.height
185 -
186 - if let barcodeUIImage = RSUnifiedCodeGenerator.shared.generateCode(barcodeString, machineReadableCodeObjectType: AVMetadataObject.ObjectType.ean13.rawValue, targetSize: CGSize(width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.12)) {
187 -// if let barcodeUIImage = RSUnifiedCodeGenerator.shared.generateCode(barcodeString, machineReadableCodeObjectType: AVMetadataObject.ObjectType.ean13.rawValue, targetSize: CGSize(width: 110, height: 83)) {
188 - barcodeImage.image = barcodeUIImage
189 -
190 - barcodeImageHeight.constant = self.uiscreen.height * 0.12
191 -// barcodeImageHeight.constant = 83
192 -
193 - } else {
194 - barcodeImageHeight.constant = 0
195 - }
196 -
197 - let couponsValueFloat = marketPassDetails?._total_available_discount ?? 0.0
198 - let couponsValueString = String(format: "%.2f", couponsValueFloat)
199 - // let couponsValueString = String(marketPassDetails?._total_available_discount ?? 0.0)
200 - let attrRegular = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-Regular", size: 17) ?? UIFont.systemFont(ofSize: 16), NSAttributedString.Key.foregroundColor: UIColor.white]
201 - let attrBold = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-Bold", size: 17) ?? UIFont.boldSystemFont(ofSize: 16), NSAttributedString.Key.foregroundColor: UIColor.white]
202 -
203 - let couponsValueNormalText1 = "Έχεις κουπόνια συνολικής αξίας "
204 - let couponsValueBoldText = couponsValueString + "€"
205 -
206 - let couponsValueAttributedString = NSMutableAttributedString(string:couponsValueNormalText1, attributes:attrRegular)
207 - let couponsValueBoldString = NSMutableAttributedString(string: couponsValueBoldText, attributes:attrBold)
208 -
209 - couponsValueAttributedString.append(couponsValueBoldString)
210 - couponsValueLabel.attributedText = couponsValueAttributedString
211 -
212 - let supermarkets: Array<swiftApi.SupermarketModel> = marketPassDetails?._supermarkets ?? []
213 -
214 - // Create a horizontal stack view
215 - let stackView = UIStackView()
216 - stackView.axis = .horizontal
217 - stackView.spacing = 5 // Spacing between images
218 - stackView.alignment = .center
219 - stackView.distribution = .equalSpacing
220 -
221 - // Load images dynamically
222 - for sm in supermarkets {
223 - let imageView = UIImageView()
224 - imageView.contentMode = .scaleAspectFit
225 - imageView.widthAnchor.constraint(equalToConstant: 50).isActive = true
226 - imageView.heightAnchor.constraint(equalToConstant: 50).isActive = true
227 -
228 - imageView.load(link: sm._logo, placeholder: UIImage(), cache: URLCache())
229 -
230 - // Add image view to the stack view
231 - stackView.addArrangedSubview(imageView)
232 - }
233 -
234 - // Add the stack view to your main view
235 - smLogosView.addSubview(stackView)
236 -
237 - // Set up constraints for the stack view
238 - stackView.translatesAutoresizingMaskIntoConstraints = false
239 - NSLayoutConstraint.activate([
240 - stackView.leadingAnchor.constraint(equalTo: smLogosView.leadingAnchor, constant: 25),
241 - stackView.centerYAnchor.constraint(equalTo: smLogosView.centerYAnchor),
242 - ])
243 -
244 - passContainerView.isHidden = false
245 - self.view.layoutIfNeeded()
246 - }
247 -
248 - // func showSpinner() {
249 - // // add the spinner view controller
250 - // // addChild(spinner)
251 - // // spinner.view.frame = view.frame
252 - // // view.addSubview(spinner.view)
253 - // // spinner.didMove(toParent: self)
254 -
255 - // addChild(spinner)
256 - // spinner.view.frame = CGRect(x: 0, y: 0, width: self.view.frame.width, height: self.view.frame.height)
257 - // self.view.addSubview(spinner.view)
258 - // spinner.didMove(toParent: self)
259 - // }
260 -
261 - // func hideSpinner() {
262 - // // remove the spinner view controller
263 - // spinner.willMove(toParent: nil)
264 - // spinner.view.removeFromSuperview()
265 - // spinner.removeFromParent()
266 - // }
267 -
268 - func showDialog(_ alertTitle: String, _ alertSubTitle: String) -> Void {
269 -
270 - let alert = UIAlertController(title: alertTitle, message: alertSubTitle, preferredStyle: .alert)
271 - alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
272 - switch action.style{
273 - case .default:
274 - print("default")
275 -
276 - case .cancel:
277 - print("cancel")
278 -
279 - case .destructive:
280 - print("destructive")
281 -
282 - }
283 - }))
284 - self.present(alert, animated: true, completion: nil)
285 - }
286 -
287 - func constructBarcode() -> String? {
288 - // EAN 13 barcode construction
289 - //TODO: FIX
290 -// let couponString = coupon?._barcode ?? ""
291 - let couponString = "123456789101112"
292 -
293 - if (!couponString.isEmpty) {
294 - var checkDigit = 0;
295 - var result = 0;
296 -
297 - var fixedCouponCode = couponString;
298 - if (fixedCouponCode.count < 12) {
299 - let loops = 12 - fixedCouponCode.count;
300 - var zerosStr = "";
301 - for i in 0 ..< loops {
302 - zerosStr += "0"
303 - }
304 - // fixedCouponCode = zerosStr + fixedCouponCode;
305 - fixedCouponCode = fixedCouponCode + zerosStr;
306 - }
307 -
308 - var multiplier = 3;
309 - for idx in (0 ... (fixedCouponCode.count - 1)).reversed() {
310 - let curChar = fixedCouponCode[idx];
311 - result += (Int(curChar) ?? 0) * multiplier;
312 - multiplier = multiplier == 3 ? 1 : 3;
313 - }
314 - checkDigit = 10 - (result % 10);
315 -
316 - let barcodeStr = fixedCouponCode + String(checkDigit);
317 - return barcodeStr;
318 - }
319 -
320 - return ""
321 - }
322 -
323 - // MARK: - API Functions
324 - // func getMarketPassDetailsRequest() {
325 - // showSpinner()
326 -
327 - // swiftApi().getMarketPassDetailsAsync(getMarketPassDetailsCallback, failureCallback: {errorCode in
328 - // print("========= getMarketPassDetailsRequest ERROR CODE =========", errorCode)
329 - // self.hideSpinner()
330 - // self.showDialog("Αποτυχία","Κάτι πήγε στραβά")
331 - // })
332 - // }
333 -
334 - // func getMarketPassDetailsCallback (_ marketPassDetailsData: swiftApi.MarketPassDetailsModel?) -> Void {
335 - // self.hideSpinner()
336 -
337 - // if (marketPassDetailsData != nil) {
338 - // DispatchQueue.main.async {
339 - // if let tempMarketPassDetailsData = marketPassDetailsData {
340 - // self.marketPassDetails = tempMarketPassDetailsData
341 - // self.updateUI()
342 - // }
343 - // }
344 - // } else {
345 - // self.showDialog("Αποτυχία","Κάτι πήγε στραβά")
346 - // }
347 - // }
348 -
349 - // MARK: - Actions
350 - @IBAction func mapButtonAction(_ sender: Any) {
351 - swiftApi().openSupermarketMap(self)
352 - }
353 -
354 -}
1 -//
2 -// MarketSharingHistoryViewController.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 5/4/23.
6 -//
7 -
8 -import UIKit
9 -
10 -class MarketSharingHistoryViewController: AnalysisChildViewController {
11 -
12 - var loading: Bool = false
13 - var items: Array<swiftApi.SharingCouponModel> = Array()
14 - var allItems: Array<swiftApi.SharingCouponModel> = Array()
15 - var showMore = false
16 -
17 - // TODO: remove this when configuring model
18 - let hasMessage = false
19 -
20 - // lifecycle
21 - override func viewDidLoad() {
22 -
23 - super.viewDidLoad()
24 -
25 - self.tableView.delegate = self
26 - self.tableView.dataSource = self
27 -
28 - // Add shadow
29 - self.tableView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
30 - self.tableView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
31 - self.tableView.layer.shadowOpacity = 1.0
32 - self.tableView.layer.shadowRadius = 1.0
33 -
34 - self.refreshControl = UIRefreshControl()
35 - self.refreshControl?.addTarget(self, action: #selector(handleRefresh(_:)), for: .valueChanged)
36 -
37 - handleRefresh(self.refreshControl!)
38 - }
39 -
40 - // mvp
41 - @objc func load() {
42 -
43 - if (loading) {
44 - return;
45 - }
46 -
47 - showLoading()
48 -
49 - swiftApi().getSharingHistoryAsync(isMarketHistory: true, getSharingHistoryCallback: responseCallback, failureCallback: {errorCode in })
50 - }
51 -
52 - private func showLoading() {
53 -
54 - loading = true
55 - if (self.refreshControl!.isRefreshing) {
56 - return;
57 - }
58 -
59 - self.refreshControl!.beginRefreshing()
60 - }
61 -
62 - private func showError() {
63 - }
64 -
65 - private func showContent() {
66 -
67 - loading = false
68 - self.refreshControl!.endRefreshing()
69 - }
70 -
71 - // private
72 - func responseCallback (_ data: Array<swiftApi.SharingCouponModel>?) -> Void {
73 -
74 - self.items = data!
75 - self.allItems = data!
76 - self.showMore = (self.items.count > 3)
77 -
78 - if (self.showMore == true) {
79 - self.items = Array(self.items[0...2])
80 - }
81 - showContent()
82 - DispatchQueue.main.async {
83 - self.tableView.reloadData()
84 - }
85 - }
86 -
87 - @objc func handleRefresh(_ refreshControl: UIRefreshControl) {
88 -
89 - self.perform(_: #selector(load), with: nil, afterDelay: 0.5)
90 - }
91 -
92 - // MARK: - Table view data source
93 - override func numberOfSections(in tableView: UITableView) -> Int {
94 - return 2
95 - }
96 -
97 - override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
98 - if (section == 0) {
99 - return 1;
100 - }
101 -
102 - if (self.showMore == true) {
103 - return 4
104 - }
105 - return items.count
106 - }
107 -
108 - override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
109 -// if (indexPath.section == 0) {
110 -// return hasMessage ? 380.0 : (items.count > 0 ? 280 : 380)
111 -// }
112 -//
113 -// return 140.0
114 - return UITableView.automaticDimension
115 - }
116 -
117 - override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
118 -
119 - // header
120 - if (indexPath.section == 0) {
121 - if (hasMessage) {
122 - return tableView.dequeueReusableCell(withIdentifier: "AnalysisHeaderMessageViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisHeaderMessageViewCell
123 - }
124 -
125 - let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisHeaderViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisHeaderViewCell
126 - cell.configureCell(isEmpty: items.count == 0, isMarket: true)
127 - return cell
128 - }
129 -
130 - if ((self.showMore == true) && (indexPath.row == 3)) {
131 - let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisMoreViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisMoreViewCell
132 - return cell
133 - }
134 -
135 - let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisItemViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisItemViewCell
136 - cell.configureCell(item: items[indexPath.row], isMarket: true)
137 -
138 - return cell
139 - }
140 -
141 - override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
142 - if (indexPath.section == 0) {
143 - return
144 - }
145 -
146 - if ((self.showMore == true) && (indexPath.row == 3)) {
147 - self.items = self.allItems
148 - self.showMore = false
149 - self.tableView.reloadData()
150 - }
151 - }
152 -
153 - override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
154 - if (section == 0){
155 - return nil
156 -
157 - } else if (section == 1) {
158 - if (self.items.count > 0) {
159 - let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 50))
160 -
161 - let viewBorder = UIView(frame: CGRect(x: 10, y: 0, width: view.frame.width-20, height: view.frame.height))
162 - viewBorder.backgroundColor = .white
163 - // viewBorder.backgroundColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00)
164 -
165 - viewBorder.layer.cornerRadius = 16.5
166 - viewBorder.layer.maskedCorners = [ .layerMinXMinYCorner, .layerMaxXMinYCorner] // Top left, bottom right corner radius
167 -
168 - let viewInner = UIView(frame: CGRect(x: 1, y: 1, width: viewBorder.frame.width-2, height: viewBorder.frame.height-1))
169 - viewInner.backgroundColor = .white
170 -
171 - viewInner.layer.cornerRadius = 16.5
172 - viewInner.layer.maskedCorners = [ .layerMinXMinYCorner, .layerMaxXMinYCorner] // Top left, bottom right corner radius
173 -
174 - let titleLabel = UILabel(frame: CGRect(x: 20, y: 20, width: viewInner.frame.width - 40, height: 20))
175 - titleLabel.font = UIFont(name: "BTCosmo-Bold", size: 20)
176 - titleLabel.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
177 - titleLabel.text = "Αναλυτικά"
178 -
179 - view.addSubview(viewBorder)
180 - viewBorder.addSubview(viewInner)
181 - viewInner.addSubview(titleLabel)
182 - return view
183 - } else {
184 - return nil
185 - }
186 -
187 -
188 - } else {
189 - return nil
190 - }
191 - }
192 -
193 - override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
194 - if (section == 0) {
195 - return 0.0
196 -
197 - } else if (section == 1) {
198 - if (self.items.count > 0) {
199 - return 50.0
200 - } else {
201 - return 0.0
202 - }
203 -
204 - } else {
205 - return 0.0
206 - }
207 - }
208 -
209 - override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
210 -// return CGFloat.leastNormalMagnitude
211 - if (section == 1 && self.items.count > 0) {
212 - return 20.0
213 - } else {
214 - return 0.0
215 - }
216 - }
217 -
218 - override func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
219 - if (section == 1) {
220 - if (self.items.count > 0) {
221 - let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 30))
222 -
223 - let viewBorder = UIView(frame: CGRect(x: 10, y: 0, width: view.frame.width-20, height: view.frame.height))
224 - viewBorder.backgroundColor = .white
225 - // viewBorder.backgroundColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00)
226 -
227 - viewBorder.layer.cornerRadius = 16.5
228 - viewBorder.layer.maskedCorners = [ .layerMinXMaxYCorner, .layerMaxXMaxYCorner] // bottom left, bottom right corner radius
229 -
230 - let viewInner = UIView(frame: CGRect(x: 1, y: 0, width: viewBorder.frame.width-2, height: viewBorder.frame.height-1))
231 - viewInner.backgroundColor = .white
232 -
233 - viewInner.layer.cornerRadius = 16.5
234 - viewInner.layer.maskedCorners = [ .layerMinXMaxYCorner, .layerMaxXMaxYCorner] // bottom left, bottom right corner radius
235 -
236 - view.addSubview(viewBorder)
237 - viewBorder.addSubview(viewInner)
238 - return view
239 - } else {
240 - return nil
241 - }
242 -
243 - } else {
244 - return nil
245 - }
246 - }
247 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "active_code_logo.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "active_code_logo-1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "active_code_logo-2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "active_code_logo_2.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "active_code_logo_2 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "active_code_logo_2 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "arrow_right_black.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "arrow_right_black 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "arrow_right_black 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "circle_checked.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "circle_checked 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "circle_checked 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "circle_unchecked.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "circle_unchecked 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "circle_unchecked 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "coupon_bg.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "coupon_bg-1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "coupon_bg-2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "coupon_bg_2.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "coupon_bg_2 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "coupon_bg_2 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "coupon_bg_2_selected.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "coupon_bg_2_selected 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "coupon_bg_2_selected 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "coupon_bg_grey.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "coupon_bg_grey 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "coupon_bg_grey 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "coupon_bg_shadow.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "coupon_bg_shadow 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "coupon_bg_shadow 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "coupon_bg_shadow_grey.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "coupon_bg_shadow_grey 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "coupon_bg_shadow_grey 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "coupon_market.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "coupon_market 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "coupon_market 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "coupon_market_2.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "coupon_market_2 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "coupon_market_2 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "coupons_scrollview_dark.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "coupons_scrollview_dark-1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "coupons_scrollview_dark-2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "coupons_scrollview_white.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "coupons_scrollview_white-1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "coupons_scrollview_white-2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "curved_bg_white.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "curved_bg_white-1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "curved_bg_white-2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "curved_bg_white_2.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "curved_bg_white_2 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "curved_bg_white_2 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "default_profile_image.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "default_profile_image-1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "default_profile_image-2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "default_profile_image_2.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "default_profile_image_2 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "default_profile_image_2 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "dfy_logo_colored.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "dfy_logo_colored 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "dfy_logo_colored 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "dfy_logo_white.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "dfy_logo_white-1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "dfy_logo_white-2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "eshop_ab.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "eshop_ab 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "eshop_ab 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "eshop_masoutis.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "eshop_masoutis 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "eshop_masoutis 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "heart.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "heart-1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "heart-2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "history_banner_box.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "history_banner_box 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "history_banner_box 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "history_banner_dfy.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "history_banner_dfy 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "history_banner_dfy 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "history_banner_gfy.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "history_banner_gfy 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "history_banner_gfy 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "history_banner_sm.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "history_banner_sm 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "history_banner_sm 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "history_heart.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "history_heart 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "history_heart 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "ic_pin_location.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "ic_pin_location-1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "ic_pin_location-2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "ic_background_circle.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "ic_background_circle-1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "ic_background_circle-2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "ic_background_straight.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "ic_background_straight 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "ic_background_straight 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "ic_pin_compass.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "ic_pin_compass-1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "ic_pin_compass-2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "ic_down_dark.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "ic_down_dark-1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "ic_down_dark-2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "ic_down_dark_2.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "ic_down_dark_2 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "ic_down_dark_2 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "ic_empty_wallet.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "ic_empty_wallet-1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "ic_empty_wallet-2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "ic_empty_wallet_2.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "ic_empty_wallet_2 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "ic_empty_wallet_2 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "ic_empty_wallet_3.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "ic_empty_wallet_3 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "ic_empty_wallet_3 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "ic_gift_circle.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "ic_gift_circle-1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "ic_gift_circle-2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "ic_gift_circle_2.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "ic_gift_circle_2-1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "ic_gift_circle_2-2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "ic_gift_history.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "ic_gift_history 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "ic_gift_history 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "ic_history_market.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "ic_history_market 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "ic_history_market 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "ic_history_market_2.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "ic_history_market_2 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "ic_history_market_2 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "ic_pin_tel.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "ic_pin_tel-1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "ic_pin_tel-2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "ic_time_forward.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "ic_time_forward 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "ic_time_forward 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "ic_time_forward_blue.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "ic_time_forward_blue 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "ic_time_forward_blue 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "ic_up_dark.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "ic_up_dark-1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "ic_up_dark-2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "ic_up_dark_2.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "ic_up_dark_2 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "ic_up_dark_2 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "map_pin.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "map_pin 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "map_pin 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "market_bg.jpg",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "market_bg 1.jpg",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "market_bg 2.jpg",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "new_icon.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "new_icon-1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "new_icon-2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "new_icon_2.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "new_icon_2 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "new_icon_2 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "pass_info_ab.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "pass_info_ab 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "pass_info_ab 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "pass_info_cart.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "pass_info_cart 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "pass_info_cart 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "pass_info_globe.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "pass_info_globe 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "pass_info_globe 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "pass_info_hero.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "pass_info_hero 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "pass_info_hero 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
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 - "images" : [
3 - {
4 - "filename" : "sm_ab.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "sm_ab 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "sm_ab 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "sm_masoutis.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "sm_masoutis 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "sm_masoutis 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "sm_sklavenitis.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "sm_sklavenitis 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "sm_sklavenitis 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "top_border_line.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "top_border_line-1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "top_border_line-2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "top_border_shadow.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "top_border_shadow-1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "top_border_shadow-2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "wallet_badge_lines.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "wallet_badge_lines 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "wallet_badge_lines 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "wallet_banner_box.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "wallet_banner_box 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "wallet_banner_box 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "wallet_banner_dfy.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "wallet_banner_dfy 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "wallet_banner_dfy 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "wallet_banner_gfy.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "wallet_banner_gfy 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "wallet_banner_gfy 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "wallet_banner_sm.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "wallet_banner_sm 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "wallet_banner_sm 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "wallet_coupons.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "wallet_coupons-1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "wallet_coupons-2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "wallet_coupons_2.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "wallet_coupons_2-1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "wallet_coupons_2-2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "wallet_coupons_3.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "wallet_coupons_3 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "wallet_coupons_3 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "wallet_coupons_4.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "wallet_coupons_4 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "wallet_coupons_4 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "wallet_coupons_empty.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "wallet_coupons_empty 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "wallet_coupons_empty 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "wallet_dfy_2.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "wallet_dfy_2 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "wallet_dfy_2 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "wallet_dfy_3.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "wallet_dfy_3 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "wallet_dfy_3 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "wallet_dfy_earn.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "wallet_dfy_earn-1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "wallet_dfy_earn-2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "wallet_dfy_empty.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "wallet_dfy_empty 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "wallet_dfy_empty 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "wallet_history.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "wallet_history 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "wallet_history 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "wallet_history_blue.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "wallet_history_blue 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "wallet_history_blue 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "wallet_market.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "wallet_market 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "wallet_market 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "wallet_market_2.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "wallet_market_2 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "wallet_market_2 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "wallet_market_empty.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "wallet_market_empty 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "wallet_market_empty 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "wallet_plus.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "wallet_plus 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "wallet_plus 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "wallet_plus_blue.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "wallet_plus_blue 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "wallet_plus_blue 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "wallet_summary.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "wallet_summary 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "wallet_summary 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "wallet_summary_2.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "wallet_summary_2 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "wallet_summary_2 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -{
2 - "images" : [
3 - {
4 - "filename" : "wallet_voucher.png",
5 - "idiom" : "universal",
6 - "scale" : "1x"
7 - },
8 - {
9 - "filename" : "wallet_voucher 1.png",
10 - "idiom" : "universal",
11 - "scale" : "2x"
12 - },
13 - {
14 - "filename" : "wallet_voucher 2.png",
15 - "idiom" : "universal",
16 - "scale" : "3x"
17 - }
18 - ],
19 - "info" : {
20 - "author" : "xcode",
21 - "version" : 1
22 - }
23 -}
1 -//
2 -// MerchantAnnotation.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 20/9/22.
6 -//
7 -
8 -import Foundation
9 -import MapKit
10 -
11 -@objc public class MerchantAnnotation: NSObject, MKAnnotation {
12 - let model: swiftApi.MerchantModel
13 - public let coordinate: CLLocationCoordinate2D
14 -
15 -
16 - init(_ model: swiftApi.MerchantModel) {
17 - self.model = model
18 - self.coordinate = CLLocationCoordinate2D(latitude: model._latitude, longitude: model._longitude)
19 - super.init()
20 - }
21 -}
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 - let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList()
27 -
28 - var postImageURL: String? {
29 - didSet {
30 - if let url = postImageURL {
31 - self.merchantImage.image = UIImage() // UIImage(named: "loading")
32 -
33 - UIImage.loadImageUsingCacheWithUrlString(url) { image in
34 - // set the image only when we are still displaying the content for the image we finished downloading
35 - if url == self.postImageURL {
36 - self.merchantImage.image = image
37 - }
38 - }
39 - }
40 - else {
41 - self.merchantImage.image = nil
42 - }
43 - }
44 - }
45 -
46 - override func awakeFromNib() {
47 - super.awakeFromNib()
48 - // Initialization code
49 -
50 - mainView.backgroundColor = UIColor(rgb: 0xF2F2F3)
51 - mainView.layer.cornerRadius = 20.0
52 -
53 - buttonTitleLable.font = UIFont(name: "PeridotPE-SBold", size: 13)
54 - buttonTitleLable.textColor = UIColor(rgb: 0xFFFFFF)
55 -
56 - buttonView.backgroundColor = UIColor(rgb: 0x0EA600)
57 - buttonView.layer.cornerRadius = 12.0
58 -
59 - // Add action for button tap
60 - actionButton.addTarget(self, action: #selector(buttonTapped), for: .touchUpInside)
61 - }
62 -
63 - override func setSelected(_ selected: Bool, animated: Bool) {
64 - super.setSelected(selected, animated: animated)
65 -
66 - // Configure the view for the selected state
67 - }
68 -
69 -// public override func layoutSubviews() {
70 -// super.layoutSubviews()
71 -// //set the values for top,left,bottom,right margins
72 -// let margins = UIEdgeInsets(top: 0, left: 0, bottom: 32, right: 0)
73 -// contentView.frame = contentView.frame.inset(by: margins)
74 -// }
75 -
76 - func configureCell(shop: swiftApi.ShopAvailabilityItemModel, buttonTitle: String, iconImage: String?, showEshops: Bool?) {
77 -
78 - if (showEshops == true) {
79 - if (shop._merchant_uuid == "ab") {
80 - self.merchantImage.image = UIImage(named: "eshop_ab", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
81 - } else if (shop._merchant_uuid == "masoutis") {
82 - self.merchantImage.image = UIImage(named: "eshop_masoutis", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
83 - }
84 -
85 - } else {
86 - for merchant in merchantList {
87 - if (merchant._uuid == shop._merchant_uuid) {
88 - self.postImageURL = merchant._img_preview
89 - break;
90 - }
91 - }
92 - }
93 -
94 - buttonTitleLable.text = buttonTitle
95 -
96 - if let iconImage {
97 - self.buttonIconImage.image = UIImage(named: iconImage, in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
98 - self.buttonIconImage.isHidden = false
99 - } else {
100 - self.buttonIconImage.isHidden = true
101 - }
102 - }
103 -
104 - @objc private func buttonTapped() {
105 - // Notify the delegate when button is tapped
106 - delegate?.didTapButton(in: self)
107 - }
108 -}
...@@ -80,33 +80,14 @@ ...@@ -80,33 +80,14 @@
80 - (NSDictionary*)redeemCouponWithCoupon:(NSString*)coupon :(NSString*)communication_uuid; 80 - (NSDictionary*)redeemCouponWithCoupon:(NSString*)coupon :(NSString*)communication_uuid;
81 - (NSDictionary*)validateCouponWithCoupon:(NSString*)coupon; 81 - (NSDictionary*)validateCouponWithCoupon:(NSString*)coupon;
82 - (NSDictionary*)loginCosmoteWithGuid:(NSString*)guid andAppUuid:(NSString*)appUuid andTicket:(NSString*)ticket; 82 - (NSDictionary*)loginCosmoteWithGuid:(NSString*)guid andAppUuid:(NSString*)appUuid andTicket:(NSString*)ticket;
83 -- (void)getCouponsWithSuccessBlock:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
84 - (void)getCouponsUniversalAsync:(NSString*)language :(NSString*)couponsetType :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; 83 - (void)getCouponsUniversalAsync:(NSString*)language :(NSString*)couponsetType :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
85 -- (void) createUnifiedCouponAsync:(NSArray*)couponCodes :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
86 -- (void)getUnifiedCouponsAsync:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
87 - (void) getAvailableCouponsAsync:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; 84 - (void) getAvailableCouponsAsync:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
88 - (void)getCouponsetsAsync:(NSNumber*) active andVisible:(NSNumber*) visible andUuids:(NSArray*) uuids :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; 85 - (void)getCouponsetsAsync:(NSNumber*) active andVisible:(NSNumber*) visible andUuids:(NSArray*) uuids :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
89 -- (void)getCouponsetsDealsAsync:(NSNumber*) active andVisible:(NSNumber*) visible andUuids:(NSArray*) uuids :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
90 -- (void) cancelUnifiedCouponAsync:(NSString*) transactionId :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
91 -- (void)getInboxAsync:(void (^)(NSArray *list))success failureBlock:(void (^)(NSError *error))failure;
92 - (void)verifyTicketAsync:(NSString*)guid :(NSString*)ticket :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; 86 - (void)verifyTicketAsync:(NSString*)guid :(NSString*)ticket :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
93 -- (void)getProfileAsync:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
94 -- (void)consumerIntegrationAsync:(NSNumber*)nonTelco :(NSNumber*)acceptedConsent :(NSArray*)msisdnList :(NSString*)guid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
95 - (void)getMarketPassDetailsAsync:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; 87 - (void)getMarketPassDetailsAsync:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
96 -- (void)redeemCouponSetAsync:(NSString*)uuid :(NSString*)communication_uuid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
97 -- (void)redeemCouponSetAsync:(NSString*)uuid :(NSString*)communication_uuid :(NSString*)user_msisdn :(NSString*)businessService :(NSString*)offerName :(NSString*)productType :(NSString*)provDuration :(NSString*)noOfRecurrance :(NSString*)price :(NSString*)discount :(NSString*)voiceCategory :(NSString*)dataCategory :(NSString*)minsValue :(NSString*)dataValue :(NSString*)provStepValueMins :(NSString*)OfferAudienceLevel :(NSString*)UACIOfferTrackingCode :(NSString*)OFFERCODE1 :(NSString*)SCORE :(NSString*)ZONE :(NSString*)WAVE :(NSString*)VALIDITY :(NSString*)TREATMENT_CODE :(NSString*)ccms_session_id :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
98 -- (void)getPacingDetailsAsync:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
99 -- (void)setPacingDetailsAsync:(NSNumber*)steps :(NSString*)date :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
100 -- (void)cosmoteSharingAsync:(NSString*)sharingId :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
101 -- (void)cosmoteRetrieveSharingAsync:(NSString*)sharingId :(NSNumber*)accept :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
102 - (void)getCosmoteUserAsync:(NSString*)guid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; 88 - (void)getCosmoteUserAsync:(NSString*)guid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
103 -- (void)cosmoteCouponSharingAsync:(NSString*) coupon :(NSString*)sender :(NSString*)receiver :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
104 -- (void)submitOrderAsync:(NSString*) campaign_session_uuid :(NSString*)user_msisdn :(NSString*)businessService :(NSString*)offerName :(NSString*)productType :(NSString*)provDuration :(NSString*)noOfRecurrance :(NSString*)price :(NSString*)discount :(NSString*)voiceCategory :(NSString*)dataCategory :(NSString*)minsValue :(NSString*)dataValue :(NSString*)provStepValueMins :(NSString*)OfferAudienceLevel :(NSString*)UACIOfferTrackingCode :(NSString*)OFFERCODE1 :(NSString*)SCORE :(NSString*)ZONE :(NSString*)WAVE :(NSString*)VALIDITY :(NSString*)TREATMENT_CODE :(NSString*)ccms_session_id :(NSString*)notificationMessage :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
105 -- (void)postEventAsync:(NSString*)Session_ID :(NSString*)OfferAudienceLevel :(NSString*)msisdn :(NSString*)UACIOfferTrackingCode :(NSString*)OFFERCODE1 :(NSString*)SCORE :(NSString*)ZONE :(NSString*)WAVE :(NSString*)VALIDITY :(NSString*)TREATMENT_CODE :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
106 - (void)getCampaignsAsyncNew:(NSString*)language :(NSDictionary*)filters :(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure; 89 - (void)getCampaignsAsyncNew:(NSString*)language :(NSDictionary*)filters :(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure;
107 - (void)getCampaignsPersonalizedAsync:(NSString*)language :(NSDictionary*)filters :(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure; 90 - (void)getCampaignsPersonalizedAsync:(NSString*)language :(NSDictionary*)filters :(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure;
108 -- (void)getSharingHistoryAsync:(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure;
109 -- (void)getMarketSharingHistoryAsync:(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure;
110 - (void)getMultilingualMerchantsAsync:(NSArray*)categories andDefaultShown:(NSNumber*)defaultShown andCenter:(NSNumber*)center andTags:(NSArray*)tags andUuid:(NSString*)uuid andDistance:(NSNumber*)distance parent_uuids:(NSArray*)parent_uuids :(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure; 91 - (void)getMultilingualMerchantsAsync:(NSArray*)categories andDefaultShown:(NSNumber*)defaultShown andCenter:(NSNumber*)center andTags:(NSArray*)tags andUuid:(NSString*)uuid andDistance:(NSNumber*)distance parent_uuids:(NSArray*)parent_uuids :(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure;
111 // - (void)didReceiveNotification:(NSDictionary *)userInfo whileAppWasInState:(WLApplicationState)state; 92 // - (void)didReceiveNotification:(NSDictionary *)userInfo whileAppWasInState:(WLApplicationState)state;
112 - (void)didReceiveNotification:(NSDictionary *)payload; 93 - (void)didReceiveNotification:(NSDictionary *)payload;
...@@ -118,9 +99,7 @@ ...@@ -118,9 +99,7 @@
118 // - (BOOL)checkforLoyaltySDKNotification:(NSDictionary *)payload :(void(^)(NSNumber *successResponse))success failureBlock:(void(^)(NSNumber *failureResponse))failure; 99 // - (BOOL)checkforLoyaltySDKNotification:(NSDictionary *)payload :(void(^)(NSNumber *successResponse))success failureBlock:(void(^)(NSNumber *failureResponse))failure;
119 - (void)sendDeviceInfoIfNecessary:(NSString *)newDeviceToken; 100 - (void)sendDeviceInfoIfNecessary:(NSString *)newDeviceToken;
120 - (BOOL)sdkInitialised; 101 - (BOOL)sdkInitialised;
121 -- (void)editProfileAsync:(NSString*)firstname andLastname:(NSString*)lastname andEmail:(NSString *)email andSalutation:(NSString *)salutation andMsisdn:(NSString *)msisdn andNickname:(NSString *)nickname andGender:(NSString *)gender andBirthday:(NSString *)birthday andNameDay:(NSString *)nameday andTaxID:(NSString *)taxid andProfileMetadata:(NSDictionary *)profileMetadata optin:(NSNumber *)optin newsLetter:(NSNumber *)newsletter andSMS:(NSNumber *)sms andSegmentation:(NSNumber *)segmentation andSMSSegmentation:(NSNumber *)smsSegmentation :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
122 - (void)getSingleCampaignAsync:(NSString*)sessionUuid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; 102 - (void)getSingleCampaignAsync:(NSString*)sessionUuid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
123 -- (void)getMapDataAsync:(NSString*)language :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
124 - (void) sendEvent: (NSString *) eventName priority: (BOOL) priority; 103 - (void) sendEvent: (NSString *) eventName priority: (BOOL) priority;
125 - (void)updateRefreshTokenMA:(NSString*)access_token :(NSString*)refresh_token; 104 - (void)updateRefreshTokenMA:(NSString*)access_token :(NSString*)refresh_token;
126 - (NSString*)getAccessTokenM; 105 - (NSString*)getAccessTokenM;
......
...@@ -1449,20 +1449,6 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify"; ...@@ -1449,20 +1449,6 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify";
1449 return resp; 1449 return resp;
1450 } 1450 }
1451 1451
1452 -- (void)getCouponsWithSuccessBlock:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
1453 -{
1454 -
1455 - [[Warply sharedService] getCouponsWithSuccessBlock:^(NSDictionary *response) {
1456 - if (success) {
1457 - success(response);
1458 - }
1459 - } failureBlock:^(NSError *error) {
1460 - if (failure) {
1461 - failure(error);
1462 - }
1463 - }];
1464 -}
1465 -
1466 - (void)getCouponsUniversalAsync:(NSString*)language :(NSString*)couponsetType :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure 1452 - (void)getCouponsUniversalAsync:(NSString*)language :(NSString*)couponsetType :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
1467 { 1453 {
1468 1454
...@@ -1477,34 +1463,6 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify"; ...@@ -1477,34 +1463,6 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify";
1477 }]; 1463 }];
1478 } 1464 }
1479 1465
1480 -- (void) createUnifiedCouponAsync:(NSArray*)couponCodes :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
1481 -{
1482 -
1483 - [[Warply sharedService] createUnifiedCouponWithSuccessBlock:couponCodes :^(NSDictionary *response) {
1484 - if (success) {
1485 - success(response);
1486 - }
1487 - } failureBlock:^(NSError *error) {
1488 - if (failure) {
1489 - failure(error);
1490 - }
1491 - }];
1492 -}
1493 -
1494 -- (void)getUnifiedCouponsAsync:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
1495 -{
1496 -
1497 - [[Warply sharedService] getUnifiedCouponsWithSuccessBlock:^(NSDictionary *response) {
1498 - if (success) {
1499 - success(response);
1500 - }
1501 - } failureBlock:^(NSError *error) {
1502 - if (failure) {
1503 - failure(error);
1504 - }
1505 - }];
1506 -}
1507 -
1508 - (void) getAvailableCouponsAsync:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure 1466 - (void) getAvailableCouponsAsync:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
1509 { 1467 {
1510 [[Warply sharedService] getAvailableCouponsWithSuccessBlock:^(NSDictionary *response) { 1468 [[Warply sharedService] getAvailableCouponsWithSuccessBlock:^(NSDictionary *response) {
...@@ -1531,45 +1489,6 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify"; ...@@ -1531,45 +1489,6 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify";
1531 }]; 1489 }];
1532 } 1490 }
1533 1491
1534 -- (void) getCouponsetsDealsAsync:(NSNumber*) active andVisible:(NSNumber*) visible andUuids:(NSArray*) uuids :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
1535 -{
1536 - [[Warply sharedService] getCouponSetsDealsWithSuccessBlock:active andVisible:visible andUuids:uuids :^(NSDictionary *response) {
1537 - if (success) {
1538 - success(response);
1539 - }
1540 - } failureBlock:^(NSError *error) {
1541 - if (failure) {
1542 - failure(error);
1543 - }
1544 - }];
1545 -}
1546 -
1547 -- (void) cancelUnifiedCouponAsync:(NSString*) transactionId :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
1548 -{
1549 - [[Warply sharedService] cancelUnifiedCouponWithSuccessBlock:transactionId :^(NSDictionary *response) {
1550 - if (success) {
1551 - success(response);
1552 - }
1553 - } failureBlock:^(NSError *error) {
1554 - if (failure) {
1555 - failure(error);
1556 - }
1557 - }];
1558 -}
1559 -
1560 -- (void)getInboxAsync:(void (^)(NSArray *list))success failureBlock:(void (^)(NSError *error))failure
1561 -{
1562 - [[Warply sharedService] getInbox2WithSuccessBlock :^(NSArray *inbox) {
1563 - if (success) {
1564 - success(inbox);
1565 - }
1566 - } failureBlock:^(NSError *error) {
1567 - if (failure) {
1568 - failure(error);
1569 - }
1570 - }];
1571 -}
1572 -
1573 - (void)verifyTicketAsync:(NSString*)guid :(NSString*)ticket :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure 1492 - (void)verifyTicketAsync:(NSString*)guid :(NSString*)ticket :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
1574 { 1493 {
1575 [[Warply sharedService] verifyTicketWithSuccessBlock:guid :ticket :^(NSDictionary *response) { 1494 [[Warply sharedService] verifyTicketWithSuccessBlock:guid :ticket :^(NSDictionary *response) {
...@@ -1583,17 +1502,6 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify"; ...@@ -1583,17 +1502,6 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify";
1583 }]; 1502 }];
1584 } 1503 }
1585 1504
1586 -- (void)getProfileAsync:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
1587 -{
1588 - [[Warply sharedService] getProfileWithSuccessBlock:^(NSDictionary *response) {
1589 - if (success) {
1590 - success(response);
1591 - }
1592 - } failureBlock:^(NSError *error) {
1593 - failure(error);
1594 - }];
1595 -}
1596 -
1597 - (void)getMarketPassDetailsAsync:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure 1505 - (void)getMarketPassDetailsAsync:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
1598 { 1506 {
1599 [[Warply sharedService] getMarketPassDetailsWithSuccessBlock:^(NSDictionary *response) { 1507 [[Warply sharedService] getMarketPassDetailsWithSuccessBlock:^(NSDictionary *response) {
...@@ -1607,93 +1515,6 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify"; ...@@ -1607,93 +1515,6 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify";
1607 }]; 1515 }];
1608 } 1516 }
1609 1517
1610 -- (void)consumerIntegrationAsync:(NSNumber*)nonTelco :(NSNumber*)acceptedConsent :(NSArray*)msisdnList :(NSString*)guid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
1611 -{
1612 - [[Warply sharedService] consumerIntegrationWithSuccessBlock:nonTelco :acceptedConsent :msisdnList :guid :^(NSDictionary *response) {
1613 - if (success) {
1614 - success(response);
1615 - }
1616 - } failureBlock:^(NSError *error) {
1617 - if (failure) {
1618 - failure(error);
1619 - }
1620 - }];
1621 -}
1622 -
1623 -- (void)redeemCouponSetAsync:(NSString*)uuid :(NSString*)communication_uuid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
1624 -{
1625 - [[Warply sharedService] redeemCouponSetsWithSuccessBlock:uuid :communication_uuid :^(NSDictionary *response) {
1626 - if (success) {
1627 - success(response);
1628 - }
1629 - } failureBlock:^(NSError *error) {
1630 - if (failure) {
1631 - failure(error);
1632 - }
1633 - }];
1634 -}
1635 -
1636 -- (void)redeemCouponSetAsync:(NSString*)uuid :(NSString*)communication_uuid :(NSString*)user_msisdn :(NSString*)businessService :(NSString*)offerName :(NSString*)productType :(NSString*)provDuration :(NSString*)noOfRecurrance :(NSString*)price :(NSString*)discount :(NSString*)voiceCategory :(NSString*)dataCategory :(NSString*)minsValue :(NSString*)dataValue :(NSString*)provStepValueMins :(NSString*)OfferAudienceLevel :(NSString*)UACIOfferTrackingCode :(NSString*)OFFERCODE1 :(NSString*)SCORE :(NSString*)ZONE :(NSString*)WAVE :(NSString*)VALIDITY :(NSString*)TREATMENT_CODE :(NSString*)ccms_session_id :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
1637 -{
1638 - [[Warply sharedService] redeemCouponSetsWithSuccessBlock:uuid :communication_uuid :user_msisdn :businessService :offerName :productType :provDuration :noOfRecurrance :price :discount :voiceCategory :dataCategory :minsValue :dataValue :provStepValueMins :OfferAudienceLevel :UACIOfferTrackingCode :OFFERCODE1 :SCORE :ZONE :WAVE :VALIDITY :TREATMENT_CODE :ccms_session_id :^(NSDictionary *response) {
1639 - if (success) {
1640 - success(response);
1641 - }
1642 - } failureBlock:^(NSError *error) {
1643 - if (failure) {
1644 - failure(error);
1645 - }
1646 - }];
1647 -}
1648 -
1649 -- (void)getPacingDetailsAsync:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
1650 -{
1651 - [[Warply sharedService] getPacingDetailsWithSuccessBlock:^(NSDictionary *response) {
1652 - if (success) {
1653 - success(response);
1654 - }
1655 - } failureBlock:^(NSError *error) {
1656 - failure(error);
1657 - }];
1658 -}
1659 -
1660 -- (void)setPacingDetailsAsync:(NSNumber*)steps :(NSString*)date :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
1661 -{
1662 - [[Warply sharedService] setPacingDetailsWithSuccessBlock:steps :date :^(NSDictionary *response) {
1663 - if (success) {
1664 - success(response);
1665 - }
1666 - } failureBlock:^(NSError *error) {
1667 - failure(error);
1668 - }];
1669 -}
1670 -
1671 -- (void)cosmoteSharingAsync:(NSString*)sharingId :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
1672 -{
1673 - [[Warply sharedService] cosmoteSharingWithSuccessBlock:sharingId :^(NSDictionary *response) {
1674 - if (success) {
1675 - success(response);
1676 - }
1677 - } failureBlock:^(NSError *error) {
1678 - if (failure) {
1679 - failure(error);
1680 - }
1681 - }];
1682 -}
1683 -
1684 -- (void)cosmoteRetrieveSharingAsync:(NSString*)sharingId :(NSNumber*)accept :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
1685 -{
1686 - [[Warply sharedService] cosmoteRetrieveSharingWithSuccessBlock:sharingId :accept :^(NSDictionary *response) {
1687 - if (success) {
1688 - success(response);
1689 - }
1690 - } failureBlock:^(NSError *error) {
1691 - if (failure) {
1692 - failure(error);
1693 - }
1694 - }];
1695 -}
1696 -
1697 - (void)getCosmoteUserAsync:(NSString*)guid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure 1518 - (void)getCosmoteUserAsync:(NSString*)guid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
1698 { 1519 {
1699 [[Warply sharedService] getCosmoteUserWithSuccessBlock:guid :^(NSDictionary *response) { 1520 [[Warply sharedService] getCosmoteUserWithSuccessBlock:guid :^(NSDictionary *response) {
...@@ -1707,43 +1528,6 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify"; ...@@ -1707,43 +1528,6 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify";
1707 }]; 1528 }];
1708 } 1529 }
1709 1530
1710 -- (void)cosmoteCouponSharingAsync:(NSString*) coupon :(NSString*)sender :(NSString*)receiver :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
1711 -{
1712 - [[Warply sharedService] cosmoteCouponSharingWithSuccessBlock:coupon :sender :receiver :^(NSDictionary *response) {
1713 - if (success) {
1714 - success(response);
1715 - }
1716 - } failureBlock:^(NSError *error) {
1717 - if (failure) {
1718 - failure(error);
1719 - }
1720 - }];
1721 -}
1722 -
1723 -- (void)submitOrderAsync:(NSString*) campaign_session_uuid :(NSString*)user_msisdn :(NSString*)businessService :(NSString*)offerName :(NSString*)productType :(NSString*)provDuration :(NSString*)noOfRecurrance :(NSString*)price :(NSString*)discount :(NSString*)voiceCategory :(NSString*)dataCategory :(NSString*)minsValue :(NSString*)dataValue :(NSString*)provStepValueMins :(NSString*)OfferAudienceLevel :(NSString*)UACIOfferTrackingCode :(NSString*)OFFERCODE1 :(NSString*)SCORE :(NSString*)ZONE :(NSString*)WAVE :(NSString*)VALIDITY :(NSString*)TREATMENT_CODE :(NSString*)ccms_session_id :(NSString*)notificationMessage :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
1724 -{
1725 - [[Warply sharedService] submitOrderWithSuccessBlock:campaign_session_uuid :user_msisdn :businessService :offerName :productType :provDuration :noOfRecurrance :price :discount :voiceCategory :dataCategory :minsValue :dataValue :provStepValueMins :OfferAudienceLevel :UACIOfferTrackingCode :OFFERCODE1 :SCORE :ZONE :WAVE :VALIDITY :TREATMENT_CODE :ccms_session_id :notificationMessage :^(NSDictionary *response) {
1726 - if (success) {
1727 - success(response);
1728 - }
1729 - } failureBlock:^(NSError *error) {
1730 - if (failure) {
1731 - failure(error);
1732 - }
1733 - }];
1734 -}
1735 -
1736 -- (void)postEventAsync:(NSString*)Session_ID :(NSString*)OfferAudienceLevel :(NSString*)msisdn :(NSString*)UACIOfferTrackingCode :(NSString*)OFFERCODE1 :(NSString*)SCORE :(NSString*)ZONE :(NSString*)WAVE :(NSString*)VALIDITY :(NSString*)TREATMENT_CODE :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
1737 -{
1738 - [[Warply sharedService] postEventWithSuccessBlock:Session_ID :OfferAudienceLevel :msisdn :UACIOfferTrackingCode :OFFERCODE1 :SCORE :ZONE :WAVE :VALIDITY :TREATMENT_CODE :^(NSDictionary *response) {
1739 - if (success) {
1740 - success(response);
1741 - }
1742 - } failureBlock:^(NSError *error) {
1743 - failure(error);
1744 - }];
1745 -}
1746 -
1747 - (void)getCampaignsAsyncNew:(NSString*)language :(NSDictionary*)filters :(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure 1531 - (void)getCampaignsAsyncNew:(NSString*)language :(NSDictionary*)filters :(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure
1748 { 1532 {
1749 [[Warply sharedService] getCampaignsWithSuccessBlock:language :filters :^(NSDictionary *response) { 1533 [[Warply sharedService] getCampaignsWithSuccessBlock:language :filters :^(NSDictionary *response) {
...@@ -1770,32 +1554,6 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify"; ...@@ -1770,32 +1554,6 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify";
1770 }]; 1554 }];
1771 } 1555 }
1772 1556
1773 -- (void)getSharingHistoryAsync:(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure
1774 -{
1775 - [[Warply sharedService] getSharingHistoryWithSuccessBlock:^(NSDictionary *response) {
1776 - if (success) {
1777 - success(response);
1778 - }
1779 - } failureBlock:^(NSError *error) {
1780 - if (failure) {
1781 - failure(error);
1782 - }
1783 - }];
1784 -}
1785 -
1786 -- (void)getMarketSharingHistoryAsync:(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure
1787 -{
1788 - [[Warply sharedService] getMarketSharingHistoryWithSuccessBlock:^(NSDictionary *response) {
1789 - if (success) {
1790 - success(response);
1791 - }
1792 - } failureBlock:^(NSError *error) {
1793 - if (failure) {
1794 - failure(error);
1795 - }
1796 - }];
1797 -}
1798 -
1799 - (void)getMultilingualMerchantsAsync:(NSArray*)categories andDefaultShown:(NSNumber*)defaultShown andCenter:(NSNumber*)center andTags:(NSArray*)tags andUuid:(NSString*)uuid andDistance:(NSNumber*)distance parent_uuids:(NSArray*)parent_uuids :(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure { 1557 - (void)getMultilingualMerchantsAsync:(NSArray*)categories andDefaultShown:(NSNumber*)defaultShown andCenter:(NSNumber*)center andTags:(NSArray*)tags andUuid:(NSString*)uuid andDistance:(NSNumber*)distance parent_uuids:(NSArray*)parent_uuids :(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure {
1800 1558
1801 [[Warply sharedService] retrieveMultilingualMerchantsWithCategoriesWithSuccessBlock:categories andDefaultShown:defaultShown andCenter:center andTags:tags andUuid:uuid andDistance:distance parent_uuids:parent_uuids :^(NSDictionary *response) { 1559 [[Warply sharedService] retrieveMultilingualMerchantsWithCategoriesWithSuccessBlock:categories andDefaultShown:defaultShown andCenter:center andTags:tags andUuid:uuid andDistance:distance parent_uuids:parent_uuids :^(NSDictionary *response) {
...@@ -1876,18 +1634,6 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify"; ...@@ -1876,18 +1634,6 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify";
1876 1634
1877 } 1635 }
1878 1636
1879 -- (void)editProfileAsync:(NSString*)firstname andLastname:(NSString*)lastname andEmail:(NSString *)email andSalutation:(NSString *)salutation andMsisdn:(NSString *)msisdn andNickname:(NSString *)nickname andGender:(NSString *)gender andBirthday:(NSString *)birthday andNameDay:(NSString *)nameday andTaxID:(NSString *)taxid andProfileMetadata:(NSDictionary *)profileMetadata optin:(NSNumber *)optin newsLetter:(NSNumber *)newsletter andSMS:(NSNumber *)sms andSegmentation:(NSNumber *)segmentation andSMSSegmentation:(NSNumber *)smsSegmentation :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure {
1880 - [[Warply sharedService] editProfileWithSuccessBlock:firstname andLastName:lastname andEmail:email andSalutation:salutation andMsisdn:msisdn andNickname:nickname andGender:gender andBirthday:birthday andNameDay:nameday andTaxID:taxid andProfileMetadata:profileMetadata optin:optin newsLetter:newsletter andSMS:sms andSegmentation:segmentation andSMSSegmentation:smsSegmentation :^(NSDictionary *response) {
1881 - if (success) {
1882 - success(response);
1883 - }
1884 - } failureBlock:^(NSError *error) {
1885 - if (failure) {
1886 - failure(error);
1887 - }
1888 - }];
1889 -}
1890 -
1891 - (void)getSingleCampaignAsync:(NSString*)sessionUuid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure { 1637 - (void)getSingleCampaignAsync:(NSString*)sessionUuid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure {
1892 [[Warply sharedService] getSingleCampaignWithSuccessBlock:sessionUuid :^(NSDictionary *response) { 1638 [[Warply sharedService] getSingleCampaignWithSuccessBlock:sessionUuid :^(NSDictionary *response) {
1893 if (success) { 1639 if (success) {
...@@ -1900,18 +1646,6 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify"; ...@@ -1900,18 +1646,6 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify";
1900 }]; 1646 }];
1901 } 1647 }
1902 1648
1903 -- (void)getMapDataAsync:(NSString*)language :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure {
1904 - [[Warply sharedService] getMapDataWithSuccessBlock:language :^(NSDictionary *response) {
1905 - if (success) {
1906 - success(response);
1907 - }
1908 - } failureBlock:^(NSError *error) {
1909 - if (failure) {
1910 - failure(error);
1911 - }
1912 - }];
1913 -}
1914 -
1915 - (void) sendEvent: (NSString *) eventName priority: (BOOL) priority { 1649 - (void) sendEvent: (NSString *) eventName priority: (BOOL) priority {
1916 NSString *event_Name = eventName; 1650 NSString *event_Name = eventName;
1917 NSNumber *time_submitted = [NSNumber numberWithDouble:[[NSDate date] timeIntervalSince1970]]; 1651 NSNumber *time_submitted = [NSNumber numberWithDouble:[[NSDate date] timeIntervalSince1970]];
......
1 -//
2 -// NumberPopupViewController.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 15/7/22.
6 -//
7 -
8 -import UIKit
9 -
10 -protocol NumbersPopupDelegate {
11 - func numbersPopupTapped(_ sender: Any)
12 - func presentedPopup()
13 - func dismissedPopup()
14 - func optionSelected(_ option: String)
15 -}
16 -
17 -
18 -@objc public class NumberPopupViewController: UIViewController, UIPopoverPresentationControllerDelegate {
19 - @IBOutlet weak var popupView: UIView!
20 - @IBOutlet weak var headerLabel: UILabel!
21 - @IBOutlet weak var closeButton: UIButton!
22 - @IBOutlet weak var tableView: UITableView!
23 -
24 - let uiscreen: CGRect = UIScreen.main.bounds
25 -
26 - var delegateBallon: NumbersPopupDelegate?
27 - var numbersList: Array<String> = []
28 - var headerText: String = "Αποστολέας"
29 -
30 - var widthPopup: Int = 0
31 - var heightPopup: Int = 0
32 -
33 - func InitWithController(controller: UIViewController, numbersList: Array<String>, sender: Any, delegate: NumbersPopupDelegate, headerText: String){
34 -
35 - //print("Ok InitWithController sender ")
36 -
37 - delegateBallon = delegate
38 -
39 - // set the presentation style
40 - self.modalPresentationStyle = UIModalPresentationStyle.overFullScreen
41 -
42 - // set up the popover presentation controller
43 -// self.popoverPresentationController?.permittedArrowDirections = UIPopoverArrowDirection.up
44 - self.popoverPresentationController?.delegate = self
45 - self.popoverPresentationController?.sourceView = (sender as! UIView ) // button
46 - //--- Better center of the arrow
47 -// let rect: CGRect = (sender as AnyObject).bounds
48 -// let rectFixed: CGRect = CGRect(x: rect.origin.x, y: rect.origin.y, width: rect.size.width-10, height: rect.size.height)
49 -// self.popoverPresentationController?.sourceRect = rectFixed
50 - self.popoverPresentationController?.backgroundColor = UIColor.clear
51 -// self.popoverPresentationController?.backgroundColor = UIColor(red: 0.22, green: 0.32, blue: 0.40, alpha: 0.58)
52 -
53 - DispatchQueue.main.async {
54 - // present the popover
55 - controller.present(self, animated: true, completion: nil)
56 - }
57 - self.numbersList = numbersList
58 - self.headerText = headerText
59 - }
60 -
61 - public override func viewWillAppear(_ animated: Bool) {
62 - super.viewWillAppear(animated)
63 - }
64 -
65 - public override func viewDidLoad() {
66 - super.viewDidLoad()
67 - // Do any additional setup after loading the view, typically from a nib.
68 -// setupScreens()
69 -
70 - tableView.delegate = self
71 - tableView.dataSource = self
72 -
73 - popupView.clipsToBounds = true
74 - popupView.layer.cornerRadius = 12
75 - popupView.layer.maskedCorners = [ .layerMinXMinYCorner, .layerMaxXMinYCorner] // Top left, right corner radius
76 -
77 - self.preferredContentSize = CGSize(width: widthPopup, height: heightPopup)
78 -
79 - closeButton.setImage(UIImage(named: "ic_close_3.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
80 - closeButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
81 -
82 -// self.tableView.reloadData()
83 - self.tableView.invalidateIntrinsicContentSize()
84 - self.headerLabel.text = self.headerText
85 - }
86 -
87 - func setupScreens() {
88 -// if UIDevice.current.userInterfaceIdiom == .pad {
89 -// // Do what you want
90 -// widthPopup = 450
91 -// heightPopup = 550
92 -// textView.font = UIFont(name: Fonts.ProximaNova.semibold, size: 20)
93 -// } else if UIDevice.current.userInterfaceIdiom == .phone {
94 -// // Do what you want
95 -// widthPopup = 250
96 -// heightPopup = 360
97 -// textView.font = UIFont(name: Fonts.ProximaNova.semibold, size: 14)
98 -// }
99 - }
100 -
101 - public override func viewDidAppear(_ animated: Bool) {
102 - delegateBallon?.presentedPopup()
103 - }
104 -
105 - public override func viewDidDisappear(_ animated: Bool) {
106 - delegateBallon?.dismissedPopup()
107 - }
108 -
109 - public override func didReceiveMemoryWarning() {
110 - super.didReceiveMemoryWarning()
111 - // Dispose of any resources that can be recreated.
112 - }
113 -
114 - public override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
115 - //print("In prepare")
116 - }
117 -
118 - public func adaptivePresentationStyle(for controller: UIPresentationController) -> UIModalPresentationStyle {
119 - return UIModalPresentationStyle.overFullScreen
120 - }
121 -
122 - public func adaptivePresentationStyle(for controller: UIPresentationController, traitCollection: UITraitCollection) -> UIModalPresentationStyle {
123 - return UIModalPresentationStyle.overFullScreen
124 -// return UIModalPresentationStyle.none
125 - }
126 -
127 - // MARK: - UIButton Action
128 - @IBAction func closeButtonAction(_ sender: Any) {
129 - self.dismiss(animated: true, completion: {
130 -
131 - })
132 - }
133 -
134 -}
135 -
136 -// MARK: - TableView
137 -extension NumberPopupViewController: UITableViewDelegate, UITableViewDataSource{
138 -
139 - public func numberOfSections(in tableView: UITableView) -> Int {
140 - return 1
141 - }
142 -
143 - public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
144 - return self.numbersList.count
145 - }
146 -
147 - public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
148 - return 50 //+ 30.0
149 -// return UITableViewAutomaticDimension
150 - }
151 -
152 - public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
153 - let cell = tableView.dequeueReusableCell(withIdentifier: "NumbersTableViewCellId", for: indexPath) as! NumbersTableViewCell
154 - let isLast = indexPath.row == (self.numbersList.count - 1)
155 -
156 - cell.configureCell(number: numbersList[indexPath.row], isLast: isLast)
157 -
158 - return cell
159 - }
160 -
161 - public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
162 - delegateBallon?.optionSelected(self.numbersList[indexPath.row])
163 - self.dismiss(animated: true, completion: {})
164 -
165 - // Logs
166 -// let couponSetData: swiftApi.CouponSetItemModel? = coupons[indexPath.row].couponset_data
167 -// print("Coupon clicked: " + (coupons[indexPath.row].coupon ?? ""))
168 -// print("Coupon Name clicked: " + (couponSetData?.name ?? ""))
169 -// print("Coupon Description clicked: " + (couponSetData?.short_description ?? ""))
170 -// print("Coupon Expiration clicked: " + (coupons[indexPath.row].expiration ?? ""))
171 -//
172 -// let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
173 -// let vc = storyboard.instantiateViewController(withIdentifier: "CouponBarcodeViewController") as! CouponBarcodeViewController
174 -// vc.coupon = coupons[indexPath.row]
175 -// self.navigationController?.pushViewController(vc, animated: true)
176 -
177 - }
178 -
179 -}
180 -
181 -// Class for dynamic height table view
182 -@objc public class DynamicSizeTableView: UITableView
183 -{
184 - override public func layoutSubviews() {
185 - super.layoutSubviews()
186 - if bounds.size != intrinsicContentSize {
187 - invalidateIntrinsicContentSize()
188 - }
189 - }
190 -
191 - // override public var intrinsicContentSize: CGSize {
192 - // return contentSize
193 - // }
194 -
195 - override public var intrinsicContentSize: CGSize {
196 - return CGSize(width: UIView.noIntrinsicMetric, height: contentSize.height + contentInset.top + contentInset.bottom)
197 - }
198 -}
199 -
1 -//
2 -// NumbersTableViewCell.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 15/7/22.
6 -//
7 -
8 -import UIKit
9 -
10 -@objc public class NumbersTableViewCell: UITableViewCell {
11 - @IBOutlet weak var numberLabel: UILabel!
12 - @IBOutlet weak var borderView: UIView!
13 -
14 - public override func awakeFromNib() {
15 - super.awakeFromNib()
16 - // Initialization code
17 - }
18 -
19 - public override func setSelected(_ selected: Bool, animated: Bool) {
20 - super.setSelected(selected, animated: animated)
21 -
22 - // Configure the view for the selected state
23 - }
24 -
25 -
26 -// override func layoutSubviews() {
27 -// super.layoutSubviews()
28 -//
29 -// //set the values for top,left,bottom,right margins
30 -// let margins = UIEdgeInsets(top: 0, left: 0, bottom: 30, right: 0)
31 -// contentView.frame = contentView.frame.inset(by: margins)
32 -// }
33 -
34 -
35 - func configureCell(number: String, isLast: Bool) {
36 - numberLabel.text = number
37 - if (isLast) {
38 - borderView.isHidden = true
39 - } else {
40 - borderView.isHidden = false
41 - }
42 - }
43 -
44 -}
1 -//
2 -// PopupInfoViewController.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 16/10/24.
6 -//
7 -
8 -import UIKit
9 -
10 -class PopupInfoViewController: UIViewController {
11 - @IBOutlet weak var containerView: UIView!
12 - @IBOutlet weak var popupView: UIView!
13 - @IBOutlet weak var headerLabel: UILabel!
14 - @IBOutlet weak var headerCloseButton: UIButton!
15 - @IBOutlet weak var infoLabel: UILabel!
16 - @IBOutlet weak var submitButton: UIButton!
17 -
18 - override func viewDidLoad() {
19 - super.viewDidLoad()
20 -
21 - // Add arrow programmatically
22 - let arrowSize = CGSize(width: 15, height: 7.5) // Width and height of the arrow
23 - let arrowView = ArrowView(frame: CGRect(
24 - x: (popupView.frame.width - arrowSize.width - 35),
25 - y: popupView.frame.minY - arrowSize.height,
26 - width: arrowSize.width,
27 - height: arrowSize.height))
28 -
29 - containerView.addSubview(arrowView)
30 -// containerView.bringSubviewToFront(popupView)
31 -
32 - // Add shadow
33 - containerView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.57).cgColor
34 - containerView.layer.shadowOffset = CGSize(width: 0.0, height: 3.0)
35 - containerView.layer.shadowOpacity = 1.0
36 - containerView.layer.shadowRadius = 20.0
37 - containerView.layer.masksToBounds = false
38 - containerView.backgroundColor = .clear
39 -
40 - popupView.backgroundColor = UIColor(rgb: 0xE6E6E6)
41 - popupView.layer.cornerRadius = 14
42 -
43 - headerLabel.font = UIFont(name: "BTCosmo-Bold", size: 17)
44 - headerLabel.textColor = UIColor(rgb: 0x212121)
45 - headerLabel.text = "SUPERMARKET DEALS"
46 -
47 - headerCloseButton.setImage(UIImage(named: "ic_close_3.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
48 - headerCloseButton.imageView?.layer.transform = CATransform3DMakeScale(1.3, 1.3, 1.3)
49 -
50 - infoLabel.font = UIFont(name: "PeridotPE-Regular", size: 16.0)
51 - infoLabel.textColor = UIColor(rgb: 0x212121)
52 - infoLabel.text = "Δημιούργησε το δικό σου ενιαίο κουπόνι προσφορών, και εξαργύρωσέ το στα supermarket της επιλογής σου γρήγορα και εύκολα με ένα μόνο κωδικό κουπονιού!"
53 -
54 - submitButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 14)
55 - submitButton.setTitle("Τέλος", for: .normal)
56 - submitButton.setTitleColor(UIColor(rgb: 0x212121), for: .normal)
57 - submitButton.frame.size.width = submitButton.intrinsicContentSize.width
58 - }
59 -
60 - // MARK: - Actions
61 - @IBAction func headerCloseButtonAction(_ sender: Any) {
62 - self.dismiss(animated: true, completion: {})
63 - }
64 -
65 - @IBAction func submitButtonAction(_ sender: Any) {
66 - self.dismiss(animated: true, completion: {})
67 - }
68 -}
69 -
70 -class ArrowView: UIView {
71 -
72 - override init(frame: CGRect) {
73 - super.init(frame: frame)
74 - self.backgroundColor = .clear
75 - }
76 -
77 - required init?(coder: NSCoder) {
78 - super.init(coder: coder)
79 - self.backgroundColor = .clear
80 - }
81 -
82 - override func draw(_ rect: CGRect) {
83 - // Set up the context
84 - guard let context = UIGraphicsGetCurrentContext() else { return }
85 -
86 - // Set the arrow color (can adjust as needed)
87 - context.setFillColor(UIColor(rgb: 0xE6E6E6).cgColor)
88 -
89 - // Create the arrow's path (a triangle)
90 - let path = UIBezierPath()
91 - path.move(to: CGPoint(x: rect.width / 2, y: 0)) // Arrow top
92 - path.addLine(to: CGPoint(x: rect.width, y: rect.height)) // Bottom right
93 - path.addLine(to: CGPoint(x: 0, y: rect.height)) // Bottom left
94 - path.close() // Close the triangle
95 -
96 - // Fill the arrow shape
97 - context.addPath(path.cgPath)
98 - context.fillPath()
99 - }
100 -}
1 -//
2 -// PopupMerchantCategoriesViewController.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 21/10/24.
6 -//
7 -
8 -import UIKit
9 -
10 -// Define a protocol
11 -protocol PopupMerchantCategoriesViewControllerDelegate: AnyObject {
12 - func didTapMapButton()
13 - func didTapEshopsButton()
14 -}
15 -
16 -class PopupMerchantCategoriesViewController: UIViewController {
17 - @IBOutlet weak var popupView: UIView!
18 - @IBOutlet weak var headerLabel: UILabel!
19 - @IBOutlet weak var closeButton: UIButton!
20 - @IBOutlet weak var mapButton: UIButton!
21 - @IBOutlet weak var eshopsButton: UIButton!
22 -
23 - public var headerText: String? = ""
24 -
25 - // Delegate variable
26 - weak var delegate: PopupMerchantCategoriesViewControllerDelegate?
27 -
28 - override func viewDidLoad() {
29 - super.viewDidLoad()
30 -
31 - popupView.clipsToBounds = true
32 - popupView.layer.cornerRadius = 16
33 - popupView.layer.maskedCorners = [ .layerMinXMinYCorner, .layerMaxXMinYCorner] // Top left, right corner radius
34 -
35 - closeButton.setImage(UIImage(named: "ic_close_3.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
36 - closeButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
37 -
38 - headerLabel.text = self.headerText
39 - headerLabel.font = UIFont(name: "BTCosmo-Bold", size: 18)
40 - headerLabel.textColor = UIColor(rgb: 0x000000)
41 - headerLabel.isHidden = true
42 -
43 - mapButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 17)
44 - mapButton.setTitle("Δες τα καταστήματα στο χάρτη", for: .normal)
45 - mapButton.setTitleColor(.white, for: .normal)
46 - mapButton.backgroundColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00)
47 - mapButton.layer.cornerRadius = 16.0
48 - mapButton.frame = CGRect(x: 0.0, y: 0.0, width: 312, height: 55)
49 -
50 - eshopsButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 17)
51 - eshopsButton.setTitle("Δες τα eshop", for: .normal)
52 - eshopsButton.setTitleColor(UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00), for: .normal)
53 - eshopsButton.layer.cornerRadius = 15.0
54 - eshopsButton.frame = CGRect(x: 0.0, y: 0.0, width: 312, height: 55)
55 - eshopsButton.backgroundColor = .clear
56 - eshopsButton.layer.borderWidth = 2
57 - eshopsButton.layer.borderColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00).cgColor
58 - }
59 -
60 - @objc private func mapButtonTapped() {
61 - // Notify the delegate when map button is tapped
62 - delegate?.didTapMapButton()
63 - }
64 -
65 - @objc private func eshopsButtonTapped() {
66 - // Notify the delegate when eshops button is tapped
67 - delegate?.didTapEshopsButton()
68 - }
69 -
70 - // MARK: - UIButton Actions
71 - @IBAction func closeButtonAction(_ sender: Any) {
72 - self.dismiss(animated: true, completion: {})
73 - }
74 -
75 - @IBAction func mapButtonAction(_ sender: Any) {
76 - self.dismiss(animated: true, completion: {})
77 - mapButtonTapped()
78 - }
79 -
80 - @IBAction func eshopsButtonAction(_ sender: Any) {
81 - self.dismiss(animated: true, completion: {})
82 - eshopsButtonTapped()
83 - }
84 -}
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: DynamicSizeMerchantsTableView!
15 -
16 - public var availableShopsList:Array<swiftApi.ShopAvailabilityItemModel> = []
17 -// public var coupon: swiftApi.CouponItemModel?
18 - public var headerText: String? = "Βρες το προϊον στα supermarket"
19 - public var buttonTitle: String? = "Βρες το"
20 - public var buttonIcon: String?
21 - public var footerText: String? = "Η διαθεσιμότητα ενδέχεται να διαφέρει ανάλογα με την τοποθεσία."
22 - public var showEshops: Bool? = false
23 -
24 - override func viewDidLoad() {
25 - super.viewDidLoad()
26 -
27 - if (showEshops == true) {
28 - setupEshopsData()
29 - }
30 -
31 - tableView.delegate = self
32 - tableView.dataSource = self
33 -
34 - tableView.contentInset.top = 40
35 -
36 - popupView.clipsToBounds = true
37 - popupView.layer.cornerRadius = 16
38 - popupView.layer.maskedCorners = [ .layerMinXMinYCorner, .layerMaxXMinYCorner] // Top left, right corner radius
39 -
40 - closeButton.setImage(UIImage(named: "ic_close_3.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
41 - closeButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
42 -
43 -// self.tableView.reloadData()
44 - self.tableView.invalidateIntrinsicContentSize()
45 - self.headerLabel.text = self.headerText
46 - headerLabel.font = UIFont(name: "BTCosmo-Bold", size: 18)
47 - headerLabel.textColor = UIColor(rgb: 0x000000)
48 -
49 -// setupFooterView()
50 - }
51 -
52 - // MARK: - Functions
53 - func setupEshopsData() {
54 - let tempShop1: swiftApi.ShopAvailabilityItemModel = swiftApi.ShopAvailabilityItemModel()
55 - tempShop1._merchant_uuid = "ab"
56 - tempShop1._product_url = "https://www.ab.gr"
57 - availableShopsList.append(tempShop1)
58 -
59 - let tempShop2: swiftApi.ShopAvailabilityItemModel = swiftApi.ShopAvailabilityItemModel()
60 - tempShop2._merchant_uuid = "masoutis"
61 - tempShop2._product_url = "https://www.masoutis.gr"
62 - availableShopsList.append(tempShop2)
63 - }
64 -
65 -// private func setupFooterView() {
66 -// // Create a footer view container
67 -// let footerView = UIView()
68 -// footerView.backgroundColor = .clear
69 -//
70 -// // Create a label for the footer
71 -// let footerLabel = UILabel()
72 -// footerLabel.text = "Η διαθεσιμότητα ενδέχεται να διαφέρει ανάλογα με την τοποθεσία."
73 -// footerLabel.textAlignment = .center
74 -// footerLabel.font = UIFont(name: "PeridotPE-Regular", size: 13)
75 -// footerLabel.textColor = UIColor(rgb: 0x000000)
76 -// footerLabel.numberOfLines = 0 // Allow for multiline text
77 -//
78 -// // Add label to the footer view
79 -// footerView.addSubview(footerLabel)
80 -// footerLabel.translatesAutoresizingMaskIntoConstraints = false
81 -//
82 -// // Set constraints for the label inside the footer view
83 -// NSLayoutConstraint.activate([
84 -// footerLabel.leadingAnchor.constraint(equalTo: footerView.leadingAnchor, constant: 16),
85 -// footerLabel.trailingAnchor.constraint(equalTo: footerView.trailingAnchor, constant: -16),
86 -// footerLabel.topAnchor.constraint(equalTo: footerView.topAnchor, constant: 10),
87 -// footerLabel.bottomAnchor.constraint(equalTo: footerView.bottomAnchor, constant: -10)
88 -// ])
89 -//
90 -// // Set the footer view's frame size to fit the content
91 -// footerView.frame = CGRect(x: 0, y: 0, width: tableView.frame.width, height: 50)
92 -//
93 -// // Assign the footer view to the table view's footer
94 -// tableView.tableFooterView = footerView
95 -// }
96 -
97 - // MARK: - UIButton Actions
98 - @IBAction func closeButtonAction(_ sender: Any) {
99 - self.dismiss(animated: true, completion: {})
100 - }
101 -
102 -}
103 -
104 -// MARK: - TableView
105 -extension PopupMerchantsViewController: UITableViewDelegate, UITableViewDataSource{
106 -
107 - public func numberOfSections(in tableView: UITableView) -> Int {
108 - return 2
109 - }
110 -
111 - public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
112 - if (section == 0) {
113 - return self.availableShopsList.count
114 - } else if (section == 1) {
115 - return 1
116 - } else {
117 - return 0
118 - }
119 - }
120 -
121 - public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
122 - if (indexPath.section == 0) {
123 - return 56.0 + 32.0
124 - // return UITableViewAutomaticDimension
125 - } else if (indexPath.section == 1) {
126 - return 50.0
127 - } else {
128 - return 0.0
129 - }
130 -// return UITableViewAutomaticDimension
131 - }
132 -
133 - public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
134 - if (indexPath.section == 0) {
135 - let cell = tableView.dequeueReusableCell(withIdentifier: "MerchantTableViewCellId", for: indexPath) as! MerchantTableViewCell
136 - cell.configureCell(shop: availableShopsList[indexPath.row], buttonTitle: self.buttonTitle ?? "Βρες το", iconImage: self.buttonIcon, showEshops: self.showEshops)
137 -
138 - // Set the delegate to self
139 - cell.delegate = self
140 -
141 - return cell
142 -
143 - } else {
144 - let cell = tableView.dequeueReusableCell(withIdentifier: "PopupMerchantsFooterTableViewCellId", for: indexPath) as! PopupMerchantsFooterTableViewCell
145 - cell.configureCell(title: self.footerText ?? "Η διαθεσιμότητα ενδέχεται να διαφέρει ανάλογα με την τοποθεσία.")
146 -
147 - return cell
148 - }
149 - }
150 -
151 - public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
152 - // Do nothing - tap handled with protocol
153 -// print(" didSelectRowAt Button tapped in row \(indexPath.row)")
154 -
155 - }
156 -
157 - public func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
158 - return nil
159 - }
160 -
161 - public func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
162 - return 0.0
163 - }
164 -
165 - public func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
166 -// return CGFloat.leastNormalMagnitude
167 - return 0.0
168 - }
169 -
170 - public func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
171 - return nil
172 - }
173 -}
174 -
175 -// MARK: - MerchantTableViewCellDelegate
176 -extension PopupMerchantsViewController: MerchantTableViewCellDelegate {
177 -
178 - func didTapButton(in cell: MerchantTableViewCell) {
179 - // Find the index path of the cell where the button was tapped
180 - if let indexPath = tableView.indexPath(for: cell) {
181 - let urlString = availableShopsList[indexPath.row]._product_url
182 - if let url = URL(string: urlString){
183 - if UIApplication.shared.canOpenURL(url) {
184 - UIApplication.shared.open(url, options: [:], completionHandler: nil)
185 - }
186 - }
187 - }
188 -
189 - }
190 -
191 -}
192 -
193 -// Class for dynamic height table view
194 -@objc public class DynamicSizeMerchantsTableView: UITableView
195 -{
196 - override public func layoutSubviews() {
197 - super.layoutSubviews()
198 - if bounds.size != intrinsicContentSize {
199 - invalidateIntrinsicContentSize()
200 - }
201 - }
202 -
203 - // override public var intrinsicContentSize: CGSize {
204 - // return contentSize
205 - // }
206 -
207 - override public var intrinsicContentSize: CGSize {
208 - return CGSize(width: UIView.noIntrinsicMetric, height: contentSize.height + contentInset.top + contentInset.bottom + 30)
209 - }
210 -}
211 -
1 -//
2 -// ShareViewController.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 15/7/22.
6 -//
7 -
8 -import UIKit
9 -import SwiftEventBus
10 -
11 -@objc public class ShareViewController: UIViewController, UITextFieldDelegate, UIPopoverControllerDelegate {
12 - @IBOutlet weak var mainView: UIView!
13 - @IBOutlet weak var mainViewBottom: NSLayoutConstraint!
14 - @IBOutlet weak var backgroundImage: UIImageView!
15 - @IBOutlet weak var scrollView: UIScrollView!
16 - @IBOutlet weak var scrollContentView: UIView!
17 - @IBOutlet weak var couponImage: UIImageView!
18 - @IBOutlet weak var couponImageHeight: NSLayoutConstraint!
19 - @IBOutlet weak var nameLabel: UILabel!
20 - @IBOutlet weak var descriptionLabel: UILabel!
21 - @IBOutlet weak var senderLabel: UILabel!
22 - @IBOutlet weak var senderArrowImage: UIImageView!
23 - @IBOutlet weak var senderButton: UIButton!
24 - @IBOutlet weak var numberTextField: UITextField!
25 - @IBOutlet weak var redeemButton: UIButton!
26 - @IBOutlet weak var topBorderLine: UIImageView!
27 -
28 - let uiscreen: CGRect = UIScreen.main.bounds
29 -
30 - public var coupon: swiftApi.CouponItemModel?
31 - public var isFromWallet: Bool? = false
32 - var selectedNumber: String = ""
33 - var numbersList: Array<String> = []
34 -
35 - let spinner = SpinnerViewController()
36 -
37 - public override func viewDidLoad() {
38 - super.viewDidLoad()
39 -
40 - self.hidesBottomBarWhenPushed = true
41 -
42 - NotificationCenter.default.addObserver(self,
43 - selector: #selector(self.keyboardNotification(notification:)),
44 - name: UIResponder.keyboardWillChangeFrameNotification,
45 - object: nil)
46 -
47 - self.setupToHideKeyboardOnTapOnView()
48 - numberTextField.delegate = self
49 -
50 - getProfileRequest()
51 -
52 - // Do any additional setup after loading the view.
53 - setBackButton()
54 - setNavigationTitle("Δώρισέ το")
55 -
56 - backgroundImage.image = UIImage(named: "coupons_scrollview_white", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
57 -
58 -// scrollView.clipsToBounds = true
59 -// scrollView.layer.cornerRadius = 30
60 -// scrollView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
61 -
62 -// let image = UIImage(named: "top_border_line", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)!
63 -// var aspectR: CGFloat = 0.0
64 -//
65 -// aspectR = image.size.width/image.size.height
66 -//
67 -// topBorderLine.translatesAutoresizingMaskIntoConstraints = false
68 -// topBorderLine.image = image
69 -// topBorderLine.contentMode = .scaleAspectFill
70 -//
71 -// NSLayoutConstraint.activate([
72 -// topBorderLine.topAnchor.constraint(equalTo: mainView.topAnchor, constant: 0),
73 -// topBorderLine.leadingAnchor.constraint(equalTo: mainView.leadingAnchor, constant: 0),
74 -// topBorderLine.trailingAnchor.constraint(equalTo: mainView.trailingAnchor, constant: 0),
75 -// topBorderLine.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.width),
76 -// topBorderLine.heightAnchor.constraint(equalTo: topBorderLine.widthAnchor, multiplier: 1/aspectR)
77 -// ])
78 -
79 - // COUPONSET: desc, img_preview, name, terms
80 - // COUPON: coupon, expiration, discount, status
81 -
82 - let couponSetData: swiftApi.CouponSetItemModel? = coupon?.couponset_data
83 -
84 - couponImage.load(link: couponSetData?.img_preview ?? "", placeholder: UIImage(), cache: URLCache())
85 - couponImage.contentMode = .scaleAspectFill
86 - couponImageHeight.constant = 222 // 255 //230 // 253 // self.uiscreen.height * 0.25
87 -
88 - nameLabel.text = couponSetData?.name ?? ""
89 - // descriptionLabel.text = couponSetData?.short_description ?? ""
90 - descriptionLabel.text = "Επίλεξε το κινητό από το οποίο θα γίνει η αποστολή και συμπλήρωσε το COSMOTE κινητό που θα λάβει το δώρο."
91 -
92 - senderLabel.text = "Αποστολέας"
93 - senderLabel.textColor = UIColor(red: 0.52, green: 0.52, blue: 0.52, alpha: 1.00)
94 - senderArrowImage.image = UIImage(named: "ic_down_dark_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
95 -
96 - senderButton.addTarget(self, action: #selector(self.numbersPopupTapped(_:)), for: .touchUpInside)
97 -
98 - numberTextField.font = UIFont(name: "PeridotPE-Regular", size: 16)
99 - numberTextField.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
100 - numberTextField.attributedPlaceholder = NSAttributedString(string: "Καταχώρηση τηλεφώνου", attributes: [NSAttributedString.Key.foregroundColor: UIColor(red: 0.52, green: 0.52, blue: 0.52, alpha: 1.00)])
101 - numberTextField.keyboardType = .asciiCapableNumberPad
102 - numberTextField.addDoneButtonOnKeyboard()
103 -
104 - redeemButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 17)
105 - redeemButton.setTitle("Αποστολή με SMS", for: .normal)
106 - redeemButton.setTitleColor(.white, for: .normal)
107 - redeemButton.backgroundColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00)
108 - redeemButton.layer.cornerRadius = 16.0
109 - redeemButton.frame = CGRect(x: 0.0, y: 0.0, width: redeemButton.intrinsicContentSize.width, height: 50)
110 - redeemButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 25, bottom: 0, right: 25)
111 - // Fix width for ipad
112 -// if UIDevice.current.userInterfaceIdiom == .pad {
113 -// // iPad
114 -// redeemButton.widthAnchor.constraint(equalToConstant: 250).isActive = true
115 -// } else {
116 -// // not iPad (iPhone, mac, tv, carPlay, unspecified)
117 -// redeemButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
118 -// }
119 -
120 - }
121 -
122 - public override func viewWillAppear(_ animated: Bool) {
123 - super.viewWillAppear(animated)
124 -
125 - swiftApi().logTrackersEvent("screen", "CouponShareScreen")
126 -
127 - self.navigationController?.hideHairline()
128 - }
129 -
130 - deinit {
131 - NotificationCenter.default.removeObserver(self)
132 - }
133 -
134 - @objc func keyboardNotification(notification: NSNotification) {
135 - guard let userInfo = notification.userInfo else { return }
136 -
137 - let endFrame = (userInfo[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue
138 - let endFrameY = endFrame?.origin.y ?? 0
139 - let duration:TimeInterval = (userInfo[UIResponder.keyboardAnimationDurationUserInfoKey] as? NSNumber)?.doubleValue ?? 0
140 - let animationCurveRawNSN = userInfo[UIResponder.keyboardAnimationCurveUserInfoKey] as? NSNumber
141 - let animationCurveRaw = animationCurveRawNSN?.uintValue ?? UIView.AnimationOptions.curveEaseInOut.rawValue
142 - let animationCurve:UIView.AnimationOptions = UIView.AnimationOptions(rawValue: animationCurveRaw)
143 -
144 - if endFrameY >= UIScreen.main.bounds.size.height {
145 - self.mainViewBottom?.constant = 0.0
146 - } else {
147 - self.mainViewBottom?.constant = endFrame?.size.height ?? 0.0
148 - }
149 -
150 - UIView.animate(
151 - withDuration: duration,
152 - delay: TimeInterval(0),
153 - options: animationCurve,
154 - animations: { self.view.layoutIfNeeded() },
155 - completion: nil)
156 - }
157 -
158 - // MARK: - Functions
159 - func showSpinner() {
160 - // add the spinner view controller
161 - // addChild(spinner)
162 - // spinner.view.frame = view.frame
163 - // view.addSubview(spinner.view)
164 - // spinner.didMove(toParent: self)
165 -
166 - addChild(spinner)
167 - spinner.view.frame = CGRect(x: 0, y: 0, width: self.view.frame.width, height: self.view.frame.height)
168 - self.view.addSubview(spinner.view)
169 - spinner.didMove(toParent: self)
170 - }
171 -
172 - func hideSpinner() {
173 - // remove the spinner view controller
174 - spinner.willMove(toParent: nil)
175 - spinner.view.removeFromSuperview()
176 - spinner.removeFromParent()
177 - }
178 -
179 - func showSendDialog() -> Void {
180 -
181 - let alert = UIAlertController(title: "Δώρισέ το", message: "Είσαι σίγουρος /-ή ότι θέλεις να κάνεις δώρο το κουπόνι σου;", preferredStyle: .alert)
182 - let cancelButton = UIAlertAction(title: "Άκυρο", style: .default, handler: { action in
183 - switch action.style{
184 - case .default:
185 - print("default")
186 -
187 - case .cancel:
188 - print("cancel")
189 -
190 - case .destructive:
191 - print("destructive")
192 -
193 - }
194 - })
195 - // cancelButton.setValue(UIColor(rgb: 0xFC5757), forKey: "titleTextColor")
196 - alert.addAction(cancelButton)
197 -
198 - alert.addAction(UIAlertAction(title: "Αποστολή", style: .default, handler: { action in
199 - switch action.style{
200 - case .default:
201 - let couponSetData: swiftApi.CouponSetItemModel? = self.coupon?.couponset_data
202 - let couponName = couponSetData?.name ?? ""
203 - swiftApi().logTrackersEvent("click", ("ShareCoupon:" + couponName))
204 - self.cosmoteCouponSharingRequest()
205 -
206 - case .cancel:
207 - print("cancel")
208 -
209 - case .destructive:
210 - print("destructive")
211 -
212 - }
213 - }))
214 - self.present(alert, animated: true, completion: nil)
215 - }
216 -
217 - func showDialog(_ alertTitle: String, _ alertSubTitle: String) -> Void {
218 -
219 - let alert = UIAlertController(title: alertTitle, message: alertSubTitle, preferredStyle: .alert)
220 - alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
221 - switch action.style{
222 - case .default:
223 - print("default")
224 -
225 - case .cancel:
226 - print("cancel")
227 -
228 - case .destructive:
229 - print("destructive")
230 -
231 - }
232 - }))
233 - self.present(alert, animated: true, completion: nil)
234 - }
235 -
236 - func showDialogWithBack(_ alertTitle: String, _ alertSubTitle: String) -> Void {
237 -
238 - let alert = UIAlertController(title: alertTitle, message: alertSubTitle, preferredStyle: .alert)
239 - alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
240 - switch action.style{
241 - case .default:
242 - self.navigationController?.popViewController(animated: true)
243 - // self.dismiss(animated: true, completion: {})
244 -
245 - case .cancel:
246 - print("cancel")
247 -
248 - case .destructive:
249 - print("destructive")
250 -
251 - }
252 - }))
253 - self.present(alert, animated: true, completion: nil)
254 - }
255 -
256 - func showSuccessDialog(_ alertTitle: String, _ alertSubTitle: String) -> Void {
257 -
258 - let alert = UIAlertController(title: alertTitle, message: alertSubTitle, preferredStyle: .alert)
259 - alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
260 - switch action.style{
261 - case .default:
262 - // if (self.isFromWallet == true) {
263 - self.popBack(3)
264 - // } else {
265 - // print("default")
266 - // }
267 -
268 - case .cancel:
269 - print("cancel")
270 -
271 - case .destructive:
272 - print("destructive")
273 -
274 - }
275 - }))
276 - self.present(alert, animated: true, completion: nil)
277 - }
278 -
279 - // MARK: - API Calls
280 - func getProfileRequest() {
281 - swiftApi().getProfileAsync(getProfileCallback, failureCallback: {errorCode in
282 - print("========= getProfileRequest ERROR =========")
283 - })
284 - }
285 -
286 - func getProfileCallback (_ profileData: swiftApi.ProfileModel?) -> Void {
287 - if (profileData != nil) {
288 - DispatchQueue.main.async {
289 - self.numbersList = profileData?._msisdnList ?? []
290 -
291 - print("========= getProfileRequest SUCCESSSS =========")
292 - }
293 - } else {
294 - print("========= getProfileRequest ERROR =========")
295 - }
296 - }
297 -
298 - func cosmoteCouponSharingRequest() {
299 - self.showSpinner()
300 - swiftApi().cosmoteCouponSharingAsync(coupon: coupon?.coupon ?? "", sender: selectedNumber, receiver: numberTextField.text ?? "", couponSharingCallback, failureCallback: {errorCode in
301 - self.hideSpinner()
302 - self.showDialog("Αποτυχία","Κάτι πήγε στραβά")
303 - })
304 - }
305 -
306 - func couponSharingCallback (_ response: swiftApi.GenericResponseModel?) -> Void {
307 - self.hideSpinner()
308 - if (response != nil) {
309 - DispatchQueue.main.async {
310 - if (response?.getStatus == 1) {
311 - self.showSuccessDialog("Συγχαρητήρια!","Μόλις έκανες δώρο ένα κουπόνι!")
312 -
313 - if let tempCoupon = self.coupon {
314 - swiftApi().removeCouponItem(couponArg: tempCoupon)
315 - SwiftEventBus.post("coupons_fetched")
316 - }
317 -
318 - // swiftApi().getCouponsAsync(getCouponsCallback, failureCallback: {errorCode in })
319 -
320 - // func getCouponsCallback (_ couponsData: Array<swiftApi.CouponItemModel>?) -> Void {
321 - // if (couponsData != nil) {
322 -
323 - // DispatchQueue.main.async {
324 - // SwiftEventBus.post("coupons_fetched")
325 - // }
326 - // } else {
327 - // }
328 - // }
329 - } else if (response?.getStatus == 4) {
330 - self.showDialog("Αποτυχία", response?.getMsg ?? "")
331 -
332 - } else {
333 - self.showDialog("Αποτυχία","Κάτι πήγε στραβά")
334 - }
335 - }
336 - } else {
337 - self.showDialog("Αποτυχία","Κάτι πήγε στραβά")
338 - }
339 - }
340 -
341 - // MARK: - Actions
342 - @IBAction func redeemButtomAction(_ sender: Any) {
343 - if (selectedNumber == "" || numberTextField.text == "") {
344 - self.showDialog("Αποτυχία αποστολής","Παρακαλούμε συμπλήρωσε σωστά τα πεδία.")
345 - } else {
346 - self.showSendDialog()
347 - }
348 - }
349 -
350 -}
351 -
352 -// MARK: NumbersPopup
353 -extension ShareViewController: NumbersPopupDelegate {
354 - @objc func numbersPopupTapped(_ sender: Any) {
355 - if (self.numbersList.count == 0) {
356 - self.showDialogWithBack("Δώρισέ το","Για την αποστολή του δώρου σου χρειάζεται να έχεις κινητό COSMOTE.")
357 - } else {
358 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
359 - // self.storyboard?
360 - let pp = storyboard.instantiateViewController(withIdentifier: "NumberPopupViewController") as! SwiftWarplyFramework.NumberPopupViewController
361 - pp.InitWithController(controller: self,
362 - numbersList: self.numbersList,
363 - sender: sender,
364 - delegate: self,
365 - headerText: "Αποστολέας")
366 - }
367 - }
368 -
369 - func presentedPopup() {
370 -// Code for when popup is presented
371 - }
372 -
373 - func dismissedPopup() {
374 -// Code for when popup is dismissed
375 - }
376 -
377 - func optionSelected(_ option: String) {
378 -// Code for when option is selected
379 - selectedNumber = option
380 - senderLabel.text = option
381 - senderLabel.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
382 - }
383 -}
384 -
1 -//
2 -// SharingHistoryViewController.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 18/7/22.
6 -//
7 -
8 -import UIKit
9 -
10 -class SharingHistoryViewController: AnalysisChildViewController {
11 -
12 - var loading: Bool = false
13 - var items: Array<swiftApi.SharingCouponModel> = Array()
14 - var allItems: Array<swiftApi.SharingCouponModel> = Array()
15 - var showMore = false
16 -
17 - // TODO: remove this when configuring model
18 - let hasMessage = false
19 -
20 - // lifecycle
21 - override func viewDidLoad() {
22 -
23 - super.viewDidLoad()
24 -
25 - self.tableView.delegate = self
26 - self.tableView.dataSource = self
27 -
28 - // Add shadow
29 - self.tableView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
30 - self.tableView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
31 - self.tableView.layer.shadowOpacity = 1.0
32 - self.tableView.layer.shadowRadius = 1.0
33 -
34 - self.refreshControl = UIRefreshControl()
35 - self.refreshControl?.addTarget(self, action: #selector(handleRefresh(_:)), for: .valueChanged)
36 -
37 - handleRefresh(self.refreshControl!)
38 - }
39 -
40 - // mvp
41 - @objc func load() {
42 -
43 - if (loading) {
44 - return;
45 - }
46 -
47 - showLoading()
48 -
49 - swiftApi().getSharingHistoryAsync(isMarketHistory: false, getSharingHistoryCallback: responseCallback, failureCallback: {errorCode in })
50 - }
51 -
52 - private func showLoading() {
53 -
54 - loading = true
55 - if (self.refreshControl!.isRefreshing) {
56 - return;
57 - }
58 -
59 - self.refreshControl!.beginRefreshing()
60 - }
61 -
62 - private func showError() {
63 - }
64 -
65 - private func showContent() {
66 -
67 - loading = false
68 - self.refreshControl!.endRefreshing()
69 - }
70 -
71 - // private
72 - func responseCallback (_ data: Array<swiftApi.SharingCouponModel>?) -> Void {
73 -
74 - self.items = data!
75 - self.allItems = data!
76 - self.showMore = (self.items.count > 3)
77 -
78 - if (self.showMore == true) {
79 - self.items = Array(self.items[0...2])
80 - }
81 - showContent()
82 - DispatchQueue.main.async {
83 - self.tableView.reloadData()
84 - }
85 - }
86 -
87 - @objc func handleRefresh(_ refreshControl: UIRefreshControl) {
88 -
89 - self.perform(_: #selector(load), with: nil, afterDelay: 0.5)
90 - }
91 -
92 - // MARK: - Table view data source
93 - override func numberOfSections(in tableView: UITableView) -> Int {
94 - return 2
95 - }
96 -
97 - override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
98 - if (section == 0) {
99 - return 1;
100 - }
101 -
102 - if (self.showMore == true) {
103 - return 4
104 - }
105 - return items.count
106 - }
107 -
108 - override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
109 -// if (indexPath.section == 0) {
110 -// return hasMessage ? 380.0 : (items.count > 0 ? 280 : 380)
111 -// }
112 -//
113 -// return 140.0
114 - return UITableView.automaticDimension
115 - }
116 -
117 - override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
118 -
119 - // header
120 - if (indexPath.section == 0) {
121 - if (hasMessage) {
122 - return tableView.dequeueReusableCell(withIdentifier: "AnalysisHeaderMessageViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisHeaderMessageViewCell
123 - }
124 -
125 - let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisHeaderViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisHeaderViewCell
126 - cell.configureCell(isEmpty: items.count == 0, isMarket: false)
127 - return cell
128 - }
129 -
130 - if ((self.showMore == true) && (indexPath.row == 3)) {
131 - let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisMoreViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisMoreViewCell
132 - return cell
133 - }
134 -
135 - let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisItemViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisItemViewCell
136 - cell.configureCell(item: items[indexPath.row])
137 -
138 - return cell
139 - }
140 -
141 - override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
142 - if (indexPath.section == 0) {
143 - return
144 - }
145 -
146 - if ((self.showMore == true) && (indexPath.row == 3)) {
147 - self.items = self.allItems
148 - self.showMore = false
149 - self.tableView.reloadData()
150 - }
151 - }
152 -
153 - override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
154 - if (section == 0){
155 - return nil
156 -
157 - } else if (section == 1) {
158 - if (self.items.count > 0) {
159 - let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 50))
160 -
161 - let viewBorder = UIView(frame: CGRect(x: 10, y: 0, width: view.frame.width-20, height: view.frame.height))
162 - viewBorder.backgroundColor = .white
163 - // viewBorder.backgroundColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00)
164 -
165 - viewBorder.layer.cornerRadius = 16.5
166 - viewBorder.layer.maskedCorners = [ .layerMinXMinYCorner, .layerMaxXMinYCorner] // Top left, bottom right corner radius
167 -
168 - let viewInner = UIView(frame: CGRect(x: 1, y: 1, width: viewBorder.frame.width-2, height: viewBorder.frame.height-1))
169 - viewInner.backgroundColor = .white
170 -
171 - viewInner.layer.cornerRadius = 16.5
172 - viewInner.layer.maskedCorners = [ .layerMinXMinYCorner, .layerMaxXMinYCorner] // Top left, bottom right corner radius
173 -
174 - let titleLabel = UILabel(frame: CGRect(x: 20, y: 20, width: viewInner.frame.width - 40, height: 20))
175 - titleLabel.font = UIFont(name: "BTCosmo-Bold", size: 20)
176 - titleLabel.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
177 - titleLabel.text = "Αναλυτικά"
178 -
179 - view.addSubview(viewBorder)
180 - viewBorder.addSubview(viewInner)
181 - viewInner.addSubview(titleLabel)
182 - return view
183 - } else {
184 - return nil
185 - }
186 -
187 -
188 - } else {
189 - return nil
190 - }
191 - }
192 -
193 - override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
194 - if (section == 0) {
195 - return 0.0
196 -
197 - } else if (section == 1) {
198 - if (self.items.count > 0) {
199 - return 50.0
200 - } else {
201 - return 0.0
202 - }
203 -
204 - } else {
205 - return 0.0
206 - }
207 - }
208 -
209 - override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
210 -// return CGFloat.leastNormalMagnitude
211 - if (section == 1 && self.items.count > 0) {
212 - return 20.0
213 - } else {
214 - return 0.0
215 - }
216 - }
217 -
218 - override func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
219 - if (section == 1) {
220 - if (self.items.count > 0) {
221 - let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 30))
222 -
223 - let viewBorder = UIView(frame: CGRect(x: 10, y: 0, width: view.frame.width-20, height: view.frame.height))
224 - viewBorder.backgroundColor = .white
225 - // viewBorder.backgroundColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00)
226 -
227 - viewBorder.layer.cornerRadius = 16.5
228 - viewBorder.layer.maskedCorners = [ .layerMinXMaxYCorner, .layerMaxXMaxYCorner] // bottom left, bottom right corner radius
229 -
230 - let viewInner = UIView(frame: CGRect(x: 1, y: 0, width: viewBorder.frame.width-2, height: viewBorder.frame.height-1))
231 - viewInner.backgroundColor = .white
232 -
233 - viewInner.layer.cornerRadius = 16.5
234 - viewInner.layer.maskedCorners = [ .layerMinXMaxYCorner, .layerMaxXMaxYCorner] // bottom left, bottom right corner radius
235 -
236 - view.addSubview(viewBorder)
237 - viewBorder.addSubview(viewInner)
238 - return view
239 - } else {
240 - return nil
241 - }
242 -
243 - } else {
244 - return nil
245 - }
246 - }
247 -}
1 -//
2 -// SpinnerViewController.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 14/11/22.
6 -//
7 -
8 -import UIKit
9 -
10 -@objc public class SpinnerViewController: UIViewController {
11 - var spinner = UIActivityIndicatorView()
12 -
13 - public override func loadView() {
14 - if #available(iOS 13.0, *) {
15 - spinner = UIActivityIndicatorView(style: .large)
16 - spinner.color = .white
17 -
18 - } else {
19 - spinner = UIActivityIndicatorView(style: .whiteLarge)
20 - }
21 -
22 - view = UIView()
23 - view.backgroundColor = UIColor(white: 0, alpha: 0.7)
24 -
25 - spinner.translatesAutoresizingMaskIntoConstraints = false
26 - spinner.startAnimating()
27 - view.addSubview(spinner)
28 -
29 - spinner.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
30 - spinner.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
31 - }
32 -
33 - public override func viewDidLoad() {
34 - super.viewDidLoad()
35 -
36 - // Do any additional setup after loading the view.
37 - }
38 -
39 -}
1 -//
2 -// StepsViewController.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 10/6/22.
6 -//
7 -
8 -import UIKit
9 -
10 -@objc public class StepsViewController: UIViewController {
11 -
12 - public override func viewDidLoad() {
13 - super.viewDidLoad()
14 -
15 - self.hidesBottomBarWhenPushed = true
16 -
17 - // Do any additional setup after loading the view.
18 - }
19 -
20 -
21 - /*
22 - // MARK: - Navigation
23 -
24 - // In a storyboard-based application, you will often want to do a little preparation before navigation
25 - override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
26 - // Get the new view controller using segue.destination.
27 - // Pass the selected object to the new view controller.
28 - }
29 - */
30 -
31 -}
1 -//
2 -// TelcoViewController.swift
3 -// WarplySDKFrameworkIOS
4 -//
5 -// Created by Manos Chorianopoulos on 16/7/22.
6 -//
7 -
8 -import UIKit
9 -import SwiftEventBus
10 -
11 -@objc public class TelcoViewController: UIViewController, UIPopoverControllerDelegate {
12 - @IBOutlet weak var mainView: UIView!
13 - @IBOutlet weak var backgroundImage: UIImageView!
14 - @IBOutlet weak var scrollView: UIScrollView!
15 - @IBOutlet weak var scrollContentView: UIView!
16 - @IBOutlet weak var heroImage: UIImageView!
17 - @IBOutlet weak var heroImageHeight: NSLayoutConstraint!
18 - @IBOutlet weak var nameLabel: UILabel!
19 - @IBOutlet weak var descriptionLabel: UILabel!
20 - @IBOutlet weak var activateButton: UIButton!
21 - @IBOutlet weak var valueView: UIView!
22 - @IBOutlet weak var valueLabel: UILabel!
23 - @IBOutlet weak var giftTypeLabel: UILabel!
24 - @IBOutlet weak var giftDurationView: UIView!
25 - @IBOutlet weak var giftDurationLabel: UILabel!
26 - @IBOutlet weak var borderLineView: UIView!
27 - @IBOutlet weak var moreButton: UIButton!
28 - @IBOutlet weak var moreTextView: UITextView!
29 - @IBOutlet weak var moreTextViewHeight: NSLayoutConstraint!
30 - @IBOutlet weak var topBorderLine: UIImageView!
31 -
32 - let uiscreen: CGRect = UIScreen.main.bounds
33 -
34 - public var ccms: swiftApi.LoyaltyContextualOfferModel?
35 - public var campaign: swiftApi.CampaignItemModel?
36 - var selectedNumber: String = ""
37 - public var numbersList: Array<String> = []
38 -
39 - var moreVisible: Bool = false;
40 -
41 - let spinner = SpinnerViewController()
42 -
43 - public override func viewDidLoad() {
44 -
45 - super.viewDidLoad()
46 -
47 - self.hidesBottomBarWhenPushed = true
48 -
49 - // Do any additional setup after loading the view.
50 - // getProfileRequest()
51 -
52 - numbersList = ccms?._eligibleAssets ?? []
53 -
54 - setBackButton("ic_close_3")
55 - setNavigationTitle(ccms?._titleOffer ?? "")
56 -
57 - backgroundImage.image = UIImage(named: "coupons_scrollview_white", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
58 -
59 -// let image = UIImage(named: "top_border_line", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)!
60 -// var aspectR: CGFloat = 0.0
61 -//
62 -// aspectR = image.size.width/image.size.height
63 -//
64 -// topBorderLine.translatesAutoresizingMaskIntoConstraints = false
65 -// topBorderLine.image = image
66 -// topBorderLine.contentMode = .scaleAspectFill
67 -//
68 -// NSLayoutConstraint.activate([
69 -// topBorderLine.topAnchor.constraint(equalTo: mainView.topAnchor, constant: 0),
70 -// topBorderLine.leadingAnchor.constraint(equalTo: mainView.leadingAnchor, constant: 0),
71 -// topBorderLine.trailingAnchor.constraint(equalTo: mainView.trailingAnchor, constant: 0),
72 -// topBorderLine.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.width),
73 -// topBorderLine.heightAnchor.constraint(equalTo: topBorderLine.widthAnchor, multiplier: 1/aspectR)
74 -// ])
75 -
76 -// scrollView.clipsToBounds = true
77 -// scrollView.layer.cornerRadius = 30
78 -// scrollView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
79 -
80 - heroImage.load(link: ccms?._imageOfferUrl ?? "", placeholder: UIImage(), cache: URLCache())
81 - heroImage.contentMode = .scaleAspectFill
82 - heroImageHeight.constant = 222 // 255 //230 // 253 // self.uiscreen.height * 0.25
83 - nameLabel.text = ccms?._description ?? ""
84 - // descriptionLabel.text = ccms?._subtitle ?? ""
85 -
86 - valueView.gradientBorder(width: 1, colors: [UIColor(rgb: 0x07A2D1), UIColor(rgb: 0x73CA34)], startPoint: .unitCoordinate(.bottomLeft), endPoint: .unitCoordinate(.topRight), andRoundCornersWithRadius: 35)
87 - valueLabel.text = ccms?._giftValue ?? ""
88 - giftTypeLabel.text = ccms?._giftType ?? ""
89 -
90 - giftDurationLabel.text = ccms?._duration ?? ""
91 - giftDurationView.frame = CGRect(x: 0.0, y: 0.0, width: giftDurationLabel.intrinsicContentSize.width + 20, height: giftDurationView.frame.height)
92 - giftDurationView.gradientBorder(width: 2, colors: [UIColor(rgb: 0x65DD6B), UIColor(rgb: 0x0D81B8)], startPoint: .unitCoordinate(.left), endPoint: .unitCoordinate(.right), andRoundCornersWithRadius: 35)
93 -
94 - borderLineView.applyGradient(colours: [UIColor(rgb: 0x0AA3CD), UIColor(rgb: 0x6ECA43)], gradient: GradientOrientation.horizontal, cornerRadius: 0.0)
95 -
96 - activateButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 17)
97 - activateButton.setTitle("Ενεργοποίηση", for: .normal)
98 - activateButton.setTitleColor(.white, for: .normal)
99 - activateButton.backgroundColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00)
100 - activateButton.layer.cornerRadius = 16.0
101 - activateButton.frame = CGRect(x: 0.0, y: 0.0, width: activateButton.intrinsicContentSize.width, height: 50)
102 - activateButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 25, bottom: 0, right: 25)
103 -
104 - // Fix width for ipad
105 -// if UIDevice.current.userInterfaceIdiom == .pad {
106 -// // iPad
107 -// activateButton.widthAnchor.constraint(equalToConstant: 250).isActive = true
108 -// } else {
109 -// // not iPad (iPhone, mac, tv, carPlay, unspecified)
110 -// activateButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
111 -// }
112 -
113 - moreButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 15)
114 -// termsButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
115 - moreButton.setTitle("Δες Περισσότερα", for: .normal)
116 - moreButton.setTitleColor(UIColor(red: 0.25, green: 0.33, blue: 0.39, alpha: 1.00), for: .normal)
117 - moreButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
118 - moreButton.semanticContentAttribute = .forceRightToLeft
119 - moreButton.tintColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 1.00)
120 - moreButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0);
121 - moreButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 5);
122 - moreButton.imageView?.layer.transform = CATransform3DMakeScale(0.8, 0.8, 0.8)
123 -
124 -// let htmlText = ccms?._description ?? ""
125 -// moreTextView.attributedText = htmlText.htmlToAttributedString
126 - moreTextView.text = ccms?._termsAndConditions ?? ""
127 - moreTextView.font = UIFont(name: "PeridotPE-Regular", size: 14)
128 - moreTextView.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
129 - moreTextView.textAlignment = .left
130 - moreTextView.isScrollEnabled = false
131 -
132 - toggleMore()
133 - }
134 -
135 - public override func viewWillAppear(_ animated: Bool) {
136 - super.viewWillAppear(animated)
137 -
138 - swiftApi().logTrackersEvent("screen", "TelcoScreen")
139 -
140 - self.navigationController?.hideHairline()
141 - }
142 -
143 - // MARK: - Functions
144 - func showSpinner() {
145 - // add the spinner view controller
146 - // addChild(spinner)
147 - // spinner.view.frame = view.frame
148 - // view.addSubview(spinner.view)
149 - // spinner.didMove(toParent: self)
150 -
151 - addChild(spinner)
152 - spinner.view.frame = CGRect(x: 0, y: 0, width: self.view.frame.width, height: self.view.frame.height)
153 - self.view.addSubview(spinner.view)
154 - spinner.didMove(toParent: self)
155 - }
156 -
157 - func hideSpinner() {
158 - // remove the spinner view controller
159 - spinner.willMove(toParent: nil)
160 - spinner.view.removeFromSuperview()
161 - spinner.removeFromParent()
162 - }
163 -
164 - func toggleMore() {
165 - if (moreVisible) {
166 - moreTextView.isHidden = false
167 - let targetSize = CGSize(width: moreTextView.frame.width, height: CGFloat(MAXFLOAT))
168 - moreTextViewHeight.constant = moreTextView.sizeThatFits(targetSize).height
169 -
170 - moreButton.setImage(UIImage(named: "ic_up_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
171 - } else {
172 - moreTextView.isHidden = true
173 - moreTextViewHeight.constant = CGFloat(0)
174 -
175 - moreButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
176 - }
177 - }
178 -
179 - func showConfirmDialog() -> Void {
180 -
181 - let alert = UIAlertController(title: "Ενεργοποίηση υπηρεσίας", message: "Θέλετε να γίνει ενεργοποίηση στο Κινητό μου;", preferredStyle: .alert)
182 -
183 - let cancelButton = UIAlertAction(title: "Άκυρο", style: .default, handler: { action in
184 - switch action.style{
185 - case .default:
186 - print("default")
187 -
188 - case .cancel:
189 - print("cancel")
190 -
191 - case .destructive:
192 - print("destructive")
193 -
194 - }
195 - })
196 - // cancelButton.setValue(UIColor(rgb: 0xFC5757), forKey: "titleTextColor")
197 - alert.addAction(cancelButton)
198 -
199 - alert.addAction(UIAlertAction(title: "Ενεργοποίηση", style: .default, handler: { action in
200 - switch action.style{
201 - case .default:
202 - swiftApi().logTrackersEvent("click", ("ActivateTelco:" + (self.ccms?._sessionId ?? "")))
203 - self.submitOrderRequest()
204 -
205 - case .cancel:
206 - print("cancel")
207 -
208 - case .destructive:
209 - print("destructive")
210 -
211 - }
212 - }))
213 - self.present(alert, animated: true, completion: nil)
214 - }
215 -
216 - func showDialog(_ alertTitle: String, _ alertSubTitle: String) -> Void {
217 -
218 - let alert = UIAlertController(title: alertTitle, message: alertSubTitle, preferredStyle: .alert)
219 - alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
220 - switch action.style{
221 - case .default:
222 - print("default")
223 -
224 - case .cancel:
225 - print("cancel")
226 -
227 - case .destructive:
228 - print("destructive")
229 -
230 - }
231 - }))
232 - self.present(alert, animated: true, completion: nil)
233 - }
234 -
235 -
236 - // MARK: - API CALLS
237 - func getProfileRequest() {
238 - swiftApi().getProfileAsync(getProfileCallback, failureCallback: {errorCode in })
239 - }
240 -
241 - func getProfileCallback (_ profileData: swiftApi.ProfileModel?) -> Void {
242 - if (profileData != nil) {
243 - DispatchQueue.main.async {
244 - self.numbersList = profileData?._msisdnList ?? []
245 - }
246 - } else {
247 - }
248 - }
249 -
250 - func submitOrderRequest() {
251 - showSpinner()
252 - swiftApi().submitOrderAsync(campaign_session_uuid: (campaign?.session_uuid ?? ""), user_msisdn: self.selectedNumber, businessService: (ccms?._businessService ?? ""), offerName: (ccms?._offerName ?? ""), productType: (ccms?._productType ?? ""), provDuration: (ccms?._provDuration ?? ""), noOfRecurrance: (ccms?._noOfRecurrance ?? ""), price: (ccms?._price ?? ""), discount: (ccms?._discount ?? ""), voiceCategory: (ccms?._voiceCategory ?? ""), dataCategory: (ccms?._dataCategory ?? ""), minsValue: (ccms?._minsValue ?? ""), dataValue: (ccms?._dataValue ?? ""), provStepValueMins: (ccms?._provStepValueMins ?? ""),
253 - OfferAudienceLevel: (ccms?._offerAudienceLevel ?? ""), UACIOfferTrackingCode: (ccms?._uaciOfferTrackingCode ?? ""), OFFERCODE1: (ccms?._offerCode1 ?? ""), SCORE: (ccms?._score ?? ""), ZONE: (ccms?._zone ?? ""), WAVE: (ccms?._wave ?? ""), VALIDITY: (ccms?._validity ?? ""), TREATMENT_CODE: (ccms?._treatmentCode ?? ""), ccms_session_id: (ccms?._sessionId ?? ""), notificationMessage: (ccms?._notificationMessage ?? ""),
254 - submitOrderCallback, failureCallback: {errorCode in
255 - self.hideSpinner()
256 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
257 - firebaseEvent._eventName = "loyalty_offer_activated"
258 - firebaseEvent.setParameter = ("name", (self.ccms?._title ?? ""))
259 - firebaseEvent.setParameter = ("type", "gift")
260 - firebaseEvent.setParameter = ("successful", "false")
261 - SwiftEventBus.post("firebase", sender: firebaseEvent)
262 -
263 - self.showDialog("Αποτυχία","Κάτι πήγε στραβά")
264 - })
265 - }
266 -
267 - func submitOrderCallback (_ response: swiftApi.GenericResponseModel?) -> Void {
268 - self.hideSpinner()
269 - if (response != nil) {
270 - DispatchQueue.main.async {
271 - if (response?.getStatus == 1) {
272 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
273 - firebaseEvent._eventName = "loyalty_offer_activated"
274 - firebaseEvent.setParameter = ("name", (self.ccms?._title ?? ""))
275 - firebaseEvent.setParameter = ("type", "gift")
276 - firebaseEvent.setParameter = ("successful", "true")
277 - SwiftEventBus.post("firebase", sender: firebaseEvent)
278 -
279 - let ccmsEnabled = swiftApi.WarplyCCMSEnabledModel()
280 - ccmsEnabled._isActivated = true
281 - SwiftEventBus.post("ccms_enabled", sender: ccmsEnabled)
282 -
283 - self.showDialog("Το αίτημά σου ολοκληρώθηκε επιτυχώς!","Θα ενημερωθείς άμεσα για την ενεργοποίηση του πακέτου σου.")
284 - // self.postEventRequest()
285 -
286 - } else {
287 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
288 - firebaseEvent._eventName = "loyalty_offer_activated"
289 - firebaseEvent.setParameter = ("name", (self.ccms?._title ?? ""))
290 - firebaseEvent.setParameter = ("type", "gift")
291 - firebaseEvent.setParameter = ("successful", "false")
292 - SwiftEventBus.post("firebase", sender: firebaseEvent)
293 -
294 - self.showDialog("Αποτυχία","Κάτι πήγε στραβά")
295 - }
296 - }
297 - } else {
298 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
299 - firebaseEvent._eventName = "loyalty_offer_activated"
300 - firebaseEvent.setParameter = ("name", (self.ccms?._title ?? ""))
301 - firebaseEvent.setParameter = ("type", "gift")
302 - firebaseEvent.setParameter = ("successful", "false")
303 - SwiftEventBus.post("firebase", sender: firebaseEvent)
304 -
305 - self.showDialog("Αποτυχία","Κάτι πήγε στραβά")
306 - }
307 - }
308 -
309 - // func postEventRequest() {
310 - // swiftApi().postEventAsync(Session_ID: (campaign?.session_uuid ?? ""), OfferAudienceLevel: (ccms?._offerAudienceLevel ?? ""), msisdn: self.selectedNumber, UACIOfferTrackingCode: (ccms?._uaciOfferTrackingCode ?? ""), OFFERCODE1: (ccms?._offerCode1 ?? ""), SCORE: (ccms?._score ?? ""), ZONE: (ccms?._zone ?? ""), WAVE: (ccms?._wave ?? ""), VALIDITY: (ccms?._validity ?? ""), TREATMENT_CODE: (ccms?._treatmentCode ?? ""), postEventCallback)
311 - // }
312 -
313 - // func postEventCallback (_ response: swiftApi.GenericResponseModel?) -> Void {
314 - // if (response != nil) {
315 - // DispatchQueue.main.async {
316 - // if (response?.getStatus == 1) {
317 -
318 - // } else {
319 - // }
320 - // }
321 - // } else {
322 - // }
323 - // }
324 -
325 - // MARK: - Actions
326 - @IBAction func activateButtomAction(_ sender: Any) {
327 - self.numbersPopupTapped(sender)
328 - }
329 -
330 - @IBAction func moreButtonAction(_ sender: Any) {
331 - moreVisible = !moreVisible
332 - toggleMore()
333 - }
334 -}
335 -
336 -// MARK: NumbersPopup
337 -extension TelcoViewController: NumbersPopupDelegate {
338 - @objc func numbersPopupTapped(_ sender: Any) {
339 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
340 - let pp = storyboard.instantiateViewController(withIdentifier: "NumberPopupViewController") as! SwiftWarplyFramework.NumberPopupViewController
341 - pp.InitWithController(controller: self,
342 - numbersList: self.numbersList,
343 - sender: sender,
344 - delegate: self,
345 - headerText: "Επιλογή σύνδεσης")
346 - }
347 -
348 - func presentedPopup() {
349 -// Code for when popup is presented
350 - }
351 -
352 - func dismissedPopup() {
353 -// Code for when popup is dismissed
354 - }
355 -
356 - func optionSelected(_ option: String) {
357 -// Code for when option is selected
358 - self.selectedNumber = option
359 - DispatchQueue.main.async {
360 - self.showConfirmDialog()
361 - }
362 - }
363 -}
364 -
1 -//
2 -// UnifiedCouponBCFooterTableViewCell.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 7/4/23.
6 -//
7 -
8 -import UIKit
9 -//import RSBarcodes_Swift
10 -import AVFoundation
11 -// import SwiftEventBus
12 -
13 -@objc public class UnifiedCouponBCFooterTableViewCell: UITableViewCell, UITextViewDelegate {
14 - @IBOutlet weak var termsButton: UIButton!
15 - @IBOutlet weak var termsTextView: UnselectableTappableTextView!
16 - @IBOutlet weak var termsTextViewHeight: NSLayoutConstraint!
17 - @IBOutlet weak var mapButton: UIButton!
18 - @IBOutlet weak var mapButtonHeight: NSLayoutConstraint!
19 - @IBOutlet weak var mapButtonTopSpace: NSLayoutConstraint!
20 - @IBOutlet weak var cancelButton: UIButton!
21 -
22 - public override func awakeFromNib() {
23 - super.awakeFromNib()
24 - // Initialization code
25 -
26 - termsTextView.delegate = self
27 -
28 - mapButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 17)
29 - mapButton.setTitle("Δες τα supermarket", for: .normal)
30 - mapButton.setTitleColor(UIColor(red: 1.00, green: 1.00, blue: 1.00, alpha: 1.00), for: .normal)
31 - mapButton.backgroundColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00)
32 - mapButton.layer.cornerRadius = 15.0
33 - mapButton.frame = CGRect(x: 0.0, y: 0.0, width: 260, height: 55)
34 -// mapButton.frame = CGRect(x: 0.0, y: 0.0, width: mapButton.intrinsicContentSize.width, height: 50)
35 -// mapButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 25, bottom: 0, right: 25)
36 -
37 - cancelButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 17)
38 - cancelButton.setTitle("Ακυρωση κουπονιού", for: .normal) // Ακύρωση ενιαίου κουπονιού
39 - cancelButton.setTitleColor(UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00), for: .normal)
40 - cancelButton.layer.cornerRadius = 15.0
41 - cancelButton.frame = CGRect(x: 0.0, y: 0.0, width: 260, height: 55)
42 -// cancelButton.frame = CGRect(x: 0.0, y: 0.0, width: cancelButton.intrinsicContentSize.width, height: 50)
43 -// cancelButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 25, bottom: 0, right: 25)
44 - cancelButton.backgroundColor = .clear
45 - cancelButton.layer.borderWidth = 2
46 - cancelButton.layer.borderColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00).cgColor
47 -
48 - // mapButton.isHidden = true
49 - // mapButtonHeight.constant = 0
50 - // mapButtonTopSpace.constant = 0
51 -
52 - // let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList()
53 -
54 - // for merchant in merchantList {
55 - // if (merchant._uuid == couponSetData?.merchant_uuid) {
56 - // if (merchant._show_map == true) {
57 - // mapButton.setTitle("Δες τα καταστήματα", for: .normal)
58 - // mapButton.frame = CGRect(x: 0.0, y: 0.0, width: mapButton.intrinsicContentSize.width, height: 44)
59 - // mapButton.contentEdgeInsets = UIEdgeInsets(top: 1, left: 16, bottom: 0, right: 16)
60 - // mapButton.isHidden = false
61 - // mapBtnVisible = true
62 - // eshopBtnVisible = false
63 - // mapButtonHeight.constant = 44
64 - // mapButtonTopSpace.constant = 10
65 - // } else if (merchant._eshop == true) {
66 - // mapButton.setTitle("Δες το eshop", for: .normal)
67 - // mapButton.frame = CGRect(x: 0.0, y: 0.0, width: mapButton.intrinsicContentSize.width, height: 44)
68 - // mapButton.contentEdgeInsets = UIEdgeInsets(top: 1, left: 16, bottom: 0, right: 16)
69 - // mapButton.isHidden = false
70 - // mapBtnVisible = false
71 - // eshopBtnVisible = true
72 - // mapButtonHeight.constant = 44
73 - // mapButtonTopSpace.constant = 10
74 - // } else {
75 - // mapButton.isHidden = true
76 - // mapBtnVisible = false
77 - // eshopBtnVisible = false
78 - // mapButtonHeight.constant = 0
79 - // mapButtonTopSpace.constant = 0
80 - // }
81 - // eshopWebsite = merchant._website
82 - // break;
83 - // }
84 - // }
85 -
86 - // Fix width for ipad
87 -// if UIDevice.current.userInterfaceIdiom == .pad {
88 -// // iPad
89 -// mapButton.widthAnchor.constraint(equalToConstant: 250).isActive = true
90 -// } else {
91 -// // not iPad (iPhone, mac, tv, carPlay, unspecified)
92 -// mapButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
93 -// }
94 -
95 - termsButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 15)
96 -// termsButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
97 - termsButton.setTitle("Όροι χρήσης", for: .normal)
98 - termsButton.setTitleColor(UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00), for: .normal)
99 - termsButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
100 - termsButton.semanticContentAttribute = .forceRightToLeft
101 - termsButton.tintColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 1.00)
102 - termsButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0);
103 - termsButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 5);
104 - termsButton.imageView?.layer.transform = CATransform3DMakeScale(0.8, 0.8, 0.8)
105 -
106 - let termsText = "1. Το εκπτωτικό κουπόνι ισχύει έως την ημερομηνία που αναφέρεται παραπάνω.\n2. To εκπτωτικό κουπόνι αφορά στα ενεργά κουπόνια προσφορών όπως αναφέρονται παραπάνω.\n3. Το εκπτωτικό κουπόνι μπορεί να χρησιμοποιηθεί σε μια μόνο συναλλαγή.\n4. Εάν δεν γίνει χρήση ενός επιμέρους κουπονιού προσφοράς από το εκπτωτικό κουπόνι, το κουπόνι προσφοράς επιστρέφει στο καλάθι στην ενότητα COSMOTE SUPERMARKET DEALS."
107 - termsTextView.attributedText = NSAttributedString(string: termsText)
108 - termsTextView.font = UIFont(name: "PeridotPE-Regular", size: 14)
109 - termsTextView.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
110 - termsTextView.textAlignment = .left
111 - termsTextView.isScrollEnabled = false
112 -
113 - termsTextView.isUserInteractionEnabled = true
114 - termsTextView.isEditable = false
115 - termsTextView.isSelectable = true
116 - termsTextView.dataDetectorTypes = [.link]
117 -
118 - }
119 -
120 - public override func setSelected(_ selected: Bool, animated: Bool) {
121 - super.setSelected(selected, animated: animated)
122 -
123 - // Configure the view for the selected state
124 - }
125 -
126 - public func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
127 - UIApplication.shared.open(URL)
128 -
129 - // Disable `.preview` by 3D Touch and other interactions
130 - return false
131 - }
132 -
133 - func configureCell(termsVisible: Bool) {
134 - toggleTerms(termsVisible: termsVisible)
135 - }
136 -
137 - func toggleTerms(termsVisible: Bool) {
138 - if (termsVisible) {
139 - termsTextView.isHidden = false
140 - let targetSize = CGSize(width: termsTextView.frame.width, height: CGFloat(MAXFLOAT))
141 - termsTextViewHeight.constant = termsTextView.sizeThatFits(targetSize).height
142 -
143 - termsButton.setImage(UIImage(named: "ic_up_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
144 - } else {
145 - termsTextView.isHidden = true
146 - termsTextViewHeight.constant = CGFloat(0)
147 -
148 - termsButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
149 - }
150 - }
151 -
152 -}
1 -//
2 -// UnifiedCouponBCHeaderTableViewCell.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 7/4/23.
6 -//
7 -
8 -import UIKit
9 -import RSBarcodes_Swift
10 -import AVFoundation
11 -// import SwiftEventBus
12 -
13 -@objc public class UnifiedCouponBCHeaderTableViewCell: UITableViewCell, UITextViewDelegate {
14 - @IBOutlet weak var couponImage: UIImageView!
15 - @IBOutlet weak var couponImageHeight: NSLayoutConstraint!
16 - @IBOutlet weak var nameLabel: UILabel!
17 - @IBOutlet weak var discriptionLabel: UILabel!
18 - @IBOutlet weak var merchantDescrTextView: UnselectableTappableTextView!
19 - @IBOutlet weak var merchantDescrTextViewHeight: NSLayoutConstraint!
20 - @IBOutlet weak var merchantDescrTextViewTopSpace: NSLayoutConstraint!
21 - @IBOutlet weak var couponView: UIView!
22 - @IBOutlet weak var couponNumberLabel: CopyableLabel!
23 - @IBOutlet weak var barcodeImage: UIImageView!
24 - @IBOutlet weak var barcodeImageHeight: NSLayoutConstraint!
25 - @IBOutlet weak var barcodeLabel: UILabel!
26 - @IBOutlet weak var barcodeLabelHeight: NSLayoutConstraint!
27 - @IBOutlet weak var showBarcodeButton: UIButton!
28 - @IBOutlet weak var expirationLabel: UILabel!
29 - @IBOutlet weak var expirationLabelHeight: NSLayoutConstraint!
30 - @IBOutlet weak var expirationLabelTopSpace: NSLayoutConstraint!
31 - @IBOutlet weak var borderViewHeight: NSLayoutConstraint!
32 - @IBOutlet weak var borderView2Height: NSLayoutConstraint!
33 - @IBOutlet weak var border1TopSpace: NSLayoutConstraint!
34 - @IBOutlet weak var barcodeImageTopSpace: NSLayoutConstraint!
35 - @IBOutlet weak var barcodeLabelTopSpace: NSLayoutConstraint!
36 - @IBOutlet weak var border2TopSpace: NSLayoutConstraint!
37 - @IBOutlet weak var showBarcodeButtonHeight: NSLayoutConstraint!
38 - @IBOutlet weak var showBarcodeButtonTopSpace: NSLayoutConstraint!
39 - @IBOutlet weak var showCouponsButton: UIButton!
40 - @IBOutlet weak var topExpirationView: UIView!
41 - @IBOutlet weak var topExpirationLabel: UILabel!
42 - @IBOutlet weak var barcodeTitleLabel: UILabel!
43 -
44 - let uiscreen: CGRect = UIScreen.main.bounds
45 -
46 - public override func awakeFromNib() {
47 - super.awakeFromNib()
48 - // Initialization code
49 -
50 - merchantDescrTextView.delegate = self
51 -
52 - // COUPONSET: desc, img_preview, name, terms
53 - // COUPON: coupon, expiration, discount, status
54 -
55 -// let couponSetData: swiftApi.CouponSetItemModel? = coupon?.couponset_data
56 -
57 -// couponImage.load(link: couponSetData?.img_preview ?? "", placeholder: UIImage(), cache: URLCache())
58 - couponImage.image = UIImage(named: "market_bg", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
59 - couponImage.contentMode = .scaleAspectFill
60 - couponImageHeight.constant = 222 // 255 //230 // 253 // self.uiscreen.height * 0.25
61 -
62 - nameLabel.text = "Εκπτωτικό κουπόνι COSMOTE SUPERMARKET DEALS!"
63 -
64 - topExpirationView.backgroundColor = UIColor(rgb: 0xB8E0EF)
65 - topExpirationView.layer.cornerRadius = 13.0
66 -
67 - topExpirationLabel.font = UIFont(name: "PeridotPE-Bold", size: 13)
68 - topExpirationLabel.textColor = UIColor(rgb: 0x004B87)
69 -
70 - // Hide bottom expirationLabel ==>
71 - expirationLabel.isHidden = true
72 - expirationLabelHeight.constant = CGFloat(0)
73 - expirationLabelTopSpace.constant = CGFloat(0)
74 - // ===
75 -
76 - barcodeTitleLabel.text = "barcode κουπονιού"
77 - barcodeTitleLabel.font = UIFont(name: "PeridotPE-Bold", size: 16)
78 - barcodeTitleLabel.textColor = UIColor(rgb: 0x212121)
79 -
80 - discriptionLabel.text = "Χρησιμοποίησε τον παρακάτω κωδικό και πάρε έκπτωση στα ενεργά κουπόνια προσφορών."
81 -
82 - merchantDescrTextView.text = ""
83 - merchantDescrTextViewTopSpace.constant = CGFloat(0)
84 - merchantDescrTextViewHeight.constant = CGFloat(0)
85 - merchantDescrTextView.isHidden = true
86 -
87 -// let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList()
88 -
89 -// for merchant in merchantList {
90 -// if (merchant._uuid == couponSetData?.merchant_uuid) {
91 -// let htmlMerchDescrText = merchant._body
92 -//
93 -// if (htmlMerchDescrText != "") {
94 -// merchantDescrTextView.attributedText = htmlMerchDescrText.htmlToAttributedString
95 -// merchantDescrTextView.font = UIFont(name: "PFSquareSansPro-Regular", size: 17)
96 -// merchantDescrTextView.textColor = UIColor(red: 0.25, green: 0.33, blue: 0.39, alpha: 1.00)
97 -// merchantDescrTextView.textAlignment = .center
98 -// merchantDescrTextView.isScrollEnabled = false
99 -// merchantDescrTextView.isUserInteractionEnabled = true
100 -// merchantDescrTextView.isEditable = false
101 -// merchantDescrTextView.isSelectable = true
102 -// merchantDescrTextView.dataDetectorTypes = [.link]
103 -//
104 -// merchantDescrTextView.isHidden = false
105 -// merchantDescrTextViewTopSpace.constant = CGFloat(15)
106 -// let targetSize = CGSize(width: merchantDescrTextView.frame.width, height: CGFloat(MAXFLOAT))
107 -// merchantDescrTextViewHeight.constant = merchantDescrTextView.sizeThatFits(targetSize).height
108 -// }
109 -//
110 -// break;
111 -// }
112 -// }
113 -
114 -
115 - showBarcodeButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 15)
116 - showBarcodeButton.setTitle("Εμφάνιση barcode", for: .normal)
117 - showBarcodeButton.setTitleColor(UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00), for: .normal)
118 - showBarcodeButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
119 - showBarcodeButton.semanticContentAttribute = .forceRightToLeft
120 - showBarcodeButton.tintColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 1.00)
121 - showBarcodeButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0);
122 - showBarcodeButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 5);
123 - showBarcodeButton.imageView?.layer.transform = CATransform3DMakeScale(0.8, 0.8, 0.8)
124 -
125 - showCouponsButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 15)
126 -// termsButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
127 - showCouponsButton.setTitle("Εμφάνιση προσφορών", for: .normal)
128 - showCouponsButton.setTitleColor(UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00), for: .normal)
129 - showCouponsButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
130 - showCouponsButton.semanticContentAttribute = .forceRightToLeft
131 - showCouponsButton.tintColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 1.00)
132 - showCouponsButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 10, bottom: 0, right: 0);
133 - showCouponsButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: -10, bottom: 0, right: 10);
134 - showCouponsButton.imageView?.layer.transform = CATransform3DMakeScale(0.8, 0.8, 0.8)
135 - showCouponsButton.frame = CGRect(x: 0.0, y: 0.0, width: showCouponsButton.intrinsicContentSize.width+10, height: 40)
136 - }
137 -
138 - public override func setSelected(_ selected: Bool, animated: Bool) {
139 - super.setSelected(selected, animated: animated)
140 -
141 - // Configure the view for the selected state
142 - }
143 -
144 - func configureCell(coupon: swiftApi.UnifiedCouponModel?, couponsVisible: Bool) {
145 -
146 - couponView.layer.cornerRadius = 16
147 -// couponNumberLabel.text = ((coupon?._code != 0) ? String(coupon?._code ?? 0) : "")
148 - couponNumberLabel.text = coupon?._barcode ?? ""
149 - couponView.frame = CGRect(x: 0.0, y: 0.0, width: couponView.intrinsicContentSize.width, height: 55)
150 -
151 -
152 -// let activeCoupons = coupon?._coupons.filter { $0.status == 1 }
153 -// let activeCouponsDiscount = (activeCoupons?.reduce(0) { $0 + (Float($1.discount ?? "0") ?? 0) }) ?? 0
154 -
155 -// // discriptionLabel.text = "Χρησιμοποίησε τον παρακάτω κωδικό και πάρε έκπτωση στα ενεργά κουπόνια προσφορών αξίας " + String(activeCouponsDiscount) + "€."
156 -
157 -// // ========
158 -// let discrNormalText1 = "Χρησιμοποίησε τον παρακάτω κωδικό και πάρε έκπτωση στα ενεργά κουπόνια προσφορών αξίας "
159 -// let discrBoldText = String(activeCouponsDiscount) + "€."
160 -
161 -// let attrRegular = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-Regular", size: 16) ?? UIFont.systemFont(ofSize: 15), NSAttributedString.Key.foregroundColor: UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)]
162 -// let attrBold = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-Bold", size: 16) ?? UIFont.boldSystemFont(ofSize: 15), NSAttributedString.Key.foregroundColor: UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)]
163 -
164 -// let sumAttributedString = NSMutableAttributedString(string:discrNormalText1, attributes:attrRegular)
165 -// let sumBoldString = NSMutableAttributedString(string: discrBoldText, attributes:attrBold)
166 -
167 -// sumAttributedString.append(sumBoldString)
168 -// discriptionLabel.attributedText = sumAttributedString
169 -// // ========
170 -
171 -// let barcodeString = constructBarcode(coupon: coupon) ?? ""
172 - let barcodeString = coupon?._barcode ?? ""
173 - barcodeLabel.text = barcodeString
174 -
175 - // Uncomment if Barcode Section is active again
176 - if let barcodeUIImage = RSUnifiedCodeGenerator.shared.generateCode(barcodeString, machineReadableCodeObjectType: AVMetadataObject.ObjectType.ean13.rawValue, targetSize: CGSize(width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.1)) {
177 - barcodeImage.image = barcodeUIImage
178 -
179 - barcodeImageHeight.constant = self.uiscreen.height * 0.1
180 -
181 - showBarcodeButton.isHidden = false
182 - showBarcodeButtonHeight.constant = 50
183 - showBarcodeButtonTopSpace.constant = 10
184 -
185 - } else {
186 - barcodeImageHeight.constant = 0
187 -
188 - showBarcodeButton.isHidden = true
189 - showBarcodeButtonHeight.constant = 0
190 - showBarcodeButtonTopSpace.constant = 0
191 -
192 - borderViewHeight.constant = CGFloat(0)
193 - borderView2Height.constant = CGFloat(0)
194 -
195 - border1TopSpace.constant = CGFloat(0) // 20
196 - barcodeImageTopSpace.constant = CGFloat(0) // 10
197 - barcodeLabelTopSpace.constant = CGFloat(0) // 10
198 - border2TopSpace.constant = CGFloat(0) // 15
199 - }
200 - // ===
201 -
202 - // === Hide Barcode Section
203 -// barcodeImage.isHidden = true
204 -// barcodeImageHeight.constant = CGFloat(0)
205 - barcodeLabel.isHidden = true
206 - barcodeLabelHeight.constant = CGFloat(0)
207 -//
208 -// borderViewHeight.constant = CGFloat(0)
209 -// borderView2Height.constant = CGFloat(0)
210 -//
211 -// border1TopSpace.constant = CGFloat(0) // 20
212 -// barcodeImageTopSpace.constant = CGFloat(0) // 10
213 - barcodeLabelTopSpace.constant = CGFloat(0) // 10
214 -// border2TopSpace.constant = CGFloat(0) // 15
215 -//
216 - showBarcodeButton.isHidden = true
217 - showBarcodeButtonHeight.constant = 0
218 - showBarcodeButtonTopSpace.constant = 0
219 - // ===
220 -
221 -// if let earliestExpiration = coupon?._coupons.min(by: { ($0.expiration ?? "") < ($1.expiration ?? "") }) {
222 - if let latestExpiration = coupon?._coupons.max(by: { ($0.expiration ?? "") < ($1.expiration ?? "") }) {
223 - expirationLabel.text = "Το κουπόνι ισχύει έως " + (latestExpiration.expiration ?? "")
224 - topExpirationLabel.text = "Ισχύει έως " + (latestExpiration.expiration ?? "")
225 - topExpirationLabel.frame.size.width = topExpirationLabel.intrinsicContentSize.width
226 - } else {
227 - expirationLabel.text = ""
228 - topExpirationLabel.text = ""
229 - }
230 -
231 - toggleCoupons(couponsVisible: couponsVisible)
232 -
233 - }
234 -
235 - func constructBarcode(coupon: swiftApi.UnifiedCouponModel?) -> String? {
236 - // EAN 13 barcode construction
237 -// let couponData = coupon?.couponset_data
238 - let couponString = coupon?._barcode ?? ""
239 -
240 - if (!couponString.isEmpty) {
241 - var checkDigit = 0;
242 - var result = 0;
243 -
244 - var fixedCouponCode = couponString;
245 - if (fixedCouponCode.count < 12) {
246 - let loops = 12 - fixedCouponCode.count;
247 - var zerosStr = "";
248 - for i in 0 ..< loops {
249 - zerosStr += "0"
250 - }
251 - // fixedCouponCode = zerosStr + fixedCouponCode;
252 - fixedCouponCode = fixedCouponCode + zerosStr;
253 - }
254 -
255 - var multiplier = 3;
256 - for idx in (0 ... (fixedCouponCode.count - 1)).reversed() {
257 - let curChar = fixedCouponCode[idx];
258 - result += (Int(curChar) ?? 0) * multiplier;
259 - multiplier = multiplier == 3 ? 1 : 3;
260 - }
261 - checkDigit = 10 - (result % 10);
262 -
263 - let barcodeStr = fixedCouponCode + String(checkDigit);
264 - return barcodeStr;
265 - }
266 -
267 - return ""
268 - }
269 -
270 - public func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
271 - UIApplication.shared.open(URL)
272 -
273 - // Disable `.preview` by 3D Touch and other interactions
274 - return false
275 - }
276 -
277 - func toggleBarcode(barcodeVisible: Bool) {
278 - if (barcodeVisible) {
279 - barcodeImage.isHidden = false
280 - if (barcodeImage.image == nil) {
281 - barcodeImageHeight.constant = CGFloat(0)
282 - } else {
283 - barcodeImageHeight.constant = self.uiscreen.height * 0.1
284 - }
285 - barcodeLabel.isHidden = false
286 - let targetSize = CGSize(width: barcodeLabel.frame.width, height: CGFloat(MAXFLOAT))
287 - barcodeLabelHeight.constant = barcodeLabel.sizeThatFits(targetSize).height
288 -
289 - borderViewHeight.constant = CGFloat(1)
290 - borderView2Height.constant = CGFloat(1)
291 -
292 - border1TopSpace.constant = CGFloat(20) // 20
293 - barcodeImageTopSpace.constant = CGFloat(10) // 10
294 - barcodeLabelTopSpace.constant = CGFloat(10) // 10
295 - border2TopSpace.constant = CGFloat(15) // 15
296 -
297 - showBarcodeButton.setTitle("Απόκρυψη barcode", for: .normal)
298 - showBarcodeButton.setImage(UIImage(named: "ic_up_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
299 -
300 - } else {
301 - barcodeImage.isHidden = true
302 - barcodeImageHeight.constant = CGFloat(0)
303 - barcodeLabel.isHidden = true
304 - barcodeLabelHeight.constant = CGFloat(0)
305 -
306 - borderViewHeight.constant = CGFloat(0)
307 - borderView2Height.constant = CGFloat(0)
308 -
309 - border1TopSpace.constant = CGFloat(0) // 20
310 - barcodeImageTopSpace.constant = CGFloat(0) // 10
311 - barcodeLabelTopSpace.constant = CGFloat(0) // 10
312 - border2TopSpace.constant = CGFloat(0) // 15
313 -
314 - showBarcodeButton.setTitle("Εμφάνιση barcode", for: .normal)
315 - showBarcodeButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
316 - }
317 - }
318 -
319 - func toggleCoupons(couponsVisible: Bool) {
320 - if (couponsVisible) {
321 - showCouponsButton.setTitle("Απόκρυψη προσφορών", for: .normal)
322 - showCouponsButton.setImage(UIImage(named: "ic_up_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
323 - showCouponsButton.frame = CGRect(x: 0.0, y: 0.0, width: showCouponsButton.intrinsicContentSize.width+10, height: 40)
324 -
325 - } else {
326 - showCouponsButton.setTitle("Εμφάνιση προσφορών", for: .normal)
327 - showCouponsButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
328 - showCouponsButton.frame = CGRect(x: 0.0, y: 0.0, width: showCouponsButton.intrinsicContentSize.width+10, height: 40)
329 - }
330 - }
331 -
332 -}
1 -//
2 -// UnifiedCouponBarcodeViewController.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 6/4/23.
6 -//
7 -
8 -import UIKit
9 -import RSBarcodes_Swift
10 -import AVFoundation
11 -import SwiftEventBus
12 -
13 -@objc public class UnifiedCouponBarcodeViewController: UIViewController {
14 - @IBOutlet weak var mainView: UIView!
15 - @IBOutlet weak var tableView: UITableView!
16 -
17 - let uiscreen: CGRect = UIScreen.main.bounds
18 -
19 - var termsVisible: Bool = false;
20 - var barcodeVisible: Bool = false;
21 - var couponsVisible: Bool = false;
22 -
23 - var mapBtnVisible: Bool = false;
24 - var eshopBtnVisible: Bool = false;
25 - var eshopWebsite: String = "";
26 -
27 - public var coupon: swiftApi.UnifiedCouponModel?
28 - public var isFromWallet: Bool? = false
29 -
30 - let spinner = SpinnerViewController()
31 -
32 - public override func viewDidLoad() {
33 - super.viewDidLoad()
34 -
35 - self.hidesBottomBarWhenPushed = true
36 -
37 - tableView.delegate = self
38 - tableView.dataSource = self
39 -
40 - // Do any additional setup after loading the view.
41 - setBackButton()
42 - setNavigationTitle("Εκπτωτικό κουπόνι")
43 -
44 - // Logs
45 -// print("Coupon: " + (coupon?.coupon ?? ""))
46 -// print("Coupon Name: " + (couponSetData?.name ?? ""))
47 -// print("Coupon Description: " + (couponSetData?.short_description ?? ""))
48 -// print("Coupon Expiration: " + (coupon?.expiration ?? ""))
49 -
50 - }
51 -
52 - public override func viewWillAppear(_ animated: Bool) {
53 - super.viewWillAppear(animated)
54 -
55 - swiftApi().logTrackersEvent("screen", "UnifiedCouponScreen")
56 -
57 - self.navigationController?.hideHairline()
58 - }
59 -
60 -
61 - // MARK: - Functions
62 - func showSpinner() {
63 - // add the spinner view controller
64 - // addChild(spinner)
65 - // spinner.view.frame = view.frame
66 - // view.addSubview(spinner.view)
67 - // spinner.didMove(toParent: self)
68 -
69 - addChild(spinner)
70 - spinner.view.frame = CGRect(x: 0, y: 0, width: self.view.frame.width, height: self.view.frame.height)
71 - self.view.addSubview(spinner.view)
72 - spinner.didMove(toParent: self)
73 - }
74 -
75 - func hideSpinner() {
76 - // remove the spinner view controller
77 - spinner.willMove(toParent: nil)
78 - spinner.view.removeFromSuperview()
79 - spinner.removeFromParent()
80 - }
81 -
82 - func showConfirmDialog() -> Void {
83 -
84 - let alert = UIAlertController(title: "Ακύρωση Κουπονιού", message: "Είσαι σίγουρος ότι θέλεις να ακυρώσεις το κουπόνι σου;", preferredStyle: .alert)
85 -
86 - let cancelButton = UIAlertAction(title: "Όχι", style: .default, handler: { action in
87 - switch action.style{
88 - case .default:
89 - print("default")
90 -
91 - case .cancel:
92 - print("cancel")
93 -
94 - case .destructive:
95 - print("destructive")
96 -
97 - }
98 - })
99 - // cancelButton.setValue(UIColor(rgb: 0xFC5757), forKey: "titleTextColor")
100 - alert.addAction(cancelButton)
101 -
102 - alert.addAction(UIAlertAction(title: "Ναι", style: .default, handler: { action in
103 - switch action.style{
104 - case .default:
105 - self.cancelUnifiedCouponRequest()
106 -
107 - case .cancel:
108 - print("cancel")
109 -
110 - case .destructive:
111 - print("destructive")
112 -
113 - }
114 - }))
115 -
116 - self.present(alert, animated: true, completion: nil)
117 - }
118 -
119 - func showSuccessDialog() -> Void {
120 -
121 - let alert = UIAlertController(title: "Ακύρωση Κουπονιού", message: "Το ενιαίο κουπόνι σου ακυρώθηκε επιτυχώς. Βρες τα μεμονωμένα κουπόνια στο My Rewards.", preferredStyle: .alert)
122 - alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
123 - switch action.style{
124 - case .default:
125 - SwiftEventBus.post("refresh_unified_coupons")
126 - self.navigationController?.popViewController(animated: true)
127 - // self.dismiss(animated: true, completion: {})
128 -
129 - case .cancel:
130 - print("cancel")
131 -
132 - case .destructive:
133 - print("destructive")
134 -
135 - }
136 - }))
137 - self.present(alert, animated: true, completion: nil)
138 - }
139 -
140 - func cancelUnifiedCouponRequest () -> Void {
141 - self.showSpinner()
142 - var tranIdFound = "";
143 - for coupon in self.coupon?._coupons ?? [] {
144 - if ((coupon.transaction_uuid != nil) && coupon.transaction_uuid != "") {
145 - tranIdFound = coupon.transaction_uuid ?? "";
146 - break;
147 - }
148 - }
149 -
150 - if (tranIdFound != "") {
151 - swiftApi().cancelUnifiedCouponAsync(transactionId: tranIdFound, self.cancelUnifiedCouponCallback, failureCallback: { errorCode in
152 - self.hideSpinner()
153 - })
154 - } else {
155 - self.hideSpinner()
156 - }
157 - }
158 -
159 - func cancelUnifiedCouponCallback (_ responseData: swiftApi.GenericResponseModel?) -> Void {
160 - self.hideSpinner()
161 - if (responseData != nil) {
162 - DispatchQueue.main.async {
163 - if (responseData?.getStatus == 1) {
164 - self.showSuccessDialog()
165 -
166 - swiftApi().getUnifiedCouponsDeals { unifiedCoupons in
167 - } failureCallback: { errorCode in
168 - }
169 - }
170 -
171 - }
172 - }
173 - }
174 -
175 - // MARK: - Actions
176 - @IBAction func showCouponsButtonAction(_ sender: Any) {
177 - couponsVisible = !couponsVisible
178 -// self.tableView.reloadSections(IndexSet(0..<2), with: .none)
179 - self.tableView.reloadData()
180 - }
181 -
182 - @IBAction func showBarcodeAction(_ sender: Any) {
183 - barcodeVisible = !barcodeVisible
184 -// self.tableView.reloadSections(IndexSet(integer: 0), with: .none)
185 - self.tableView.reloadData()
186 - }
187 -
188 - @IBAction func termsButtonAction(_ sender: Any) {
189 - termsVisible = !termsVisible
190 -// self.tableView.reloadSections(IndexSet(integer: 2), with: .none)
191 - self.tableView.reloadData()
192 - }
193 -
194 - @IBAction func mapButtonAction(_ sender: Any) {
195 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
196 - if let popupVC = storyboard.instantiateViewController(withIdentifier: "PopupMerchantCategoriesViewController") as? SwiftWarplyFramework.PopupMerchantCategoriesViewController {
197 - popupVC.modalPresentationStyle = .overCurrentContext
198 - popupVC.modalTransitionStyle = .crossDissolve
199 -// popupVC.coupon = coupon
200 - popupVC.delegate = self
201 -
202 - self.present(popupVC, animated: true, completion: nil)
203 - }
204 -
205 - // =======
206 -
207 -// swiftApi().logTrackersEvent("click", "SeeShops")
208 -//
209 -// let vc = SwiftWarplyFramework.MapsViewController(nibName: "MapsViewController", bundle: Bundle(for: MyEmptyClass.self))
210 -//// vc.couponSet = coupon?.couponset_data
211 -// vc.isMarket = true
212 -// self.navigationController?.pushViewController(vc, animated: true)
213 -
214 - // =======
215 -
216 - // if (mapBtnVisible == true) {
217 - // swiftApi().logTrackersEvent("click", "SeeShops")
218 -
219 - // let vc = SwiftWarplyFramework.MapsViewController(nibName: "MapsViewController", bundle: Bundle(for: MyEmptyClass.self))
220 - // vc.couponSet = coupon?.couponset_data
221 - // self.navigationController?.pushViewController(vc, animated: true)
222 -
223 - // } else if (eshopBtnVisible == true) {
224 - // if (eshopWebsite != "") {
225 - // guard let websiteUrl = URL(string: eshopWebsite) else {
226 - // print("Error creating URL")
227 - // return
228 - // }
229 -
230 - // // check if link can be opened.
231 - // guard UIApplication.shared.canOpenURL(websiteUrl) else {
232 - // return
233 - // }
234 -
235 - // swiftApi().logTrackersEvent("click", "SeeShopWebsite")
236 - // UIApplication.shared.open(websiteUrl, options: [:], completionHandler: nil)
237 - // }
238 - // }
239 - }
240 -
241 - @IBAction func cancelButtonAction(_ sender: Any) {
242 - self.showConfirmDialog()
243 - }
244 -}
245 -
246 -// MARK: - TableView
247 -extension UnifiedCouponBarcodeViewController: UITableViewDelegate, UITableViewDataSource{
248 -
249 - public func numberOfSections(in tableView: UITableView) -> Int {
250 - return 3
251 - }
252 -
253 - public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
254 - if (section == 0) {
255 - return 1
256 - } else if (section == 1) {
257 - if (couponsVisible == true) {
258 - return self.coupon?._coupons.count ?? 0
259 - } else {
260 - return 0
261 - }
262 -
263 - } else if (section == 2) {
264 - return 1
265 - } else {
266 - return 0
267 - }
268 -
269 - }
270 -
271 - public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
272 - if (indexPath.section == 0) {
273 - return UITableView.automaticDimension
274 - } else if (indexPath.section == 1) {
275 - if (couponsVisible == true) {
276 - return 130.0 + 8.0
277 - } else {
278 - return 0.0
279 - }
280 -
281 - } else if (indexPath.section == 2) {
282 - return UITableView.automaticDimension
283 - } else {
284 - return 0.0
285 - }
286 - }
287 -
288 - public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
289 - if (indexPath.section == 0) {
290 - let cell = tableView.dequeueReusableCell(withIdentifier: "UnifiedCouponBCHeaderTableViewCell", for: indexPath) as! UnifiedCouponBCHeaderTableViewCell
291 -
292 - cell.configureCell(coupon: self.coupon, couponsVisible: couponsVisible)
293 -
294 - return cell
295 -
296 - } else if (indexPath.section == 1) {
297 - let cell = tableView.dequeueReusableCell(withIdentifier: "CouponsTableViewCellId", for: indexPath) as! CouponsTableViewCell
298 -
299 - cell.configureCell(coupon: (self.coupon?._coupons[indexPath.row])!, isMarket: true)
300 -
301 - return cell
302 -
303 - } else {
304 - let cell = tableView.dequeueReusableCell(withIdentifier: "UnifiedCouponBCFooterTableViewCell", for: indexPath) as! UnifiedCouponBCFooterTableViewCell
305 -
306 - cell.configureCell(termsVisible: termsVisible)
307 -
308 - return cell
309 - }
310 - }
311 -
312 - public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
313 -
314 - // SwiftEventBus.post("couponBarcodePressed", sender: coupons[indexPath.row])
315 -
316 - // Logs
317 -// let couponSetData: swiftApi.CouponSetItemModel? = self.coupon?._coupons[indexPath.row].couponset_data
318 -// print("Coupon clicked: " + (self.coupon?._coupons[indexPath.row].coupon ?? ""))
319 -// print("Coupon Name clicked: " + (couponSetData?.name ?? ""))
320 -// print("Coupon Description clicked: " + (couponSetData?.short_description ?? ""))
321 -// print("Coupon Expiration clicked: " + (self.coupon?._coupons[indexPath.row].expiration ?? ""))
322 -
323 - if (indexPath.section == 1) {
324 - swiftApi().logTrackersEvent("click", ("Coupon:" + (self.coupon?._coupons[indexPath.row].name ?? "")))
325 -
326 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
327 - let vc = storyboard.instantiateViewController(withIdentifier: "CouponBarcodeViewController") as! SwiftWarplyFramework.CouponBarcodeViewController
328 - vc.coupon = self.coupon?._coupons[indexPath.row]
329 - vc.isMarket = true
330 - self.navigationController?.pushViewController(vc, animated: true)
331 - }
332 - }
333 -
334 - public func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
335 - if (section == 0){
336 - return nil
337 -
338 - } else if (section == 1) {
339 - if (couponsVisible == true) {
340 - let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 12))
341 - view.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1.00)
342 -
343 - return view
344 - } else {
345 - return nil
346 - }
347 -
348 - } else {
349 - return nil
350 - }
351 - }
352 -
353 - public func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
354 - if (section == 0) {
355 - return 0.0
356 -
357 - } else if (section == 1) {
358 - if (couponsVisible == true) {
359 - return 12.0
360 - } else {
361 - return 0.0
362 - }
363 -
364 - } else {
365 - return 0.0
366 - }
367 - }
368 -
369 - public func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
370 - if (section == 0) {
371 - return 0.0
372 -
373 - } else if (section == 1) {
374 - if (couponsVisible == true) {
375 - return 2.0
376 - } else {
377 - return 0.0
378 - }
379 -
380 - } else {
381 - return 0.0
382 - }
383 - }
384 -
385 - public func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
386 - if (section == 0){
387 - return nil
388 -
389 - } else if (section == 1) {
390 - if (couponsVisible == true) {
391 - let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 2))
392 - view.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1.00)
393 -
394 - return view
395 - } else {
396 - return nil
397 - }
398 -
399 - } else {
400 - return nil
401 - }
402 - }
403 -
404 -}
405 -
406 -// MARK: - MerchantTableViewCellDelegate
407 -extension UnifiedCouponBarcodeViewController: PopupMerchantCategoriesViewControllerDelegate {
408 -
409 - func didTapMapButton() {
410 - swiftApi().logTrackersEvent("click", "SeeShops")
411 -
412 - let vc = SwiftWarplyFramework.MapsViewController(nibName: "MapsViewController", bundle: Bundle(for: MyEmptyClass.self))
413 -// vc.couponSet = coupon?.couponset_data
414 - vc.isMarket = true
415 - self.navigationController?.pushViewController(vc, animated: true)
416 - }
417 -
418 - func didTapEshopsButton() {
419 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
420 - if let popupVC = storyboard.instantiateViewController(withIdentifier: "PopupMerchantsViewController") as? SwiftWarplyFramework.PopupMerchantsViewController {
421 - popupVC.modalPresentationStyle = .overCurrentContext
422 - popupVC.modalTransitionStyle = .crossDissolve
423 - popupVC.availableShopsList = []
424 - popupVC.headerText = "Δες τα eshop"
425 - popupVC.buttonTitle = "Δες το eshop"
426 -// popupVC.buttonIcon = "shopping_cart"
427 - popupVC.footerText = "Η διαθεσιμότητα ενδέχεται να διαφέρει ανάλογα με την τοποθεσία."
428 - popupVC.showEshops = true
429 -
430 - self.present(popupVC, animated: true, completion: nil)
431 - }
432 - }
433 -
434 -}
1 -//
2 -// UnifiedCouponsTableViewCell.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 3/4/23.
6 -//
7 -
8 -import Foundation
9 -import UIKit
10 -
11 -@objc public class UnifiedCouponsTableViewCell: UITableViewCell {
12 - @IBOutlet weak var couponBgImage: UIImageView!
13 - @IBOutlet weak var couponImage: UIImageView!
14 - @IBOutlet weak var borderView: UIView!
15 - @IBOutlet weak var nameLabel: UILabel!
16 - @IBOutlet weak var discriptionLabel: UILabel!
17 - @IBOutlet weak var expirationLabel: UILabel!
18 -
19 -
20 - public override func awakeFromNib() {
21 - super.awakeFromNib()
22 - // Initialization code
23 -
24 - // Add shadow
25 - self.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
26 - self.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
27 - self.layer.shadowOpacity = 1.0
28 - self.layer.shadowRadius = 1.0
29 -
30 - couponBgImage.image = UIImage(named: "coupon_bg_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
31 - couponImage.image = UIImage(named: "coupon_market_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
32 -
33 -
34 - borderView.addDashedBorderVertical(color: UIColor(red: 0.62, green: 0.62, blue: 0.61, alpha: 1.00), width: 1.0, height: 110.0)
35 - }
36 -
37 - public override func setSelected(_ selected: Bool, animated: Bool) {
38 - super.setSelected(selected, animated: animated)
39 -
40 - // Configure the view for the selected state
41 - }
42 -
43 - public override func layoutSubviews() {
44 - super.layoutSubviews()
45 - //set the values for top,left,bottom,right margins
46 - let margins = UIEdgeInsets(top: 0, left: 0, bottom: 8, right: 0)
47 - contentView.frame = contentView.frame.inset(by: margins)
48 - }
49 -
50 -
51 - func configureCell(coupon: swiftApi.UnifiedCouponModel) {
52 - let activeCoupons = coupon._coupons.filter { $0.status == 1 }
53 - let activeCouponsCount = activeCoupons.count
54 - // let activeCouponsDiscount = activeCoupons.reduce(0) { $0 + (Float($1.discount ?? "0") ?? 0) }
55 -
56 -// var activeCouponsCount:Int = 0
57 -// for coupon in coupon._coupons {
58 -// if (coupon.status == 1) {
59 -// activeCouponsCount += 1
60 -// }
61 -// }
62 -
63 - nameLabel.text = "COSMOTE SUPERMARKET DEALS"
64 -
65 - discriptionLabel.text =
66 - "έχεις " + String(activeCouponsCount) +
67 - (
68 - activeCouponsCount == 1 ? " ενεργό κουπόνι" : " ενεργά κουπόνια"
69 - )
70 - // + " αξίας " + String(activeCouponsDiscount) + "€"
71 -
72 -// if let earliestExpiration = activeCoupons.min(by: { ($0.expiration ?? "") < ($1.expiration ?? "") }) {
73 - if let latestExpiration = activeCoupons.max(by: { ($0.expiration ?? "") < ($1.expiration ?? "") }) {
74 - expirationLabel.text = "Ισχύει έως " + (latestExpiration.expiration ?? "")
75 - } else {
76 - expirationLabel.text = ""
77 - }
78 - }
79 -
80 -}
1 -//
2 -// UnifiedCouponsViewController.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 20/10/23.
6 -//
7 -
8 -import Foundation
9 -import UIKit
10 -import SwiftEventBus
11 -
12 -@objc public class UnifiedCouponsViewController: UIViewController {
13 - @IBOutlet weak var backgroundImage: UIImageView!
14 - @IBOutlet weak var tableView: UITableView!
15 - @IBOutlet weak var emptyView: UIView!
16 - @IBOutlet weak var emptyViewHeight: NSLayoutConstraint!
17 - @IBOutlet weak var emptyLabel: UILabel!
18 - @IBOutlet weak var submitButton: UIButton!
19 - @IBOutlet weak var submitButtonHeight: NSLayoutConstraint!
20 -
21 - public var unifiedCoupons:Array<swiftApi.UnifiedCouponModel> = []
22 - public var smCoupons:Array<swiftApi.CouponItemModel> = []
23 - public var smCouponsSelected:Array<swiftApi.CouponItemModel> = []
24 - public var isFromCampaignVC: Bool = false
25 -
26 - // A reference to the Select All image view for later use
27 - var circleImageView: UIImageView!
28 -
29 - // Track the selection state
30 - var isSelectAllActive: Bool = false
31 -
32 - let spinner = SpinnerViewController()
33 -
34 -
35 - public override func viewDidLoad() {
36 - super.viewDidLoad()
37 -
38 - self.hidesBottomBarWhenPushed = true
39 -
40 - SwiftEventBus.onBackgroundThread(self, name: "unified_coupons_fetched") { result in
41 -
42 - DispatchQueue.main.async {
43 - self.unifiedCoupons = swiftApi().getUnifiedCouponList()
44 -// self.tableView.reloadData()
45 - // Reload the Unified Coupons section only
46 - self.tableView.reloadSections(IndexSet(integer: 0), with: .automatic)
47 -
48 - if (self.unifiedCoupons.count == 0 && self.smCoupons.count == 0) {
49 - self.emptyView.isHidden = false
50 - self.emptyViewHeight.constant = self.emptyView.intrinsicContentSize.height
51 - } else {
52 - self.emptyView.isHidden = true
53 - self.emptyViewHeight.constant = 0
54 - }
55 - }
56 - }
57 -
58 - SwiftEventBus.onBackgroundThread(self, name: "sm_coupons_fetched") { result in
59 -
60 - DispatchQueue.main.async {
61 - self.smCoupons = swiftApi().getSMCouponList()
62 - // self.tableView.reloadData()
63 - // Reload the SM Coupons section only
64 - self.tableView.reloadSections(IndexSet(integer: 1), with: .automatic)
65 - self.handleSubmitButtonVisible()
66 -
67 - if (self.unifiedCoupons.count == 0 && self.smCoupons.count == 0) {
68 - self.emptyView.isHidden = false
69 - self.emptyViewHeight.constant = self.emptyView.intrinsicContentSize.height
70 - } else {
71 - self.emptyView.isHidden = true
72 - self.emptyViewHeight.constant = 0
73 - }
74 - }
75 - }
76 -
77 - setBackButton()
78 - setNavigationTitle("SUPERMARKET DEALS")
79 - // Setup the info button with an action
80 - setNavBarRightInfoButton() {
81 - // This closure is the action that will be executed when the info button is tapped
82 - self.presentInfoPopup()
83 - }
84 -
85 -// backgroundImage.image = UIImage(named: "coupons_scrollview_dark", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
86 -
87 - tableView.delegate = self
88 - tableView.dataSource = self
89 -
90 -// tableView.clipsToBounds = true
91 -// tableView.layer.cornerRadius = 30
92 -// tableView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
93 -// tableView.contentInset.top = 30
94 - tableView.contentInset.bottom = 115
95 -
96 - emptyLabel.text = "Αυτήν τη στιγμή δεν έχεις κάποιο ενεργό κουπόνι. Στην ενότητα FOR YOU μπορείς να βρεις κουπόνια αποκλειστικά για σένα!"
97 -
98 - submitButton.setTitle("Συνδύασε τις προσφορές σε ένα κουπόνι", for: .normal)
99 - submitButton.setTitleColor(.white, for: .normal)
100 - submitButton.layer.cornerRadius = 16.0
101 -// submitButton.backgroundColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00)
102 - submitButton.backgroundColor = UIColor(rgb: 0x9D9D9C)
103 - submitButton.isEnabled = false
104 -// submitButton.frame = CGRect(x: 0.0, y: 0.0, width: submitButton.intrinsicContentSize.width, height: 50)
105 -// submitButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 25, bottom: 0, right: 25)
106 - // Fix width for ipad
107 - if UIDevice.current.userInterfaceIdiom == .pad {
108 - // iPad
109 - submitButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 18)
110 -// submitButton.widthAnchor.constraint(equalToConstant: 250).isActive = true
111 - } else {
112 - // not iPad (iPhone, mac, tv, carPlay, unspecified)
113 - submitButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 16)
114 -// submitButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
115 - }
116 - }
117 -
118 - public override func viewWillAppear(_ animated: Bool) {
119 - super.viewWillAppear(animated)
120 -
121 - swiftApi().logTrackersEvent("screen", "ActiveUnifiedCouponsScreen")
122 -
123 - self.unifiedCoupons = swiftApi().getUnifiedCouponList()
124 - self.smCoupons = swiftApi().getSMCouponList()
125 - self.tableView.reloadData()
126 - self.handleSubmitButtonVisible()
127 -
128 - if (self.unifiedCoupons.count == 0 && self.smCoupons.count == 0) {
129 - self.emptyView.isHidden = false
130 - self.emptyViewHeight.constant = self.emptyView.intrinsicContentSize.height
131 - } else {
132 - self.emptyView.isHidden = true
133 - self.emptyViewHeight.constant = 0
134 - }
135 -
136 - self.navigationController?.hideHairline()
137 -
138 - if (self.isFromCampaignVC == true) {
139 - swiftApi().getUnifiedCouponsDeals { unifiedCoupons in
140 - } failureCallback: { errorCode in
141 - }
142 - }
143 - }
144 -
145 - // MARK: - Functions
146 - func showSpinner() {
147 - // add the spinner view controller
148 - // addChild(spinner)
149 - // spinner.view.frame = view.frame
150 - // view.addSubview(spinner.view)
151 - // spinner.didMove(toParent: self)
152 -
153 - addChild(spinner)
154 - spinner.view.frame = CGRect(x: 0, y: 0, width: self.view.frame.width, height: self.view.frame.height)
155 - self.view.addSubview(spinner.view)
156 - spinner.didMove(toParent: self)
157 - }
158 -
159 - func hideSpinner() {
160 - // remove the spinner view controller
161 - spinner.willMove(toParent: nil)
162 - spinner.view.removeFromSuperview()
163 - spinner.removeFromParent()
164 - }
165 -
166 - // Button action for "select all"
167 - @objc func selectAllTapped() {
168 - // Toggle the selection state
169 - isSelectAllActive.toggle()
170 -
171 - // Update the image based on the new state
172 - if (isSelectAllActive) {
173 - circleImageView.image = UIImage(named: "circle_checked", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) // Selected image
174 - smCouponsSelected = smCoupons
175 - } else {
176 - circleImageView.image = UIImage(named: "circle_unchecked", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) // Unselected image
177 - smCouponsSelected = []
178 - }
179 -
180 - handleSubmitButtonUI()
181 -
182 - // Reload the SM Coupons section only
183 - tableView.reloadSections(IndexSet(integer: 1), with: .automatic)
184 - }
185 -
186 - func handleSelectCouponAction(indexPath: IndexPath) {
187 - let currentCoupon = self.smCoupons[indexPath.row]
188 - let isCouponSelected = self.smCouponsSelected.contains { $0.coupon == currentCoupon.coupon }
189 -
190 - if (isCouponSelected) {
191 - self.smCouponsSelected = self.smCouponsSelected.filter({ return $0.coupon != currentCoupon.coupon })
192 - if (isSelectAllActive) {
193 - isSelectAllActive = false
194 - // Reload the SM Coupons section only
195 - tableView.reloadSections(IndexSet(integer: 1), with: .automatic)
196 -
197 - } else {
198 - tableView.reloadRows(at: [indexPath], with: .automatic) // Reload the specific row
199 - }
200 -
201 - } else {
202 - self.smCouponsSelected.append(currentCoupon)
203 - if (self.smCouponsSelected.count == self.smCoupons.count) {
204 - isSelectAllActive = true
205 - // Reload the SM Coupons section only
206 - tableView.reloadSections(IndexSet(integer: 1), with: .automatic)
207 -
208 - } else {
209 - tableView.reloadRows(at: [indexPath], with: .automatic) // Reload the specific row
210 - }
211 - }
212 - handleSubmitButtonUI()
213 - }
214 -
215 - private func presentInfoPopup() {
216 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
217 - if let popupVC = storyboard.instantiateViewController(withIdentifier: "PopupInfoViewController") as? SwiftWarplyFramework.PopupInfoViewController {
218 - popupVC.modalPresentationStyle = .overCurrentContext
219 - popupVC.modalTransitionStyle = .crossDissolve
220 - self.present(popupVC, animated: true, completion: nil)
221 - }
222 - }
223 -
224 - func handleSubmitButtonUI() {
225 - if (self.smCouponsSelected.count > 0) {
226 - submitButton.backgroundColor = UIColor(rgb: 0x0EA600)
227 - submitButton.isEnabled = true
228 -
229 - } else {
230 - submitButton.backgroundColor = UIColor(rgb: 0x9D9D9C)
231 - submitButton.isEnabled = false
232 - }
233 - }
234 -
235 - func handleSubmitButtonVisible() {
236 - if (self.smCoupons.count > 0) {
237 - submitButton.isHidden = false
238 - submitButtonHeight.constant = 55
239 -
240 - } else {
241 - submitButton.isEnabled = false
242 - submitButton.isHidden = true
243 - submitButtonHeight.constant = 0
244 - }
245 - }
246 -
247 - func showSuccessDialog() -> Void {
248 -
249 - let alert = UIAlertController(title: "Δημιουργία Κουπονιού", message: "Το ενιαίο κουπόνι σου δημιουργήθηκε επιτυχώς.", preferredStyle: .alert)
250 - alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
251 - switch action.style{
252 - case .default:
253 - print("default")
254 -// self.navigationController?.popViewController(animated: true)
255 - // self.dismiss(animated: true, completion: {})
256 -
257 - case .cancel:
258 - print("cancel")
259 -
260 - case .destructive:
261 - print("destructive")
262 -
263 - }
264 - }))
265 - self.present(alert, animated: true, completion: nil)
266 - }
267 -
268 - func showFailureDialog() -> Void {
269 -
270 - let alert = UIAlertController(title: "Αποτυχία Δημιουργίας Κουπονιού", message: "Το ενιαίο κουπόνι σου δεν δημιουργήθηκε. Προσπάθησε ξανά.", preferredStyle: .alert)
271 - alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
272 - switch action.style{
273 - case .default:
274 - print("default")
275 -
276 - case .cancel:
277 - print("cancel")
278 -
279 - case .destructive:
280 - print("destructive")
281 -
282 - }
283 - }))
284 - self.present(alert, animated: true, completion: nil)
285 - }
286 -
287 - // MARK: - Actions
288 - @IBAction func submitButtonAction(_ sender: Any) {
289 -// let smCouponsString = self.smCouponsSelected.map { $0.coupon ?? "" }.joined(separator: ",")
290 -// swiftApi().logTrackersEvent("click", ("UnifySMCoupons:" + (smCouponsString)))
291 - self.showSpinner()
292 - let smCouponCodes = self.smCouponsSelected.map { $0.coupon ?? "" }
293 - swiftApi().createUnifiedCouponAsync(couponCodes: smCouponCodes) { responseData in
294 - self.hideSpinner()
295 - if (responseData != nil) {
296 - DispatchQueue.main.async {
297 - if (responseData?.getStatus == 1) {
298 - self.smCouponsSelected = []
299 - self.circleImageView.image = UIImage(named: "circle_unchecked", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) // Unselected image
300 - self.handleSubmitButtonUI()
301 - // Reload the SM Coupons section only
302 - self.tableView.reloadSections(IndexSet(integer: 1), with: .automatic)
303 -
304 - self.showSuccessDialog()
305 - }
306 -
307 - }
308 - }
309 - } failureCallback: { errorCode in
310 - self.hideSpinner()
311 - self.showFailureDialog()
312 - }
313 -
314 - }
315 -}
316 -
317 -// MARK: - TableView
318 -extension UnifiedCouponsViewController: UITableViewDelegate, UITableViewDataSource{
319 -
320 - public func numberOfSections(in tableView: UITableView) -> Int {
321 - return 2
322 - }
323 -
324 - public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
325 - if (section == 0) {
326 - return self.unifiedCoupons.count
327 - } else if (section == 1) {
328 - return self.smCoupons.count
329 - } else {
330 - return 0
331 - }
332 - }
333 -
334 - public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
335 - if (indexPath.section == 0) {
336 - return 130.0 + 8.0
337 - // return UITableViewAutomaticDimension
338 - } else if (indexPath.section == 1) {
339 - return 130.0 + 8.0
340 - } else {
341 - return 0.0
342 - }
343 - }
344 -
345 - public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
346 - if (indexPath.section == 0) {
347 - let cell = tableView.dequeueReusableCell(withIdentifier: "UnifiedCouponsTableViewCellId", for: indexPath) as! UnifiedCouponsTableViewCell
348 - cell.configureCell(coupon: unifiedCoupons[indexPath.row])
349 - return cell
350 -
351 - } else {
352 - let currentCoupon = self.smCoupons[indexPath.row]
353 - let isCouponSelected = self.smCouponsSelected.contains { $0.coupon == currentCoupon.coupon }
354 -
355 - let cell = tableView.dequeueReusableCell(withIdentifier: "CouponsTableViewCellId", for: indexPath) as! CouponsTableViewCell
356 - cell.configureCell(coupon: smCoupons[indexPath.row], isSMCoupon: true)
357 - cell.showSelectButton(isSelectViewVisible: true, isSelected: isCouponSelected) {
358 - self.handleSelectCouponAction(indexPath: indexPath)
359 - }
360 - return cell
361 - }
362 - }
363 -
364 - public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
365 - if (indexPath.section == 0) {
366 - let couponBarcode = unifiedCoupons[indexPath.row]._barcode
367 - swiftApi().logTrackersEvent("click", ("UnifiedCoupon:" + couponBarcode))
368 -
369 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
370 - let vc = storyboard.instantiateViewController(withIdentifier: "UnifiedCouponBarcodeViewController") as! SwiftWarplyFramework.UnifiedCouponBarcodeViewController
371 - vc.coupon = unifiedCoupons[indexPath.row]
372 - vc.isFromWallet = true
373 - self.navigationController?.pushViewController(vc, animated: true)
374 -
375 - } else if (indexPath.section == 1) {
376 - let couponSetData: swiftApi.CouponSetItemModel? = smCoupons[indexPath.row].couponset_data
377 - let couponName = couponSetData?.name ?? ""
378 - swiftApi().logTrackersEvent("click", ("Coupon:" + couponName))
379 -
380 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
381 - let vc = storyboard.instantiateViewController(withIdentifier: "CouponBarcodeViewController") as! SwiftWarplyFramework.CouponBarcodeViewController
382 - vc.coupon = smCoupons[indexPath.row]
383 - vc.isFromWallet = true
384 - vc.isSMCoupon = true
385 - self.navigationController?.pushViewController(vc, animated: true)
386 -
387 - } else {
388 - // Do nothing
389 - }
390 - }
391 -
392 - public func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
393 - if (section == 0) {
394 - if (self.unifiedCoupons.count > 0) {
395 - let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 70))
396 - view.backgroundColor = .clear
397 -
398 - let titleLabel = UILabel(frame: CGRect(x: 16, y: 25, width: view.frame.width - 32, height: 25))
399 - titleLabel.font = UIFont(name: "BTCosmo-Bold", size: 17)
400 -// titleLabel.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
401 - titleLabel.textColor = UIColor(rgb: 0x212121)
402 - titleLabel.text = "Ενιαία κουπόνια"
403 -
404 - view.addSubview(titleLabel)
405 - return view
406 - } else {
407 - return nil
408 - }
409 -
410 - } else if (section == 1) {
411 - if (self.smCoupons.count > 0) {
412 - let headerView = UIView()
413 - headerView.backgroundColor = .clear
414 -
415 - // Create the title label (Κουπόνια)
416 - let titleLabel = UILabel()
417 - titleLabel.text = "Κουπόνια"
418 - titleLabel.font = UIFont(name: "BTCosmo-Bold", size: 17)
419 -
420 - // Create the select-all label (Επιλογή όλων)
421 - let selectAllLabel = UILabel()
422 - selectAllLabel.text = "Επιλογή όλων"
423 - selectAllLabel.font = UIFont(name: "PeridotPE-SBold", size: 17)
424 -
425 - // Create a UIImageView for the circle image
426 - circleImageView = UIImageView()
427 -// let circleImage = UIImage(named: "circle_unchecked", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
428 -
429 - // Update the image based on the new state
430 - if (isSelectAllActive) {
431 - circleImageView.image = UIImage(named: "circle_checked", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) // Selected image
432 - } else {
433 - circleImageView.image = UIImage(named: "circle_unchecked", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) // Unselected image
434 - }
435 -// circleImageView.image = circleImage
436 - circleImageView.contentMode = .scaleAspectFit
437 - circleImageView.translatesAutoresizingMaskIntoConstraints = false
438 -
439 - // Set size for the imageView
440 - circleImageView.widthAnchor.constraint(equalToConstant: 30).isActive = true
441 - circleImageView.heightAnchor.constraint(equalToConstant: 30).isActive = true
442 -
443 - // Create a transparent UIButton on top of the image
444 - let selectAllButton = UIButton(type: .custom)
445 - selectAllButton.backgroundColor = .clear // Keep it transparent
446 - selectAllButton.addTarget(self, action: #selector(selectAllTapped), for: .touchUpInside)
447 - selectAllButton.translatesAutoresizingMaskIntoConstraints = false
448 -
449 - // Set the button size to match the image size
450 - selectAllButton.widthAnchor.constraint(equalToConstant: 30).isActive = true
451 - selectAllButton.heightAnchor.constraint(equalToConstant: 30).isActive = true
452 -
453 - // Create a horizontal stack view to align the title, label, and image
454 - let mainStackView = UIStackView(arrangedSubviews: [titleLabel, selectAllLabel, circleImageView])
455 - mainStackView.axis = .horizontal
456 - mainStackView.alignment = .center // Centers them vertically
457 - mainStackView.spacing = 10
458 -
459 - // Add the stack view to the header view
460 - headerView.addSubview(mainStackView)
461 - headerView.addSubview(selectAllButton) // Add the button separately on top of the image view
462 -
463 - // Set constraints for stack view
464 - mainStackView.translatesAutoresizingMaskIntoConstraints = false
465 - mainStackView.leadingAnchor.constraint(equalTo: headerView.leadingAnchor, constant: 16).isActive = true
466 - mainStackView.trailingAnchor.constraint(equalTo: headerView.trailingAnchor, constant: -16).isActive = true
467 - mainStackView.topAnchor.constraint(equalTo: headerView.topAnchor, constant: 8).isActive = true
468 - mainStackView.bottomAnchor.constraint(equalTo: headerView.bottomAnchor, constant: -8).isActive = true
469 -
470 - // Set button position on top of the imageView
471 - selectAllButton.centerXAnchor.constraint(equalTo: circleImageView.centerXAnchor).isActive = true
472 - selectAllButton.centerYAnchor.constraint(equalTo: circleImageView.centerYAnchor).isActive = true
473 -
474 - return headerView
475 -
476 - } else {
477 - return nil
478 - }
479 -
480 - } else {
481 - return nil
482 - }
483 - }
484 -
485 - public func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
486 - if (section == 0) {
487 - if (self.unifiedCoupons.count > 0) {
488 - return 70.0
489 - } else {
490 - return 0.0
491 - }
492 -
493 - } else if (section == 1) {
494 - if (self.smCoupons.count > 0) {
495 - return 70.0
496 - } else {
497 - return 0.0
498 - }
499 -
500 - } else {
501 - return 0.0
502 - }
503 - }
504 -
505 - public func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
506 -// return CGFloat.leastNormalMagnitude
507 - return 0.0
508 - }
509 -
510 - public func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
511 - return nil
512 - }
513 -
514 -}
1 -//
2 -// WalletActiveCouponCollectionViewCell.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 8/5/24.
6 -//
7 -
8 -import UIKit
9 -
10 -@objc public class WalletActiveCouponCollectionViewCell: UICollectionViewCell {
11 - @IBOutlet weak var badgeViewParent: UIView!
12 - @IBOutlet weak var badgeView: UIView!
13 - @IBOutlet weak var badgeImage: UIImageView!
14 - @IBOutlet weak var badgeLabel: UILabel!
15 - @IBOutlet weak var badgeCountView: UIView!
16 - @IBOutlet weak var badgeCountLabel: UILabel!
17 -
18 - public override func awakeFromNib() {
19 - super.awakeFromNib()
20 -
21 - // Badge Banner
22 -// badgeViewParent.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1.00)
23 - badgeViewParent.backgroundColor = .white
24 - badgeViewParent.layer.cornerRadius = 16.0
25 - badgeViewParent.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
26 - badgeViewParent.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
27 - badgeViewParent.layer.shadowOpacity = 1.0
28 - badgeViewParent.layer.shadowRadius = 2.0
29 -
30 -// badgeView.backgroundColor = UIColor(red: 0.46, green: 0.75, blue: 0.45, alpha: 0.05)
31 - badgeView.backgroundColor = .white
32 - badgeView.layer.cornerRadius = 16.0
33 -
34 - badgeCountView.layer.cornerRadius = 4.0
35 - badgeCountView.backgroundColor = UIColor(red: 0.92, green: 0.75, blue: 0.41, alpha: 1.00)
36 - }
37 -
38 - func configureCell(badgeId: String, badgeCount: Int) {
39 - if (badgeId == "dfy") {
40 - badgeImage.image = UIImage(named: "wallet_banner_dfy", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
41 - badgeLabel.text = "DEALS FOR YOU"
42 - badgeCountView.isHidden = false
43 -
44 - } else if (badgeId == "sm") {
45 - badgeImage.image = UIImage(named: "wallet_banner_sm", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
46 - badgeLabel.text = "SUPERMARKET DEALS"
47 - badgeCountView.isHidden = false
48 -
49 - } else if (badgeId == "gfy") {
50 - badgeImage.image = UIImage(named: "wallet_banner_gfy", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
51 - badgeLabel.text = "FREE COUPONS"
52 - badgeCountView.isHidden = false
53 -
54 - } else if (badgeId == "box") {
55 - badgeImage.image = UIImage(named: "wallet_banner_box", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
56 - badgeLabel.text = "BOX"
57 - badgeCountView.isHidden = true
58 - }
59 -
60 - badgeCountLabel.text = String(badgeCount)
61 - }
62 -}
1 -//
2 -// WalletActiveCouponsScrollTableViewCell.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 8/5/24.
6 -//
7 -
8 -import UIKit
9 -import SwiftEventBus
10 -
11 -@objc public class WalletActiveCouponsScrollTableViewCell: UITableViewCell {
12 - @IBOutlet weak var sectionTitleLabel: UILabel!
13 - @IBOutlet weak var historyButtonImage: UIImageView!
14 -
15 - @IBOutlet weak var collectionView: UICollectionView!
16 - @IBOutlet weak var dotLeft: UIView!
17 - @IBOutlet weak var dotLeftWidth: NSLayoutConstraint!
18 - @IBOutlet weak var dotLeftHeight: NSLayoutConstraint!
19 - @IBOutlet weak var dotRight: UIView!
20 - @IBOutlet weak var dotRightWidth: NSLayoutConstraint!
21 - @IBOutlet weak var dotRightHeight: NSLayoutConstraint!
22 -
23 - var parent: UIViewController?
24 - public var activeCouponBadges:Array<swiftApi.WalletActiveCouponBadgeModel> = []
25 -
26 - public override func awakeFromNib() {
27 - super.awakeFromNib()
28 - // Initialization code
29 -
30 - // Section Header
31 - sectionTitleLabel.text = "Κουπόνια"
32 - historyButtonImage.image = UIImage(named: "wallet_history_blue", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
33 - historyButtonImage.image = historyButtonImage.image?.withRenderingMode(.alwaysTemplate)
34 - historyButtonImage.tintColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
35 -
36 - collectionView.contentInset.left = 17
37 - collectionView.contentInset.right = 17
38 -
39 - dotLeftWidth.constant = 12
40 - dotLeftHeight.constant = 12
41 - dotLeft.layer.cornerRadius = 6
42 -
43 - dotRightWidth.constant = 8
44 - dotRightHeight.constant = 8
45 - dotRight.layer.cornerRadius = 4
46 -
47 - }
48 -
49 - public override func setSelected(_ selected: Bool, animated: Bool) {
50 - super.setSelected(selected, animated: animated)
51 -
52 - // Configure the view for the selected state
53 - }
54 -
55 - func configureCell(dfyCount: Int, smCount: Int, gfyCount: Int, boxCount: Int) {
56 - sortBadges(dfyCount, smCount, gfyCount, boxCount)
57 - }
58 -
59 - func sortBadges(_ dfyCount: Int, _ smCount: Int, _ gfyCount: Int, _ boxCount: Int) {
60 -// deals weight 3
61 -// sm weight 2
62 -// free weight 1
63 -// box weight 0
64 -
65 - let DFYBadge = swiftApi.WalletActiveCouponBadgeModel()
66 - DFYBadge._id = "dfy"
67 - DFYBadge._count = dfyCount
68 - DFYBadge._weight = 3
69 -
70 - let SMBadge = swiftApi.WalletActiveCouponBadgeModel()
71 - SMBadge._id = "sm"
72 - SMBadge._count = smCount
73 - SMBadge._weight = 2
74 -
75 - let GFYBadge = swiftApi.WalletActiveCouponBadgeModel()
76 - GFYBadge._id = "gfy"
77 - GFYBadge._count = gfyCount
78 - GFYBadge._weight = 1
79 -
80 - let BOXBadge = swiftApi.WalletActiveCouponBadgeModel()
81 - BOXBadge._id = "box"
82 - BOXBadge._count = boxCount
83 - BOXBadge._weight = 0
84 -
85 - let tempActiveCouponBadges:Array<swiftApi.WalletActiveCouponBadgeModel> = [DFYBadge, SMBadge, GFYBadge, BOXBadge]
86 -// var tempActiveCouponBadges:Array<swiftApi.WalletActiveCouponBadgeModel> = []
87 -// tempActiveCouponBadges.append(DFYBadge)
88 -// tempActiveCouponBadges.append(SMBadge)
89 -// tempActiveCouponBadges.append(GFYBadge)
90 -// tempActiveCouponBadges.append(BOXBadge)
91 -
92 - let sortedActiveCouponBadges = tempActiveCouponBadges.sorted {
93 - ($0._weight) > ($1._weight)
94 - }
95 - .sorted {
96 - ($0._count) > ($1._count)
97 - }
98 -
99 - activeCouponBadges = sortedActiveCouponBadges
100 -
101 - collectionView.reloadData();
102 -
103 - }
104 -
105 -}
106 -
107 -extension WalletActiveCouponsScrollTableViewCell: UIScrollViewDelegate {
108 -
109 - public func scrollViewDidScroll(_ scrollView: UIScrollView) {
110 - let contentOffsetX = scrollView.contentOffset.x
111 - if contentOffsetX >= (scrollView.contentSize.width - scrollView.bounds.width) - 20 {
112 -
113 - dotLeftWidth.constant = 8
114 - dotLeftHeight.constant = 8
115 - dotLeft.layer.cornerRadius = 4
116 -
117 - dotRightWidth.constant = 12
118 - dotRightHeight.constant = 12
119 - dotRight.layer.cornerRadius = 6
120 -
121 - } else {
122 - dotLeftWidth.constant = 12
123 - dotLeftHeight.constant = 12
124 - dotLeft.layer.cornerRadius = 6
125 -
126 - dotRightWidth.constant = 8
127 - dotRightHeight.constant = 8
128 - dotRight.layer.cornerRadius = 4
129 - }
130 -
131 - }
132 -}
133 -
134 -extension WalletActiveCouponsScrollTableViewCell: UICollectionViewDataSource,UICollectionViewDelegate {
135 - public func numberOfSections(in collectionView: UICollectionView) -> Int {
136 - return 1
137 - }
138 -
139 - public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
140 - return activeCouponBadges.count
141 - }
142 -
143 - public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
144 - let badgeId = activeCouponBadges[indexPath.row]._id;
145 - let badgeCount = activeCouponBadges[indexPath.row]._count;
146 - let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "WalletActiveCouponCollectionViewCellId", for: indexPath) as! WalletActiveCouponCollectionViewCell
147 - cell.configureCell(badgeId: badgeId, badgeCount: badgeCount)
148 - return cell;
149 - }
150 -
151 - public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
152 -
153 - let badgeId = activeCouponBadges[indexPath.row]._id
154 -
155 - if (badgeId == "dfy") {
156 - print("Active DFY coupon banner Tapped!")
157 -
158 - swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "ActiveDealsBanner"))
159 -
160 - let couponDetails = swiftApi.ActiveDFYCouponEventModel()
161 - couponDetails._isPressed = true
162 - SwiftEventBus.post("dfy_coupon_details", sender: couponDetails)
163 -
164 - } else if (badgeId == "sm") {
165 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
166 - firebaseEvent._eventName = "did_tap_market_active_badge"
167 - firebaseEvent.setParameter = ("screen", "Loyalty Wallet")
168 - SwiftEventBus.post("firebase", sender: firebaseEvent)
169 -
170 - swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "ActiveMarketBanner"))
171 -
172 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
173 - // let vc = storyboard.instantiateViewController(withIdentifier: "UnifiedCouponsViewController") as! SwiftWarplyFramework.UnifiedCouponsViewController
174 - let vc = storyboard.instantiateViewController(withIdentifier: "MarketPassViewController") as! SwiftWarplyFramework.MarketPassViewController
175 - parent?.navigationController?.pushViewController(vc, animated: true)
176 -
177 - } else if (badgeId == "gfy") {
178 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
179 - firebaseEvent._eventName = "did_tap_gifts_for_you_active_badge"
180 - firebaseEvent.setParameter = ("screen", "Loyalty Wallet")
181 - SwiftEventBus.post("firebase", sender: firebaseEvent)
182 -
183 - swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "ActiveLoyaltyBanner"))
184 -
185 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: SwiftWarplyFramework.CouponsViewController.self))
186 - if let vc = storyboard.instantiateViewController(withIdentifier: "CouponsViewController") as? SwiftWarplyFramework.CouponsViewController{
187 - parent?.navigationController?.pushViewController(vc,animated: true)
188 - }
189 -
190 - } else if (badgeId == "box") {
191 - print("Active BOX coupon banner Tapped!")
192 -
193 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
194 - firebaseEvent._eventName = "did_tap_box_active_badge"
195 - firebaseEvent.setParameter = ("screen", "Loyalty Wallet")
196 - SwiftEventBus.post("firebase", sender: firebaseEvent)
197 -
198 - swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "ActiveBoxBanner"))
199 -
200 -// SwiftEventBus.post("box_coupon_details")
201 -
202 - let couponDetails = swiftApi.ActiveBoxCouponEventModel()
203 - couponDetails._isPressed = true
204 - SwiftEventBus.post("box_coupon_details", sender: couponDetails)
205 -
206 - }
207 - }
208 -
209 - // Distance Between Item Cells
210 - func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
211 - return 5
212 - }
213 -
214 - // Cell Margin
215 - func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
216 - return UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0)
217 - }
218 -
219 -}
1 -//
2 -// WalletActiveCouponsTableViewCell.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 23/10/23.
6 -//
7 -
8 -import UIKit
9 -
10 -@objc public class WalletActiveCouponsTableViewCell: UITableViewCell {
11 - @IBOutlet weak var sectionTitleLabel: UILabel!
12 - @IBOutlet weak var historyButtonImage: UIImageView!
13 -
14 - @IBOutlet weak var dfyViewParent: UIView!
15 - @IBOutlet weak var dfyView: UIView!
16 - @IBOutlet weak var dfyImage: UIImageView!
17 - @IBOutlet weak var dfyLabel: UILabel!
18 - @IBOutlet weak var dfyCountView: UIView!
19 - @IBOutlet weak var dfyCountLabel: UILabel!
20 -
21 - @IBOutlet weak var smView: UIView!
22 - @IBOutlet weak var smImage: UIImageView!
23 - @IBOutlet weak var smLabel: UILabel!
24 - @IBOutlet weak var smCountView: UIView!
25 - @IBOutlet weak var smCountLabel: UILabel!
26 -
27 - @IBOutlet weak var gfyView: UIView!
28 - @IBOutlet weak var gfyImage: UIImageView!
29 - @IBOutlet weak var gfyLabel: UILabel!
30 - @IBOutlet weak var gfyCountView: UIView!
31 - @IBOutlet weak var gfyCountLabel: UILabel!
32 -
33 -
34 - public override func awakeFromNib() {
35 - super.awakeFromNib()
36 - // Initialization code
37 -
38 - // Section Header
39 - sectionTitleLabel.text = "Κουπόνια"
40 - historyButtonImage.image = UIImage(named: "wallet_history_blue", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
41 - historyButtonImage.image = historyButtonImage.image?.withRenderingMode(.alwaysTemplate)
42 - historyButtonImage.tintColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
43 -
44 - // DFY Banner
45 -// dfyViewParent.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1.00)
46 - dfyViewParent.backgroundColor = .white
47 - dfyViewParent.layer.cornerRadius = 16.0
48 - dfyViewParent.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
49 - dfyViewParent.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
50 - dfyViewParent.layer.shadowOpacity = 1.0
51 - dfyViewParent.layer.shadowRadius = 2.0
52 -
53 -// dfyView.backgroundColor = UIColor(red: 0.46, green: 0.75, blue: 0.45, alpha: 0.05)
54 - dfyView.backgroundColor = .white
55 - dfyView.layer.cornerRadius = 16.0
56 -
57 - dfyImage.image = UIImage(named: "wallet_banner_dfy", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
58 -
59 - dfyLabel.text = "DEALS FOR YOU"
60 -
61 - dfyCountView.layer.cornerRadius = 4.0
62 - dfyCountView.backgroundColor = UIColor(red: 0.92, green: 0.75, blue: 0.41, alpha: 1.00)
63 -
64 - // SM Banner
65 -// smView.backgroundColor = UIColor(red: 1.00, green: 0.99, blue: 0.97, alpha: 1.00)
66 - smView.backgroundColor = .white
67 - smView.layer.cornerRadius = 16.0
68 - smView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
69 - smView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
70 - smView.layer.shadowOpacity = 1.0
71 - smView.layer.shadowRadius = 2.0
72 -
73 - smImage.image = UIImage(named: "wallet_banner_sm", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
74 -
75 - smLabel.text = "SUPERMARKET DEALS"
76 -
77 - smCountView.layer.cornerRadius = 4.0
78 - smCountView.backgroundColor = UIColor(red: 0.92, green: 0.75, blue: 0.41, alpha: 1.00)
79 -
80 - // GFY Banner
81 -// gfyView.backgroundColor = UIColor(red: 0.96, green: 0.97, blue: 0.98, alpha: 1.00)
82 - gfyView.backgroundColor = .white
83 - gfyView.layer.cornerRadius = 16.0
84 - gfyView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
85 - gfyView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
86 - gfyView.layer.shadowOpacity = 1.0
87 - gfyView.layer.shadowRadius = 2.0
88 -
89 - gfyImage.image = UIImage(named: "wallet_banner_gfy", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
90 -
91 -// gfyLabel.text = "GIFTS FOR YOU"
92 -// gfyLabel.text = "Free coupons"
93 - gfyLabel.text = "FREE COUPONS"
94 -
95 - gfyCountView.layer.cornerRadius = 4.0
96 - gfyCountView.backgroundColor = UIColor(red: 0.92, green: 0.75, blue: 0.41, alpha: 1.00)
97 - }
98 -
99 - public override func setSelected(_ selected: Bool, animated: Bool) {
100 - super.setSelected(selected, animated: animated)
101 -
102 - // Configure the view for the selected state
103 - }
104 -
105 - func configureCell(dfyCount: Int, smCount: Int, gfyCount: Int) {
106 - dfyCountLabel.text = String(dfyCount)
107 - smCountLabel.text = String(smCount)
108 - gfyCountLabel.text = String(gfyCount)
109 - }
110 -
111 -}
1 -//
2 -// WalletBadgesTableViewCell.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 5/4/23.
6 -//
7 -
8 -import UIKit
9 -
10 -@objc public class WalletBadgesTableViewCell: UITableViewCell {
11 - @IBOutlet weak var rewardsLabel: UILabel!
12 - @IBOutlet weak var badgeLinesImage: UIImageView!
13 - @IBOutlet weak var sumBadgeImage: UIImageView!
14 - @IBOutlet weak var sumBadgeLabel: UILabel!
15 - @IBOutlet weak var dfyBadgeImage: UIImageView!
16 - @IBOutlet weak var dfyBadgeLabel: UILabel!
17 - @IBOutlet weak var couponBadgeImage: UIImageView!
18 - @IBOutlet weak var couponBadgeLabel: UILabel!
19 - @IBOutlet weak var marketBadgeImage: UIImageView!
20 - @IBOutlet weak var marketBadgeLabel: UILabel!
21 -
22 - public var loyaltyBadge:swiftApi.LoyaltyBadgeModel = swiftApi().getLoyaltyBadge()
23 -
24 - public override func awakeFromNib() {
25 - super.awakeFromNib()
26 - // Initialization code
27 -
28 - sumBadgeImage.image = UIImage(named: "wallet_summary", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
29 - badgeLinesImage.image = UIImage(named: "wallet_badge_lines", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
30 -
31 - rewardsLabel.text = "COSMOTE Επιβράβευση"
32 - }
33 -
34 - public override func setSelected(_ selected: Bool, animated: Bool) {
35 - super.setSelected(selected, animated: animated)
36 -
37 - // Configure the view for the selected state
38 - }
39 -
40 - func configureCell(totalCouponValue: Float, totalCouponDiscount: Float, unifiedCouponsDiscount: Float) {
41 -
42 - let sumRewards = totalCouponValue + totalCouponDiscount + unifiedCouponsDiscount
43 -// sumRewards = Float(round(100 * sumRewards) / 100)
44 - var sumRewardsString = "0"
45 - sumRewardsString = String(format: "%.2f", sumRewards).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
46 - sumBadgeLabel.text = sumRewardsString + "€"
47 -
48 - // ===
49 -
50 - if (totalCouponValue == 0.0) {
51 - dfyBadgeImage.image = UIImage(named: "wallet_dfy_empty", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
52 - dfyBadgeLabel.isHidden = true
53 -
54 - } else {
55 - dfyBadgeImage.image = UIImage(named: "wallet_dfy_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
56 - dfyBadgeLabel.isHidden = false
57 - }
58 -
59 - let totalCouponValueFixed = Float(round(100 * totalCouponValue) / 100)
60 - var totalCouponValueString = "0"
61 - totalCouponValueString = String(format: "%.2f", totalCouponValueFixed).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
62 - dfyBadgeLabel.text = totalCouponValueString + "€"
63 -
64 - // ===
65 -
66 - if (loyaltyBadge._couponCount == 0) {
67 - couponBadgeImage.image = UIImage(named: "wallet_coupons_empty", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
68 - couponBadgeLabel.isHidden = true
69 - } else {
70 - couponBadgeImage.image = UIImage(named: "wallet_coupons_3", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
71 - couponBadgeLabel.isHidden = false
72 - }
73 -
74 - var totalCouponDiscountString = "0"
75 - totalCouponDiscountString = String(format: "%.2f", totalCouponDiscount).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
76 - couponBadgeLabel.text = totalCouponDiscountString + "€"
77 -
78 - // ===
79 -
80 - let marketDiscount = Float(round(100 * unifiedCouponsDiscount) / 100)
81 - var marketDiscountString = "0"
82 - marketDiscountString = String(format: "%.2f", marketDiscount).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
83 -
84 - self.marketBadgeLabel.text = marketDiscountString + "€"
85 -
86 - if (unifiedCouponsDiscount == 0.0) {
87 - marketBadgeImage.image = UIImage(named: "wallet_market_empty", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
88 - marketBadgeLabel.isHidden = true
89 -
90 - } else {
91 - marketBadgeImage.image = UIImage(named: "wallet_market", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
92 - marketBadgeLabel.isHidden = false
93 - }
94 -
95 - }
96 -
97 -}
1 -//
2 -// WalletBannersTableViewCell.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 24/4/23.
6 -//
7 -
8 -import UIKit
9 -
10 -@objc public class WalletBannersTableViewCell: UITableViewCell {
11 -
12 - @IBOutlet weak var sumBannerArrowImage: UIImageView!
13 - @IBOutlet weak var sumBannerInnerView: UIView!
14 - @IBOutlet weak var sumBadgeImage: UIImageView!
15 - @IBOutlet weak var sumBadgeLabel: UILabel!
16 - @IBOutlet weak var sumBannerLabel: UILabel!
17 -
18 - @IBOutlet weak var dfyBannerView: UIView!
19 - @IBOutlet weak var dfyBannerHeight: NSLayoutConstraint!
20 - @IBOutlet weak var dfyBannerTopSpace: NSLayoutConstraint!
21 - @IBOutlet weak var dfyBannerInnerView: UIView!
22 - @IBOutlet weak var dfyBadgeImage: UIImageView!
23 - @IBOutlet weak var dfyBadgeLabel: UILabel!
24 - @IBOutlet weak var dfyBannerLabel: UILabel!
25 -
26 - @IBOutlet weak var gfyBannerView: UIView!
27 - @IBOutlet weak var gfyBannerHeight: NSLayoutConstraint!
28 - @IBOutlet weak var gfyBannerTopSpace: NSLayoutConstraint!
29 - @IBOutlet weak var gfyBannerInnerView: UIView!
30 - @IBOutlet weak var couponBadgeImage: UIImageView!
31 - @IBOutlet weak var couponBadgeLabel: UILabel!
32 - @IBOutlet weak var gfyBannerLabel: UILabel!
33 -
34 - @IBOutlet weak var marketBannerView: UIView!
35 - @IBOutlet weak var marketBannerHeight: NSLayoutConstraint!
36 - @IBOutlet weak var marketBannerTopSpace: NSLayoutConstraint!
37 - @IBOutlet weak var marketBannerInnerView: UIView!
38 - @IBOutlet weak var marketBadgeImage: UIImageView!
39 - @IBOutlet weak var marketBadgeLabel: UILabel!
40 - @IBOutlet weak var marketBannerLabel: UILabel!
41 -
42 - public var loyaltyBadge:swiftApi.LoyaltyBadgeModel = swiftApi().getLoyaltyBadge()
43 -
44 - public override func awakeFromNib() {
45 - super.awakeFromNib()
46 - // Initialization code
47 -
48 - sumBadgeImage.image = UIImage(named: "wallet_summary_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
49 - dfyBadgeImage.image = UIImage(named: "wallet_dfy_3", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
50 - couponBadgeImage.image = UIImage(named: "wallet_coupons_4", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
51 - marketBadgeImage.image = UIImage(named: "wallet_market_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
52 -
53 - sumBannerInnerView.layer.cornerRadius = 16.5
54 - // sumBannerInnerView.layer.borderWidth = 1
55 - // sumBannerInnerView.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor
56 -
57 - dfyBannerInnerView.layer.cornerRadius = 16.5
58 - // dfyBannerInnerView.layer.borderWidth = 1
59 - // dfyBannerInnerView.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor
60 -
61 - gfyBannerInnerView.layer.cornerRadius = 16.5
62 - // gfyBannerInnerView.layer.borderWidth = 1
63 - // gfyBannerInnerView.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor
64 -
65 - marketBannerInnerView.layer.cornerRadius = 16.5
66 - // marketBannerInnerView.layer.borderWidth = 1
67 - // marketBannerInnerView.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor
68 -
69 - // Add shadow
70 - sumBannerInnerView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
71 - sumBannerInnerView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
72 - sumBannerInnerView.layer.shadowOpacity = 1.0
73 - sumBannerInnerView.layer.shadowRadius = 1.0
74 -
75 - dfyBannerInnerView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
76 - dfyBannerInnerView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
77 - dfyBannerInnerView.layer.shadowOpacity = 1.0
78 - dfyBannerInnerView.layer.shadowRadius = 1.0
79 -
80 - gfyBannerInnerView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
81 - gfyBannerInnerView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
82 - gfyBannerInnerView.layer.shadowOpacity = 1.0
83 - gfyBannerInnerView.layer.shadowRadius = 1.0
84 -
85 - marketBannerInnerView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
86 - marketBannerInnerView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
87 - marketBannerInnerView.layer.shadowOpacity = 1.0
88 - marketBannerInnerView.layer.shadowRadius = 1.0
89 -
90 - dfyBannerView.isHidden = true
91 - dfyBannerHeight.constant = 0.0
92 - dfyBannerTopSpace.constant = 0.0
93 -
94 - gfyBannerView.isHidden = true
95 - gfyBannerHeight.constant = 0.0
96 - gfyBannerTopSpace.constant = 0.0
97 -
98 - marketBannerView.isHidden = true
99 - marketBannerHeight.constant = 0.0
100 - marketBannerTopSpace.constant = 0.0
101 -
102 - }
103 -
104 - public override func setSelected(_ selected: Bool, animated: Bool) {
105 - super.setSelected(selected, animated: animated)
106 -
107 - // Configure the view for the selected state
108 - }
109 -
110 -// public override func layoutSubviews() {
111 -// super.layoutSubviews()
112 -// //set the values for top,left,bottom,right margins
113 -// let margins = UIEdgeInsets(top: 0, left: 0, bottom: 4, right: 0)
114 -// contentView.frame = contentView.frame.inset(by: margins)
115 -// }
116 -
117 - func configureCell(totalCouponValue: Float, totalCouponDiscount: Float, unifiedCouponsDiscount: Float, forYouExpanded: Bool) {
118 -
119 - loyaltyBadge = swiftApi().getLoyaltyBadge()
120 -
121 - if (forYouExpanded == false) {
122 - sumBannerArrowImage.image = UIImage(named: "ic_down_dark_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
123 -
124 - dfyBannerView.isHidden = true
125 - dfyBannerHeight.constant = 0.0
126 - dfyBannerTopSpace.constant = 0.0
127 -
128 - gfyBannerView.isHidden = true
129 - gfyBannerHeight.constant = 0.0
130 - gfyBannerTopSpace.constant = 0.0
131 -
132 - marketBannerView.isHidden = true
133 - marketBannerHeight.constant = 0.0
134 - marketBannerTopSpace.constant = 0.0
135 -
136 - } else {
137 - sumBannerArrowImage.image = UIImage(named: "ic_up_dark_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
138 -
139 - dfyBannerView.isHidden = false
140 - dfyBannerHeight.constant = 80.0
141 - dfyBannerTopSpace.constant = 8.0
142 -
143 - gfyBannerView.isHidden = false
144 - gfyBannerHeight.constant = 80.0
145 - gfyBannerTopSpace.constant = 8.0
146 -
147 - marketBannerView.isHidden = false
148 - marketBannerHeight.constant = 80.0
149 - marketBannerTopSpace.constant = 8.0
150 - }
151 -
152 - if (totalCouponValue == 0.0 && loyaltyBadge._couponCount == 0 && unifiedCouponsDiscount == 0.0) {
153 - sumBannerArrowImage.isHidden = true
154 - } else {
155 - sumBannerArrowImage.isHidden = false
156 - }
157 -
158 - // ===
159 -
160 - let sumRewards = totalCouponValue + totalCouponDiscount + unifiedCouponsDiscount
161 -
162 -// if (sumRewards == 0.0) {
163 -// sumBannerArrowImage.isHidden = true
164 -// } else {
165 -// sumBannerArrowImage.isHidden = false
166 -// }
167 -
168 -// sumRewards = Float(round(100 * sumRewards) / 100)
169 - var sumRewardsString = "0"
170 - sumRewardsString = String(format: "%.2f", sumRewards).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
171 - sumBadgeLabel.text = sumRewardsString + "€"
172 -
173 - let sumRewardsIntCount = String(Int(sumRewards)).count
174 - if (sumRewardsIntCount >= 3) {
175 - sumBadgeLabel.font = UIFont(name: "PeridotPE-Bold", size: 11)
176 - } else {
177 - sumBadgeLabel.font = UIFont(name: "PeridotPE-Bold", size: 13)
178 - }
179 -
180 - let sumNormalText1 = "Μέχρι τώρα έχεις κερδίσει "
181 - let sumBoldText = sumRewardsString + "€"
182 - let sumNormalText2 = " στο For You!"
183 -
184 - let attrRegular = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-Regular", size: 14) ?? UIFont.systemFont(ofSize: 13), NSAttributedString.Key.foregroundColor: UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)]
185 - let attrBold = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-Bold", size: 14) ?? UIFont.boldSystemFont(ofSize: 13), NSAttributedString.Key.foregroundColor: UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)]
186 -
187 - let sumAttributedString = NSMutableAttributedString(string:sumNormalText1, attributes:attrRegular)
188 - let sumBoldString = NSMutableAttributedString(string: sumBoldText, attributes:attrBold)
189 - let sumNormalString = NSMutableAttributedString(string:sumNormalText2, attributes:attrRegular)
190 -
191 - sumAttributedString.append(sumBoldString)
192 - sumAttributedString.append(sumNormalString)
193 - sumBannerLabel.attributedText = sumAttributedString
194 -
195 - // ===
196 -
197 - let totalCouponValueFixed = Float(round(100 * totalCouponValue) / 100)
198 - var totalCouponValueString = "0"
199 - totalCouponValueString = String(format: "%.2f", totalCouponValueFixed).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
200 - dfyBadgeLabel.text = totalCouponValueString + "€"
201 -
202 -// let totalCouponValueIntCount = String(Int(totalCouponValueFixed)).count
203 -// if (totalCouponValueIntCount >= 3) {
204 -// dfyBadgeLabel.font = UIFont(name: "PeridotPE-Bold", size: 9)
205 -// } else {
206 -// dfyBadgeLabel.font = UIFont(name: "PeridotPE-Bold", size: 11)
207 -// }
208 -
209 - let dfyNormalText1 = "Έχεις κερδίσει "
210 - let dfyBoldText = totalCouponValueString + "€"
211 - let dfyNormalText2 = " με το DEALS for YOU!"
212 -
213 - let dfyAttributedString = NSMutableAttributedString(string:dfyNormalText1, attributes:attrRegular)
214 - let dfyBoldString = NSMutableAttributedString(string: dfyBoldText, attributes:attrBold)
215 - let dfyNormalString = NSMutableAttributedString(string:dfyNormalText2, attributes:attrRegular)
216 -
217 - dfyAttributedString.append(dfyBoldString)
218 - dfyAttributedString.append(dfyNormalString)
219 - dfyBannerLabel.attributedText = dfyAttributedString
220 -
221 - // ===
222 -
223 - var totalCouponDiscountString = "0"
224 - totalCouponDiscountString = String(format: "%.2f", totalCouponDiscount).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
225 - couponBadgeLabel.text = totalCouponDiscountString + "€"
226 -
227 - let gfyNormalText1 = "Έχεις κερδίσει "
228 - let gfyBoldText = totalCouponDiscountString + "€"
229 - let gfyNormalText2 = " με το GIFTS for YOU!"
230 -
231 - let gfyAttributedString = NSMutableAttributedString(string:gfyNormalText1, attributes:attrRegular)
232 - let gfyBoldString = NSMutableAttributedString(string: gfyBoldText, attributes:attrBold)
233 - let gfyNormalString = NSMutableAttributedString(string:gfyNormalText2, attributes:attrRegular)
234 -
235 - gfyAttributedString.append(gfyBoldString)
236 - gfyAttributedString.append(gfyNormalString)
237 - gfyBannerLabel.attributedText = gfyAttributedString
238 -
239 - // ===
240 -
241 - let marketDiscount = Float(round(100 * unifiedCouponsDiscount) / 100)
242 - var marketDiscountString = "0"
243 - marketDiscountString = String(format: "%.2f", marketDiscount).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
244 -
245 - self.marketBadgeLabel.text = marketDiscountString + "€"
246 -
247 - let marketNormalText1 = "Έχεις κερδίσει "
248 - let marketBoldText = marketDiscountString + "€"
249 - let marketNormalText2 = " με τα SUPERMARKET DEALS!"
250 -
251 - let marketAttributedString = NSMutableAttributedString(string:marketNormalText1, attributes:attrRegular)
252 - let marketBoldString = NSMutableAttributedString(string: marketBoldText, attributes:attrBold)
253 - let marketNormalString = NSMutableAttributedString(string:marketNormalText2, attributes:attrRegular)
254 -
255 - marketAttributedString.append(marketBoldString)
256 - marketAttributedString.append(marketNormalString)
257 - marketBannerLabel.attributedText = marketAttributedString
258 -
259 - }
260 -
261 -}
1 -//
2 -// WalletEmptyViewTableViewCell.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 27/2/24.
6 -//
7 -
8 -import UIKit
9 -
10 -@objc public class WalletEmptyViewTableViewCell: UITableViewCell {
11 - @IBOutlet weak var emptyImage: UIImageView!
12 - @IBOutlet weak var emptyLabel: UILabel!
13 -
14 - public override func awakeFromNib() {
15 - super.awakeFromNib()
16 - // Initialization code
17 -
18 - emptyImage.image = UIImage(named: "ic_empty_wallet_3", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
19 -// emptyLabel.text = "Δεν έχεις κάποιον ενεργό κωδικό ή κουπόνι! Μπες τώρα στην ενότητα COSMOTE For You και βρες αποκλειστικές προσφορές!"
20 - emptyLabel.text = "Δεν έχεις ενεργό κωδικό ή κουπόνι!\nΜπες τώρα στην ενότητα COSMOTE For You και βρες αποκλειστικές προσφορές"
21 -
22 - }
23 -
24 - public override func setSelected(_ selected: Bool, animated: Bool) {
25 - super.setSelected(selected, animated: animated)
26 -
27 - // Configure the view for the selected state
28 - }
29 -
30 -}
1 -//
2 -// WalletHistoryBannerTableViewCell.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 27/2/24.
6 -//
7 -
8 -import UIKit
9 -
10 -@objc public class WalletHistoryBannerTableViewCell: UITableViewCell {
11 - @IBOutlet weak var bannerView: UIView!
12 - @IBOutlet weak var bannerIconImage: UIImageView!
13 - @IBOutlet weak var bannerLabel: UILabel!
14 - @IBOutlet weak var bannerArrowImage: UIImageView!
15 -
16 - let language = swiftApi().getLanguage()
17 -
18 - public override func awakeFromNib() {
19 - super.awakeFromNib()
20 - // Initialization code
21 -
22 - bannerView.layer.cornerRadius = 16.0
23 - bannerView.layer.borderWidth = 1
24 - bannerView.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor
25 -
26 - // Add shadow
27 - bannerView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
28 - bannerView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
29 - bannerView.layer.shadowOpacity = 1.0
30 - bannerView.layer.shadowRadius = 1.0
31 -
32 - bannerIconImage.image = UIImage(named: "wallet_history_blue", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
33 - bannerArrowImage.image = UIImage(named: "arrow_right_black", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
34 -
35 - bannerLabel.text = "Δες το ιστορικό σου"
36 - }
37 -
38 - public override func setSelected(_ selected: Bool, animated: Bool) {
39 - super.setSelected(selected, animated: animated)
40 -
41 - // Configure the view for the selected state
42 - }
43 -
44 -}
1 -//
2 -// WalletQuestionnaireBannerTableViewCell.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 27/2/24.
6 -//
7 -
8 -import UIKit
9 -
10 -@objc public class WalletQuestionnaireBannerTableViewCell: UITableViewCell {
11 - @IBOutlet weak var bannerView: UIView!
12 - @IBOutlet weak var bannerIconImage: UIImageView!
13 - @IBOutlet weak var bannerIconImageWidth: NSLayoutConstraint!
14 - @IBOutlet weak var bannerLabel: UILabel!
15 - @IBOutlet weak var bannerLabelLeftSpace: NSLayoutConstraint!
16 -// @IBOutlet weak var bannerArrowImage: UIImageView!
17 -
18 - @IBOutlet weak var bannerCenteredView: UIView!
19 - @IBOutlet weak var bannerCenteredIconImage: UIImageView!
20 - @IBOutlet weak var bannerCenteredIconImageWidth: NSLayoutConstraint!
21 - @IBOutlet weak var bannerCenteredLabel: UILabel!
22 - @IBOutlet weak var bannerCenteredLabelLeftSpace: NSLayoutConstraint!
23 -
24 - public override func awakeFromNib() {
25 - super.awakeFromNib()
26 - // Initialization code
27 -
28 - bannerView.layer.cornerRadius = 12.0
29 - bannerView.layer.borderWidth = 1
30 - bannerView.layer.borderColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00).cgColor
31 -// bannerView.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor
32 -
33 - bannerCenteredView.layer.cornerRadius = 12.0
34 - bannerCenteredView.layer.borderWidth = 1
35 - bannerCenteredView.layer.borderColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00).cgColor
36 -
37 - // Add shadow
38 -// bannerView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
39 -// bannerView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
40 -// bannerView.layer.shadowOpacity = 1.0
41 -// bannerView.layer.shadowRadius = 1.0
42 -
43 - bannerIconImage.image = UIImage(named: "wallet_plus", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
44 - bannerCenteredIconImage.image = UIImage(named: "wallet_plus", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
45 -// bannerArrowImage.image = UIImage(named: "arrow_right_black", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
46 -
47 - bannerLabel.font = UIFont(name: "PeridotPE-Bold", size: 12)
48 - bannerCenteredLabel.font = UIFont(name: "PeridotPE-Bold", size: 12)
49 - }
50 -
51 - public override func setSelected(_ selected: Bool, animated: Bool) {
52 - super.setSelected(selected, animated: animated)
53 -
54 - // Configure the view for the selected state
55 - }
56 -
57 - func configureCell(isCentered: Bool) {
58 - let userTag = swiftApi().getUserTag()
59 -// print("User tag: " + userTag)
60 - if (userTag != "" && userTag != "undefined") {
61 - bannerLabel.text = userTag
62 - bannerLabel.frame.size.width = bannerLabel.intrinsicContentSize.width
63 - bannerIconImage.isHidden = true
64 - bannerIconImageWidth.constant = CGFloat(0.0)
65 - bannerLabelLeftSpace.constant = CGFloat(0.0)
66 - bannerView.frame.size.width = bannerView.intrinsicContentSize.width
67 -
68 - bannerCenteredLabel.text = userTag
69 - bannerCenteredLabel.frame.size.width = bannerCenteredLabel.intrinsicContentSize.width
70 - bannerCenteredIconImage.isHidden = true
71 - bannerCenteredIconImageWidth.constant = CGFloat(0.0)
72 - bannerCenteredLabelLeftSpace.constant = CGFloat(0.0)
73 - bannerCenteredView.frame.size.width = bannerLabel.intrinsicContentSize.width
74 -
75 -
76 - } else {
77 - bannerLabel.text = "Πρόσθεσε τις προτιμήσεις σου"
78 - bannerLabel.frame.size.width = bannerLabel.intrinsicContentSize.width
79 - bannerIconImage.isHidden = false
80 - bannerIconImageWidth.constant = CGFloat(16.0)
81 - bannerLabelLeftSpace.constant = CGFloat(5.0)
82 - bannerView.frame.size.width = bannerView.intrinsicContentSize.width
83 -
84 - bannerCenteredLabel.text = "Πρόσθεσε τις προτιμήσεις σου"
85 - bannerCenteredLabel.frame.size.width = bannerCenteredLabel.intrinsicContentSize.width
86 - bannerCenteredIconImage.isHidden = false
87 - bannerCenteredIconImageWidth.constant = CGFloat(16.0)
88 - bannerCenteredLabelLeftSpace.constant = CGFloat(5.0)
89 - bannerCenteredView.frame.size.width = bannerCenteredView.intrinsicContentSize.width
90 - }
91 -
92 - if (isCentered) {
93 - bannerView.isHidden = true
94 - bannerCenteredView.isHidden = false
95 -
96 - } else {
97 - bannerView.isHidden = false
98 - bannerCenteredView.isHidden = true
99 - }
100 - }
101 -
102 -}
1 -//
2 -// WalletSpinnerTableViewCell.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 24/10/23.
6 -//
7 -
8 -import UIKit
9 -
10 -@objc public class WalletSpinnerTableViewCell: UITableViewCell {
11 - @IBOutlet weak var spinner: UIActivityIndicatorView!
12 -
13 - public override func awakeFromNib() {
14 - super.awakeFromNib()
15 - // Initialization code
16 -
17 -// spinner.color = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00)
18 - spinner.color = UIColor(red: 0.00, green: 0.65, blue: 0.89, alpha: 1.00)
19 -
20 - spinner.translatesAutoresizingMaskIntoConstraints = false
21 - spinner.startAnimating()
22 - }
23 -
24 - public override func setSelected(_ selected: Bool, animated: Bool) {
25 - super.setSelected(selected, animated: animated)
26 -
27 - // Configure the view for the selected state
28 - }
29 -
30 - // This is a fix for spinner stopping its animation when reusing cells
31 - public override func prepareForReuse() {
32 - super.prepareForReuse()
33 - if let spinner = self.spinner {
34 - spinner.startAnimating()
35 - }
36 - }
37 -}
1 -//
2 -// WalletViewController.swift
3 -// WarplySDKFrameworkIOS
4 -//
5 -// Created by Βασιλης Σκουρας on 5/5/22.
6 -//
7 -
8 -import Foundation
9 -import UIKit
10 -import SwiftEventBus
11 -
12 -@objc public class WalletViewController: UIViewController {
13 - @IBOutlet weak var headerImage: UIImageView!
14 - @IBOutlet weak var profileImage: UIImageView!
15 - @IBOutlet weak var profileNameLabel: UILabel!
16 - @IBOutlet weak var questionnaireButton: UIButton!
17 - @IBOutlet weak var historyButtonView: UIView!
18 - @IBOutlet weak var historyButtonImage: UIImageView!
19 - @IBOutlet weak var dfyEarnBannerView: UIView!
20 - @IBOutlet weak var dfyEarnBannerHeight: NSLayoutConstraint!
21 - @IBOutlet weak var dfyEarnBannerTopSpace: NSLayoutConstraint!
22 - @IBOutlet weak var dfyEarnBannerInnerView: UIView!
23 - @IBOutlet weak var dfyEarnLabel: UILabel!
24 - @IBOutlet weak var dfyEarnAmountLabel: UILabel!
25 - @IBOutlet weak var dfyEarnImage: UIImageView!
26 - @IBOutlet weak var couponEarnView: UIView!
27 - @IBOutlet weak var couponEarnViewHeight: NSLayoutConstraint!
28 - @IBOutlet weak var couponEarnViewTopSpace: NSLayoutConstraint!
29 - @IBOutlet weak var couponEarnInnerView: UIView!
30 - @IBOutlet weak var couponEarnLabel: UILabel!
31 - @IBOutlet weak var couponEarnAmountLabel: UILabel!
32 - @IBOutlet weak var couponEarnImage: UIImageView!
33 - @IBOutlet weak var dfyLogoImage: UIImageView!
34 - @IBOutlet weak var dfyLogoImageTopSpace: NSLayoutConstraint!
35 - @IBOutlet weak var dfyLogoImageHeight: NSLayoutConstraint!
36 - @IBOutlet weak var activeCodeView: UIView!
37 - @IBOutlet weak var activeCodeViewHeight: NSLayoutConstraint!
38 - @IBOutlet weak var activeCodesCountLabel: UILabel!
39 - @IBOutlet weak var activeCodeLabel: UILabel!
40 - @IBOutlet weak var activeCodeExpirationLabel: UILabel!
41 - @IBOutlet weak var tableView: UITableView!
42 - @IBOutlet weak var activeCodeImage: UIImageView!
43 - @IBOutlet weak var myPresentsLabel: UILabel!
44 - @IBOutlet weak var emptyView: UIView!
45 - @IBOutlet weak var emptyViewHeight: NSLayoutConstraint!
46 - @IBOutlet weak var emptyImage: UIImageView!
47 - @IBOutlet weak var emptyLabel: UILabel!
48 - @IBOutlet weak var activeCodeScrollView: UIScrollView!
49 - @IBOutlet weak var activeCodeScrollViewHeight: NSLayoutConstraint!
50 - @IBOutlet weak var activeCodeContentView: UIView!
51 - @IBOutlet weak var activeCodeContentViewHeight: NSLayoutConstraint!
52 -
53 - @IBOutlet weak var rewardsView: UIView!
54 - @IBOutlet weak var rewardsViewHeight: NSLayoutConstraint!
55 -
56 - @IBOutlet weak var rewardsLabel: UILabel!
57 - @IBOutlet weak var sumBadgeImage: UIImageView!
58 - @IBOutlet weak var sumBadgeLabel: UILabel!
59 - @IBOutlet weak var dfyBadgeImage: UIImageView!
60 - @IBOutlet weak var dfyBadgeLabel: UILabel!
61 - @IBOutlet weak var couponBadgeImage: UIImageView!
62 - @IBOutlet weak var couponBadgeLabel: UILabel!
63 - @IBOutlet weak var marketBadgeImage: UIImageView!
64 - @IBOutlet weak var marketBadgeLabel: UILabel!
65 - @IBOutlet weak var badgeLinesImage: UIImageView!
66 -
67 - public var coupons:Array<swiftApi.CouponItemModel> = swiftApi().getCouponList()
68 - public var dfyCoupons:Array<swiftApi.ActiveDFYCouponModel> = swiftApi().getActiveDFYCoupons()
69 - public var loyaltyBadge:swiftApi.LoyaltyBadgeModel = swiftApi().getLoyaltyBadge()
70 - public var profile:swiftApi.ProfileModel? = swiftApi().getConsumer()
71 - public var unifiedCoupons:Array<swiftApi.UnifiedCouponModel> = []
72 - public var smCoupons:Array<swiftApi.CouponItemModel> = [] // swiftApi().getSMCouponList()
73 - public var boxCoupons:Array<swiftApi.ActiveBoxCouponModel> = swiftApi().getActiveBoxCoupons()
74 -
75 - var timerWallet: DispatchSourceTimer?
76 - var seconds: Int = 0
77 -
78 - var totalCouponValue = swiftApi().getDealsCouponsSum()
79 - var totalCouponDiscount = Float(round(100 * swiftApi().getLoyaltyBadge()._value) / 100)
80 - var unifiedCouponsDiscount:Float = 0.0
81 -
82 - var forYouExpanded: Bool = false;
83 - var showSpinner: Bool = false;
84 - // TODO: UNCOMMENT if ActiveCouponsBanners needs to be hidden again
85 -// var showActiveCouponsBanners: Bool = false;
86 - var showActiveCouponsBanners: Bool = true;
87 - var showEmptyView: Bool = false;
88 -
89 -
90 - public override func viewDidLoad() {
91 - super.viewDidLoad()
92 -
93 - self.hidesBottomBarWhenPushed = true
94 -
95 - SwiftEventBus.onBackgroundThread(self, name: "coupons_fetched") { result in
96 -
97 - DispatchQueue.main.async {
98 - self.coupons = swiftApi().getCouponList()
99 - self.totalCouponDiscount = Float(round(100 * swiftApi().getLoyaltyBadge()._value) / 100)
100 - self.loyaltyBadge = swiftApi().getLoyaltyBadge()
101 -
102 - self.handleSpinnerAndEmptyView()
103 - self.tableView.reloadData()
104 - }
105 - }
106 -
107 - SwiftEventBus.onBackgroundThread(self, name: "unified_coupons_fetched") { result in
108 -
109 - DispatchQueue.main.async {
110 - self.unifiedCoupons = swiftApi().getUnifiedCouponList()
111 - // TODO: Maybe add this
112 - // TODO: Uncomment if discounts are shown again in wallet
113 - self.matchOldSMCoupons()
114 - self.updateMarketBadge()
115 - self.handleSpinnerAndEmptyView()
116 - self.tableView.reloadData()
117 - }
118 - }
119 -
120 - SwiftEventBus.onBackgroundThread(self, name: "sm_coupons_fetched") { result in
121 -
122 - DispatchQueue.main.async {
123 - self.smCoupons = swiftApi().getSMCouponList()
124 - self.handleSpinnerAndEmptyView()
125 - self.tableView.reloadData()
126 - }
127 - }
128 -
129 - SwiftEventBus.onBackgroundThread(self, name: "vouchers_fetched") { result in
130 -
131 - DispatchQueue.main.async {
132 - print("=== vouchers_fetched event ===")
133 -
134 - self.handleSpinnerAndEmptyView()
135 -// self.showSpinner = false
136 - self.tableView.reloadData()
137 -
138 - }
139 - }
140 -
141 - SwiftEventBus.onBackgroundThread(self, name: "vouchers_service_unavailable") { result in
142 -
143 - DispatchQueue.main.async {
144 - print("=== vouchers_service_unavailable event ===")
145 -
146 - self.showVouchersFailureDialog()
147 -
148 - }
149 - }
150 -
151 - // TODO: DELETE ===>
152 -// let coupon = swiftApi.ActiveDFYCouponModel()
153 -// coupon._value = "12"
154 -// // coupon._date = "2022-12-05 01:55:01"
155 -// coupon._date = "2022-10-26 23:59:01"
156 -// coupon._code = "123456789"
157 -//
158 -// let coupon2 = swiftApi.ActiveDFYCouponModel()
159 -// coupon2._value = "23"
160 -// coupon2._date = "2022-11-05 01:55"
161 -// coupon2._code = "234567891"
162 -//
163 -// let coupon3 = swiftApi.ActiveDFYCouponModel()
164 -// coupon3._value = "34"
165 -// coupon3._date = "2022-07-01 01:55"
166 -// coupon3._code = "345678912"
167 -//
168 -// let couponsArray: Array<swiftApi.ActiveDFYCouponModel> = [coupon, coupon2, coupon3, coupon3, coupon3]
169 -//
170 -// swiftApi().setActiveDFYCoupons(dfyCoupons: couponsArray)
171 -//
172 -// dfyCoupons = swiftApi().getActiveDFYCoupons()
173 - // TODO: DELETE <===
174 -
175 - // TODO: Uncomment when UnifiedCoupons will be shown again
176 -// getCouponsSetsDealsRequest()
177 -
178 -// setBackButton("ic_close_3")
179 -// setNavigationTitle("My Rewards")
180 -
181 - tableView.delegate = self
182 - tableView.dataSource = self
183 -
184 - print("Active Gifts Count: " + String(coupons.count))
185 -
186 - // if ((profile != nil) && (profile?._nonTelco == true)) {
187 - if (swiftApi().getUserNonTelco() == true) {
188 - showDialog("Αδυναμία ενεργοποίησης", "Πρόσθεσε σύνδεση COSMOTE σταθερής, κινητής ή TV για να έχεις πρόσβαση στις προσφορές.");
189 - }
190 -
191 - headerImage.image = UIImage(named: "ic_background_straight", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
192 - historyButtonImage.image = UIImage(named: "wallet_history", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
193 - dfyEarnImage.image = UIImage(named: "wallet_dfy_3", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
194 - couponEarnImage.image = UIImage(named: "wallet_coupons_4", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
195 - dfyLogoImage.image = UIImage(named: "dfy_logo_colored", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
196 - activeCodeImage.image = UIImage(named: "active_code_logo_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
197 -
198 - if (profile != nil && !(profile?._image_url is NSNull) && profile?._image_url != nil && profile?._image_url != "") {
199 -
200 - profileImage.load(link: profile?._image_url ?? "", placeholder: UIImage(), cache: URLCache())
201 - } else {
202 - profileImage.image = UIImage(named: "default_profile_image_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
203 - }
204 -
205 - profileImage.layer.cornerRadius = 19
206 - profileImage.layer.maskedCorners = [ .layerMinXMinYCorner, .layerMaxXMaxYCorner] // Top left, bottom right corner radius
207 - profileImage.layer.borderWidth = 1
208 - profileImage.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor
209 -
210 - print("Profile Name: " + (profile?._firstname ?? "") + " " + (profile?._lastname ?? ""))
211 -
212 - profileNameLabel.text = (profile?._firstname ?? "") + " " + (profile?._lastname ?? "")
213 -
214 - let userTag = swiftApi().getUserTag()
215 - print("User tag: " + userTag)
216 - if (userTag != "" && userTag != "undefined") {
217 - questionnaireButton.setTitle(userTag, for: .normal)
218 -// questionnaireButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 15)
219 -// questionnaireButton.setTitleColor(.white, for: .normal)
220 -// // questionnaireButton.sizeToFit()
221 -// questionnaireButton.frame = CGRect(x: 0.0, y: 0.0, width: questionnaireButton.intrinsicContentSize.width, height: 26)
222 -// questionnaireButton.applyGradient(colours: [UIColor(red: 0.40, green: 0.77, blue: 0.28, alpha: 1.00), UIColor(red: 0.10, green: 0.66, blue: 0.72, alpha: 1.00)], gradient: GradientOrientation.horizontal, cornerRadius: 7.0)
223 -// // Shadow Color
224 -// questionnaireButton.layer.shadowColor = UIColor(red: 0.33, green: 0.38, blue: 0.43, alpha: 1.00).cgColor
225 -// questionnaireButton.layer.shadowOffset = CGSize(width: 0.0, height: 2.0)
226 -// questionnaireButton.layer.shadowOpacity = 1.0
227 -// questionnaireButton.layer.shadowRadius = 0.0
228 -// questionnaireButton.layer.masksToBounds = false
229 -// questionnaireButton.contentEdgeInsets = UIEdgeInsets(top: 7, left: 10, bottom: 3, right: 10)
230 - } else {
231 - questionnaireButton.setTitle("+Προτιμήσεις", for: .normal)
232 -// questionnaireButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 15)
233 -// questionnaireButton.setTitleColor(UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00), for: .normal)
234 -// questionnaireButton.backgroundColor = .clear
235 -// questionnaireButton.frame = CGRect(x: 0.0, y: 0.0, width: questionnaireButton.intrinsicContentSize.width, height: 26)
236 -// questionnaireButton.contentEdgeInsets = UIEdgeInsets(top: 5, left: 10, bottom: 5, right: 10)
237 - }
238 -
239 - questionnaireButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 15)
240 - questionnaireButton.setTitleColor(UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00), for: .normal)
241 - questionnaireButton.backgroundColor = .clear
242 - questionnaireButton.frame = CGRect(x: 0.0, y: 0.0, width: questionnaireButton.intrinsicContentSize.width, height: 42)
243 - questionnaireButton.contentEdgeInsets = UIEdgeInsets(top: 12, left: 20, bottom: 12, right: 20)
244 -
245 - questionnaireButton.layer.cornerRadius = 16.0
246 - questionnaireButton.layer.borderWidth = 1
247 - questionnaireButton.layer.borderColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00).cgColor
248 -
249 - historyButtonView.backgroundColor = .clear
250 - historyButtonView.layer.cornerRadius = 16.0
251 - historyButtonView.layer.borderWidth = 1
252 - historyButtonView.layer.borderColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00).cgColor
253 -
254 - dfyEarnBannerInnerView.layer.cornerRadius = 16.5
255 - // dfyEarnBannerInnerView.layer.borderWidth = 1
256 - // dfyEarnBannerInnerView.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor
257 -
258 - // Add shadow
259 - dfyEarnBannerView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
260 - dfyEarnBannerView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
261 - dfyEarnBannerView.layer.shadowOpacity = 1.0
262 - dfyEarnBannerView.layer.shadowRadius = 1.0
263 -
264 -// var totalCouponValue = swiftApi().getDealsCouponsSum()
265 -
266 - if (totalCouponValue == 0.0) {
267 - dfyEarnBannerView.isHidden = true
268 - dfyEarnBannerHeight.constant = 0
269 -// dfyEarnBannerTopSpace.constant = 0
270 -
271 - } else {
272 - dfyEarnBannerView.isHidden = false
273 - dfyEarnBannerHeight.constant = 75
274 -// dfyEarnBannerTopSpace.constant = 30
275 -
276 - }
277 -
278 - totalCouponValue = Float(round(100 * totalCouponValue) / 100)
279 - var totalCouponValueString = "0"
280 - totalCouponValueString = String(format: "%.2f", totalCouponValue).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
281 -
282 - // dfyEarnLabel.text = "Μέχρι τώρα έχεις κερδίσει " + totalCouponValueString + "€ με το DEALS for YOU!"
283 -
284 - let normalText1 = "Μέχρι τώρα έχεις κερδίσει "
285 - let boldText = totalCouponValueString + "€"
286 - let normalText2 = " με το DEALS for YOU!"
287 -
288 - let attrRegular = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-Regular", size: 14) ?? UIFont.systemFont(ofSize: 13), NSAttributedString.Key.foregroundColor: UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)]
289 - let attrBold = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-Bold", size: 14) ?? UIFont.boldSystemFont(ofSize: 13), NSAttributedString.Key.foregroundColor: UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)]
290 -
291 - let attributedString = NSMutableAttributedString(string:normalText1, attributes:attrRegular)
292 - let boldString = NSMutableAttributedString(string: boldText, attributes:attrBold)
293 - let normalString = NSMutableAttributedString(string:normalText2, attributes:attrRegular)
294 -
295 - attributedString.append(boldString)
296 - attributedString.append(normalString)
297 - dfyEarnLabel.attributedText = attributedString
298 -
299 - dfyEarnAmountLabel.text = totalCouponValueString + "€"
300 -// dfyEarnAmountLabel.font = UIFont(name: "PeridotPE-Bold", size: 14)
301 -
302 - let totalCouponValueIntCount = String(Int(totalCouponValue)).count
303 - if (totalCouponValueIntCount >= 3) {
304 - dfyEarnAmountLabel.font = UIFont(name: "PeridotPE-Bold", size: 11)
305 - } else {
306 - dfyEarnAmountLabel.font = UIFont(name: "PeridotPE-Bold", size: 13)
307 - }
308 -
309 - if (loyaltyBadge._couponCount == 0) {
310 - couponEarnView.isHidden = true
311 - couponEarnViewHeight.constant = 0
312 - couponEarnViewTopSpace.constant = 0
313 -
314 - } else {
315 - couponEarnView.isHidden = false
316 - couponEarnViewHeight.constant = 75
317 - if (totalCouponValue == 0.0) {
318 - couponEarnViewTopSpace.constant = 30
319 - } else {
320 - couponEarnViewTopSpace.constant = 15
321 - }
322 -
323 - }
324 -
325 - couponEarnInnerView.layer.cornerRadius = 16.5
326 - // couponEarnInnerView.layer.borderWidth = 1
327 - // couponEarnInnerView.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor
328 -
329 - // Add shadow
330 - couponEarnView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
331 - couponEarnView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
332 - couponEarnView.layer.shadowOpacity = 1.0
333 - couponEarnView.layer.shadowRadius = 1.0
334 -
335 -// let totalCouponDiscount = Float(round(100 * loyaltyBadge._value) / 100)
336 - var totalCouponDiscountString = "0"
337 - totalCouponDiscountString = String(format: "%.2f", totalCouponDiscount).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
338 -
339 - // couponEarnLabel.text = "Μέχρι τώρα έχεις κερδίσει " + totalCouponDiscountString + "€ σε προσφορές από " + String(loyaltyBadge._couponCount) + " κουπόνια!"
340 -
341 - let coupNormalText1 = "Μέχρι τώρα έχεις κερδίσει "
342 - let coupBoldText = totalCouponDiscountString + "€"
343 - let coupNormalText2 = " σε προσφορές από "
344 - let coupBoldText2 = String(loyaltyBadge._couponCount)
345 - let coupNormalText3 = " κουπόνια!"
346 -
347 - let coupAttributedString = NSMutableAttributedString(string:coupNormalText1, attributes:attrRegular)
348 - let coupBoldString = NSMutableAttributedString(string: coupBoldText, attributes:attrBold)
349 - let coupNormalString2 = NSMutableAttributedString(string:coupNormalText2, attributes:attrRegular)
350 - let coupBoldString2 = NSMutableAttributedString(string: coupBoldText2, attributes:attrBold)
351 - let coupNormalString3 = NSMutableAttributedString(string:coupNormalText3, attributes:attrRegular)
352 -
353 - coupAttributedString.append(coupBoldString)
354 - coupAttributedString.append(coupNormalString2)
355 - coupAttributedString.append(coupBoldString2)
356 - coupAttributedString.append(coupNormalString3)
357 - couponEarnLabel.attributedText = coupAttributedString
358 -
359 - couponEarnAmountLabel.text = totalCouponDiscountString + "€"
360 -
361 - let totalCouponDiscountIntCount = String(Int(totalCouponDiscount)).count
362 - if (totalCouponDiscountIntCount >= 3) {
363 - couponEarnAmountLabel.font = UIFont(name: "PeridotPE-Bold", size: 11)
364 - } else {
365 - couponEarnAmountLabel.font = UIFont(name: "PeridotPE-Bold", size: 13)
366 - }
367 -
368 - print("Loyalty Badge Value: " + totalCouponDiscountString)
369 - print("Loyalty Badge Count: " + String(loyaltyBadge._couponCount))
370 -
371 - // activeCodeView
372 - activeCodeView.layer.cornerRadius = 5.0
373 - activeCodeView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.16).cgColor
374 - activeCodeView.layer.shadowOffset = CGSize(width: 0.0, height: 0.0)
375 - activeCodeView.layer.shadowOpacity = 1.0
376 - activeCodeView.layer.shadowRadius = 6.0
377 -
378 - if (dfyCoupons.count > 0) {
379 - if (dfyCoupons.count == 1) {
380 - let dateFormatter = DateFormatter()
381 - dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
382 - // dateFormatter.dateFormat = "yyyy-MM-dd HH:mm"
383 -
384 - // sort dfyCoupons by date
385 - dfyCoupons.sort(by: {
386 - let date1 = dateFormatter.date(from: $0._date)
387 - let date2 = dateFormatter.date(from: $1._date)
388 -
389 - if ((date1 != nil) && (date2 != nil)) {
390 - return date1!.compare(date2!) == .orderedAscending
391 - } else {
392 - return false
393 - }
394 -
395 - })
396 -
397 - // Get days from now of the most recet coupon
398 - var daysFromNow = ""
399 - let calendar = Calendar.current
400 -
401 - // Replace the hour (time) of both dates with 00:00
402 - let date1 = calendar.startOfDay(for: Date())
403 - if let date2 = dateFormatter.date(from: dfyCoupons[0]._date) {
404 - let components = calendar.dateComponents([.day], from: date1, to: date2)
405 - daysFromNow = (components.day) != nil ? String((components.day ?? 0) + 1) : ""
406 - }
407 -
408 - activeCodesCountLabel.text = "Ενεργός κωδικός:"
409 - // activeCodeLabel.text = dfyCoupons[0]._code
410 - let newLabel = CopyableLabel()
411 - newLabel.text = String(dfyCoupons[0]._code)
412 - newLabel.font = UIFont(name: "PFSquareSansPro-Bold", size: 19)
413 - newLabel.textColor = UIColor(rgb: 0x3C5365)
414 - newLabel.frame.size.width = newLabel.intrinsicContentSize.width
415 - newLabel.frame.size.height = newLabel.intrinsicContentSize.height // tagHeight
416 - activeCodeContentView.addSubview(newLabel)
417 - // set the btn frame origin
418 - newLabel.frame.origin.x = 0
419 - newLabel.frame.origin.y = 0
420 - let scrollHeight = newLabel.intrinsicContentSize.height
421 - activeCodeContentViewHeight.constant = scrollHeight
422 - activeCodeScrollViewHeight.constant = scrollHeight
423 -
424 - activeCodeExpirationLabel.isHidden = false
425 - if (daysFromNow == "1") {
426 - activeCodeExpirationLabel.text = "Λήγει σε " + daysFromNow + " ημέρα"
427 - } else {
428 - activeCodeExpirationLabel.text = "Λήγει σε " + daysFromNow + " ημέρες"
429 - }
430 -
431 - } else {
432 - var tagHeight:CGFloat = 30
433 - let tagPadding: CGFloat = 0
434 - let tagSpacingX: CGFloat = 0
435 - let tagSpacingY: CGFloat = 2
436 -
437 - let containerWidth = activeCodeContentView.frame.size.width
438 -
439 - var currentOriginX: CGFloat = 0
440 - var currentOriginY: CGFloat = 0
441 -
442 - // var couponCodesString = ""
443 - for (index, item) in dfyCoupons.enumerated() {
444 - let newLabel = CopyableLabel()
445 - newLabel.font = UIFont(name: "PFSquareSansPro-Bold", size: 19)
446 - newLabel.textColor = UIColor(rgb: 0x3C5365)
447 -
448 - if (index == (dfyCoupons.endIndex - 1)) {
449 - // couponCodesString += String(item._code)
450 - newLabel.text = String(item._code)
451 - } else {
452 - // couponCodesString += String(item._code) + ", "
453 - newLabel.text = String(item._code) + ", "
454 - }
455 -
456 - newLabel.frame.size.width = newLabel.intrinsicContentSize.width + tagPadding
457 - newLabel.frame.size.height = newLabel.intrinsicContentSize.height // tagHeight
458 - tagHeight = newLabel.intrinsicContentSize.height
459 - activeCodeContentView.addSubview(newLabel)
460 -
461 - // if current X + label width will be greater than container view width
462 - // "move to next row"
463 - if currentOriginX + newLabel.frame.width > containerWidth {
464 - currentOriginX = 0
465 - currentOriginY += tagHeight + tagSpacingY
466 - }
467 -
468 - // set the btn frame origin
469 - newLabel.frame.origin.x = currentOriginX
470 - newLabel.frame.origin.y = currentOriginY
471 -
472 - // increment current X by btn width + spacing
473 - currentOriginX += newLabel.frame.width + tagSpacingX
474 - }
475 -
476 - activeCodesCountLabel.text = String(dfyCoupons.count) + " Ενεργοί κωδικοί:"
477 - // activeCodeLabel.text = couponCodesString
478 - activeCodeExpirationLabel.isHidden = true
479 -
480 - // update container view height
481 - activeCodeContentViewHeight.constant = currentOriginY + tagHeight
482 - if ((currentOriginY + tagHeight) <= (2 * tagHeight + tagSpacingY)) {
483 - activeCodeScrollViewHeight.constant = currentOriginY + tagHeight
484 - } else {
485 - activeCodeScrollViewHeight.constant = 2 * tagHeight + tagSpacingY
486 - }
487 - }
488 - } else {
489 - activeCodeLabel.text = "-"
490 - activeCodeExpirationLabel.text = ""
491 -
492 - dfyLogoImage.isHidden = true
493 - activeCodeView.isHidden = true
494 -
495 - dfyLogoImageHeight.constant = 0
496 - activeCodeViewHeight.constant = 0
497 -// dfyLogoImageTopSpace.constant = 0
498 - }
499 -
500 - myPresentsLabel.text = "Τα δώρα μου"
501 - if (coupons.count > 0) {
502 - myPresentsLabel.isHidden = false
503 - } else {
504 - myPresentsLabel.isHidden = true
505 - }
506 -
507 - emptyImage.image = UIImage(named: "ic_empty_wallet_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
508 - emptyLabel.text = "Δεν έχεις κάποιον ενεργό κωδικό ή κουπόνι! Μπες τώρα στην ενότητα COSMOTE For You και βρες αποκλειστικές προσφορές!"
509 -
510 - // TODO: Uncomment if discounts are shown again in wallet
511 - matchOldSMCoupons()
512 - updateMarketBadge()
513 -
514 - // TODO: DELETE if emptyView is needed again
515 -// emptyView.isHidden = true
516 -// emptyViewHeight.constant = 0
517 -
518 - self.handleSpinnerAndEmptyView()
519 -
520 - }
521 -
522 - public override func viewWillAppear(_ animated: Bool) {
523 - super.viewWillAppear(animated)
524 -
525 - swiftApi().logTrackersEvent("screen", "LoyaltyWalletScreen")
526 -
527 - // addNavShadow()
528 - self.navigationController?.hideHairline()
529 -
530 - let userTag = swiftApi().getUserTag()
531 - if (questionnaireButton.currentTitle != userTag) {
532 - if (userTag != "" && userTag != "undefined") {
533 - questionnaireButton.setTitle(userTag, for: .normal)
534 -// questionnaireButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 14)
535 -// questionnaireButton.setTitleColor(.white, for: .normal)
536 -// // questionnaireButton.sizeToFit()
537 -// questionnaireButton.frame = CGRect(x: 0.0, y: 0.0, width: questionnaireButton.intrinsicContentSize.width, height: 26)
538 -// questionnaireButton.applyGradient(colours: [UIColor(red: 0.40, green: 0.77, blue: 0.28, alpha: 1.00), UIColor(red: 0.10, green: 0.66, blue: 0.72, alpha: 1.00)], gradient: GradientOrientation.horizontal, cornerRadius: 7.0)
539 -// // Shadow Color
540 -// questionnaireButton.layer.shadowColor = UIColor(red: 0.33, green: 0.38, blue: 0.43, alpha: 1.00).cgColor
541 -// questionnaireButton.layer.shadowOffset = CGSize(width: 0.0, height: 2.0)
542 -// questionnaireButton.layer.shadowOpacity = 1.0
543 -// questionnaireButton.layer.shadowRadius = 0.0
544 -// questionnaireButton.layer.masksToBounds = false
545 -// questionnaireButton.contentEdgeInsets = UIEdgeInsets(top: 7, left: 10, bottom: 3, right: 10)
546 - } else {
547 - for layer in (questionnaireButton.layer.sublayers ?? []) {
548 - if(layer.name == "linearGradientLayer"){
549 - layer.removeFromSuperlayer()
550 - }
551 - }
552 - questionnaireButton.layer.shadowOpacity = 0.0;
553 - questionnaireButton.setTitle("+Προτιμήσεις", for: .normal)
554 -// questionnaireButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 14)
555 -// questionnaireButton.setTitleColor(UIColor(red: 0.31, green: 0.62, blue: 0.18, alpha: 1.00), for: .normal)
556 -// questionnaireButton.backgroundColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00)
557 -// questionnaireButton.frame = CGRect(x: 0.0, y: 0.0, width: questionnaireButton.intrinsicContentSize.width, height: 26)
558 -// questionnaireButton.contentEdgeInsets = UIEdgeInsets(top: 5, left: 10, bottom: 5, right: 10)
559 - }
560 - questionnaireButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 15)
561 - questionnaireButton.setTitleColor(UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00), for: .normal)
562 - questionnaireButton.backgroundColor = .clear
563 - questionnaireButton.frame = CGRect(x: 0.0, y: 0.0, width: questionnaireButton.intrinsicContentSize.width, height: 42)
564 - questionnaireButton.contentEdgeInsets = UIEdgeInsets(top: 12, left: 20, bottom: 12, right: 20)
565 -
566 - questionnaireButton.layer.cornerRadius = 16.0
567 - questionnaireButton.layer.borderWidth = 1
568 - questionnaireButton.layer.borderColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00).cgColor
569 - }
570 -
571 - self.coupons = swiftApi().getCouponList()
572 - // TODO: Uncomment when UnifiedCoupons will be shown again
573 - self.unifiedCoupons = swiftApi().getUnifiedCouponList()
574 - self.smCoupons = swiftApi().getSMCouponList()
575 - // TODO: Maybe add this
576 - self.matchOldSMCoupons()
577 - // <===
578 - // TODO: Uncomment if discounts are shown again in wallet
579 - self.updateMarketBadge()
580 - self.handleSpinnerAndEmptyView()
581 - self.tableView.reloadData()
582 -
583 - self.startTimer()
584 - }
585 -
586 - public override func viewWillDisappear(_ animated: Bool) {
587 - super.viewWillDisappear(animated)
588 -
589 - self.stopTimer()
590 - self.navigationController?.navigationBar.layer.shadowOpacity = 0.0
591 -
592 - if self.isMovingFromParent {
593 - // Clear ShowVouchersBanner state
594 - swiftApi().clearShowVouchersBanner();
595 - }
596 - }
597 -
598 - public override func viewDidLayoutSubviews() {
599 - super.viewDidLayoutSubviews()
600 -
601 - // TODO: Uncomment if header is needed again
602 -// if let headerView = tableView.tableHeaderView {
603 -//
604 -// let height = headerView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize).height
605 -// var headerFrame = headerView.frame
606 -//// let height = 0.0
607 -//// var headerFrame = CGRect(x: 0,y: 0,width: 0,height: 0)
608 -//
609 -// //Comparison necessary to avoid infinite loop
610 -// if height != headerFrame.size.height {
611 -// headerFrame.size.height = height
612 -// headerView.frame = headerFrame
613 -// tableView.tableHeaderView = headerView
614 -// }
615 -// }
616 -
617 - // TODO: DELETE if header is needed again
618 - self.tableView.tableHeaderView = UIView(frame: CGRect(x: 0.0, y: 0.0, width: self.tableView.bounds.size.width, height: 0.01))
619 - }
620 -
621 - // MARK: - Functions
622 - func showDialog(_ alertTitle: String, _ alertSubTitle: String) -> Void {
623 -
624 - let alert = UIAlertController(title: alertTitle, message: alertSubTitle, preferredStyle: .alert)
625 - alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
626 - switch action.style{
627 - case .default:
628 - self.navigationController?.popViewController(animated: true)
629 - // self.dismiss(animated: true, completion: {})
630 -
631 - case .cancel:
632 - print("cancel")
633 -
634 - case .destructive:
635 - print("destructive")
636 -
637 - }
638 - }))
639 - self.present(alert, animated: true, completion: nil)
640 - }
641 -
642 - func showVouchersFailureDialog() -> Void {
643 -
644 - let alert = UIAlertController(title: "Προσπάθησε ξανά αργότερα", message: "Προσωρινά μη διαθέσιμη πληροφορία.\nΠαρακαλούμε δοκίμασε ξανά σε λίγο.", preferredStyle: .alert)
645 - alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
646 - switch action.style{
647 - case .default:
648 -// self.handleSpinnerAndEmptyView()
649 -// self.tableView.reloadData()
650 - self.navigationController?.popViewController(animated: true)
651 - // self.dismiss(animated: true, completion: {})
652 -
653 - case .cancel:
654 - print("cancel")
655 -
656 - case .destructive:
657 - print("destructive")
658 -
659 - }
660 - }))
661 - self.present(alert, animated: true, completion: nil)
662 - }
663 -
664 - func startTimer() {
665 - print("========= MyRewards Timer Started! =========")
666 -
667 - let queue = DispatchQueue(label: Bundle.main.bundleIdentifier! + ".wallet.timer")
668 - timerWallet = DispatchSource.makeTimerSource(queue: queue)
669 - timerWallet!.schedule(deadline: .now(), repeating: .seconds(1))
670 - timerWallet!.setEventHandler { [weak self] in
671 - // do whatever stuff you want on the background queue here here
672 - print("========= MyRewards interval! =========")
673 -
674 - DispatchQueue.main.async {
675 - // update your model objects and/or UI here
676 - self?.seconds = (self?.seconds ?? 0) + 1
677 -
678 - }
679 - }
680 - timerWallet!.resume()
681 - }
682 -
683 - func stopTimer() {
684 - print("========= MyRewards Timer Stopped! =========")
685 - timerWallet?.cancel()
686 - timerWallet = nil
687 -
688 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
689 - firebaseEvent._eventName = "time_spent_on_loyalty_sdk"
690 - firebaseEvent.setParameter = ("name", "MyRewards")
691 - firebaseEvent.setParameter = ("seconds", String(seconds))
692 - SwiftEventBus.post("firebase", sender: firebaseEvent)
693 -
694 - seconds = 0
695 - }
696 -
697 - func updateMarketBadge() {
698 - unifiedCouponsDiscount = 0.0
699 -// for smCouponSet in swiftApi().getCouponSetsDealsList() {
700 -// for oldCoupon in swiftApi().getAllOldCouponList() {
701 -// if (smCouponSet.uuid != "" && oldCoupon.couponset_uuid != "" && smCouponSet.uuid == oldCoupon.couponset_uuid) {
702 -//
703 -// oldCoupon.setCouponSetData(smCouponSet);
704 -//
705 -// if let discountFloat = Float(oldCoupon.discount ?? "0.0") {
706 -// unifiedCouponsDiscount += discountFloat
707 -// }
708 -// break;
709 -// }
710 -// }
711 -// }
712 -
713 - for coupon in swiftApi().getOldUnifiedCouponList() {
714 - if let discountFloat = Float(coupon.discount ?? "0.0") {
715 - unifiedCouponsDiscount += discountFloat
716 - }
717 - }
718 -
719 - // TODO: UNCOMMENT if emptyView is needed again
720 -// if (totalCouponValue == 0.0 && loyaltyBadge._couponCount == 0 && dfyCoupons.count == 0 && coupons.count == 0 && unifiedCoupons.count == 0 && unifiedCouponsDiscount == 0.0) {
721 -// emptyView.isHidden = false
722 -// emptyViewHeight.constant = emptyView.intrinsicContentSize.height
723 -// } else {
724 -// emptyView.isHidden = true
725 -// emptyViewHeight.constant = 0
726 -// }
727 - }
728 -
729 - func matchOldSMCoupons() {
730 - var oldUnifiedCouponsArray:Array<swiftApi.CouponItemModel> = []
731 -
732 - // TODO: Check - Old implementation
733 -// for smCouponSet in swiftApi().getCouponSetsDealsList() {
734 -// for oldCoupon in swiftApi().getAllOldCouponList() {
735 -// if (smCouponSet.uuid != "" && oldCoupon.couponset_uuid != "" && smCouponSet.uuid == oldCoupon.couponset_uuid) {
736 -//
737 -// oldCoupon.setCouponSetData(smCouponSet);
738 -// oldUnifiedCouponsArray.append(oldCoupon);
739 -//
740 -// break;
741 -// }
742 -// }
743 -// }
744 -
745 - // TODO: DELETE - TEST
746 -// oldUnifiedCouponsArray = swiftApi().getAllOldCouponList().filter({ return $0.couponset_data?.couponset_type == "supermarket" })
747 - oldUnifiedCouponsArray = swiftApi().getSMOldCouponList()
748 -
749 - oldUnifiedCouponsArray.sort(by: {
750 - let date1 = $0.redeemed_date
751 - let date2 = $1.redeemed_date
752 -
753 - if ((date1 != nil) && (date2 != nil)) {
754 - return date1!.compare(date2!) == .orderedDescending
755 - } else {
756 - return false
757 - }
758 -
759 - })
760 - swiftApi().setOldUnifiedCouponList(oldUnifiedCouponsArray)
761 -
762 - }
763 -
764 - func handleSpinnerAndEmptyView() {
765 - if (swiftApi().getShowVouchersBanner() == "") {
766 - self.emptyView.isHidden = true
767 - self.emptyViewHeight.constant = 0
768 - self.showEmptyView = false
769 -
770 - self.showSpinner = true
771 -
772 - if (self.dfyCoupons.count == 0 && self.unifiedCoupons.count == 0 && self.smCoupons.count == 0 && self.coupons.count == 0) {
773 - // TODO: UNCOMMENT if ActiveCouponsBanners needs to be hidden again
774 -// self.showActiveCouponsBanners = false
775 -
776 - } else {
777 - self.showActiveCouponsBanners = true
778 - }
779 -
780 - } else {
781 - self.showSpinner = false
782 -
783 - if (self.dfyCoupons.count == 0 && self.unifiedCoupons.count == 0 && self.smCoupons.count == 0 && self.coupons.count == 0) {
784 - // TODO: UNCOMMENT if ActiveCouponsBanners needs to be hidden again
785 -// self.showActiveCouponsBanners = false
786 -
787 - if (swiftApi().getShowVouchersBanner() == "null") {
788 - // TODO: UNCOMMENT if emptyView is needed again
789 -// self.emptyView.isHidden = false
790 -// self.emptyViewHeight.constant = self.emptyView.intrinsicContentSize.height
791 - let sumRedeemed = totalCouponValue + totalCouponDiscount + unifiedCouponsDiscount
792 - if (sumRedeemed == 0.0) {
793 - self.showEmptyView = true
794 - } else {
795 - self.showEmptyView = false
796 - }
797 -// self.showEmptyView = true
798 -
799 - } else {
800 - self.emptyView.isHidden = true
801 - self.emptyViewHeight.constant = 0
802 - self.showEmptyView = false
803 - }
804 -
805 - } else {
806 - self.emptyView.isHidden = true
807 - self.emptyViewHeight.constant = 0
808 - self.showEmptyView = false
809 -
810 - self.showActiveCouponsBanners = true
811 - }
812 - }
813 - }
814 -
815 -
816 - // MARK: - API Functions
817 - func getCouponsSetsDealsRequest() {
818 - swiftApi().getCouponSetsDealsAsync(getCouponsSetsDealsCallback, failureCallback: {errorCode in
819 - })
820 - }
821 -
822 - func getCouponsSetsDealsCallback (_ couponsData: Array<swiftApi.CouponSetItemModel>?) -> Void {
823 - if (couponsData != nil) {
824 -
825 - DispatchQueue.main.async {
826 - self.getUnifiedCouponsRequest()
827 - }
828 - } else {
829 - }
830 - }
831 -
832 - func getUnifiedCouponsRequest() {
833 - swiftApi().getUnifiedCouponsAsync(getUnifiedCouponsCallback, failureCallback: {errorCode in
834 - self.unifiedCoupons = []
835 - })
836 - }
837 -
838 - func getUnifiedCouponsCallback (_ couponsData: Array<swiftApi.UnifiedCouponModel>?) -> Void {
839 - if (couponsData != nil) {
840 - self.unifiedCoupons = couponsData ?? []
841 -
842 - DispatchQueue.main.async {
843 - self.matchOldSMCoupons()
844 - self.updateMarketBadge()
845 - self.handleSpinnerAndEmptyView()
846 - self.tableView.reloadData()
847 - }
848 - } else {
849 - self.unifiedCoupons = []
850 - }
851 - }
852 -
853 - // MARK: - Actions
854 - @IBAction func qustionnaireButtonAction(_ sender: Any) {
855 - swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "Questionnaire"))
856 -
857 - swiftApi().openQuestionnaire(self);
858 - }
859 -
860 - @IBAction func historyButtonAction(_ sender: Any) {
861 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
862 - firebaseEvent._eventName = "did_tap_history_badge"
863 - firebaseEvent.setParameter = ("screen", "Loyalty Wallet")
864 - SwiftEventBus.post("firebase", sender: firebaseEvent)
865 -
866 - swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "LoyaltyHistoryBadge"))
867 -
868 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
869 - let vc = storyboard.instantiateViewController(withIdentifier: "LoyaltyHistoryViewController") as! SwiftWarplyFramework.LoyaltyHistoryViewController
870 - self.navigationController?.pushViewController(vc, animated: true)
871 - }
872 -
873 - @IBAction func dfyEarnButtonAction(_ sender: Any) {
874 - print("DFY coupon banner pressed!")
875 - // analysis_pressed event
876 - let dealsAnalysis = swiftApi.WarplyDealsAnalysisEventModel()
877 - dealsAnalysis._isPressed = true
878 - SwiftEventBus.post("analysis_pressed", sender: dealsAnalysis)
879 -
880 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
881 - firebaseEvent._eventName = "did_tap_gifts_for_you_badge"
882 - firebaseEvent.setParameter = ("screen", "Loyalty Wallet")
883 - SwiftEventBus.post("firebase", sender: firebaseEvent)
884 -
885 - swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "DealsBanner"))
886 - }
887 - @IBAction func couponEarnButtonAction(_ sender: Any) {
888 -
889 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
890 - firebaseEvent._eventName = "did_tap_deals_for_you_badge"
891 - firebaseEvent.setParameter = ("screen", "Loyalty Wallet")
892 - SwiftEventBus.post("firebase", sender: firebaseEvent)
893 -
894 - swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "LoyaltyBanner"))
895 -
896 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
897 - let vc = storyboard.instantiateViewController(withIdentifier: "LoyaltyAnalysisViewController") as! SwiftWarplyFramework.LoyaltyAnalysisViewController
898 - self.navigationController?.pushViewController(vc, animated: true)
899 - }
900 - @IBAction func activeCodeButtonAction(_ sender: Any) {
901 - print("Active DFY coupon banner Tapped!")
902 -
903 - swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "ActiveDealsBanner"))
904 -
905 - let couponDetails = swiftApi.ActiveDFYCouponEventModel()
906 - couponDetails._isPressed = true
907 - SwiftEventBus.post("dfy_coupon_details", sender: couponDetails)
908 - }
909 -
910 - @IBAction func dfyBadgeButtonAction(_ sender: Any) {
911 - var totalCouponValue = swiftApi().getDealsCouponsSum()
912 - if (totalCouponValue > 0.0) {
913 - print("DFY coupon banner pressed!")
914 - // analysis_pressed event
915 - let dealsAnalysis = swiftApi.WarplyDealsAnalysisEventModel()
916 - dealsAnalysis._isPressed = true
917 - SwiftEventBus.post("analysis_pressed", sender: dealsAnalysis)
918 -
919 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
920 - firebaseEvent._eventName = "did_tap_gifts_for_you_badge"
921 - firebaseEvent.setParameter = ("screen", "Loyalty Wallet")
922 - SwiftEventBus.post("firebase", sender: firebaseEvent)
923 -
924 - swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "DealsBanner"))
925 - }
926 - }
927 -
928 - @IBAction func couponBadgeButtonAction(_ sender: Any) {
929 - if (loyaltyBadge._couponCount > 0) {
930 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
931 - firebaseEvent._eventName = "did_tap_deals_for_you_badge"
932 - firebaseEvent.setParameter = ("screen", "Loyalty Wallet")
933 - SwiftEventBus.post("firebase", sender: firebaseEvent)
934 -
935 - swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "LoyaltyBanner"))
936 -
937 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
938 - let vc = storyboard.instantiateViewController(withIdentifier: "LoyaltyAnalysisViewController") as! SwiftWarplyFramework.LoyaltyAnalysisViewController
939 - self.navigationController?.pushViewController(vc, animated: true)
940 - }
941 - }
942 -
943 - @IBAction func marketBadgeButtonAction(_ sender: Any) {
944 - print("Market Badge pressed!")
945 - // TODO: add action - open marketHistory after check
946 - if (self.unifiedCouponsDiscount > 0.0) {
947 -// let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
948 -// firebaseEvent._eventName = "did_tap_deals_for_you_badge"
949 -// firebaseEvent.setParameter = ("screen", "Loyalty Wallet")
950 -// SwiftEventBus.post("firebase", sender: firebaseEvent)
951 -
952 -// swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "LoyaltyBanner"))
953 -
954 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
955 - let vc = storyboard.instantiateViewController(withIdentifier: "MarketLoyaltyAnalysisViewController") as! SwiftWarplyFramework.MarketLoyaltyAnalysisViewController
956 - self.navigationController?.pushViewController(vc, animated: true)
957 - }
958 - }
959 -
960 - @IBAction func sumBannerButtonAction(_ sender: Any) {
961 - if (!(self.totalCouponValue == 0.0 && self.loyaltyBadge._couponCount == 0 && self.unifiedCouponsDiscount == 0.0)) {
962 - self.forYouExpanded = !self.forYouExpanded
963 - self.tableView.reloadData()
964 - }
965 - }
966 -
967 -
968 - @IBAction func dfyBannerButtonAction(_ sender: Any) {
969 - var totalCouponValue = swiftApi().getDealsCouponsSum()
970 - if (totalCouponValue > 0.0) {
971 - print("DFY coupon banner pressed!")
972 - // analysis_pressed event
973 - let dealsAnalysis = swiftApi.WarplyDealsAnalysisEventModel()
974 - dealsAnalysis._isPressed = true
975 - SwiftEventBus.post("analysis_pressed", sender: dealsAnalysis)
976 -
977 -// let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
978 -// firebaseEvent._eventName = "did_tap_gifts_for_you_badge"
979 -// firebaseEvent.setParameter = ("screen", "Loyalty Wallet")
980 -// SwiftEventBus.post("firebase", sender: firebaseEvent)
981 -
982 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
983 - firebaseEvent._eventName = "did_tap_deals_for_you_badge"
984 - firebaseEvent.setParameter = ("screen", "Loyalty Wallet")
985 - SwiftEventBus.post("firebase", sender: firebaseEvent)
986 -
987 - swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "DealsBanner"))
988 - }
989 - }
990 -
991 - @IBAction func gfyBannerButtonAction(_ sender: Any) {
992 - if (loyaltyBadge._couponCount > 0) {
993 -// let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
994 -// firebaseEvent._eventName = "did_tap_deals_for_you_badge"
995 -// firebaseEvent.setParameter = ("screen", "Loyalty Wallet")
996 -// SwiftEventBus.post("firebase", sender: firebaseEvent)
997 -
998 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
999 - firebaseEvent._eventName = "did_tap_gifts_for_you_badge"
1000 - firebaseEvent.setParameter = ("screen", "Loyalty Wallet")
1001 - SwiftEventBus.post("firebase", sender: firebaseEvent)
1002 -
1003 - swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "LoyaltyBanner"))
1004 -
1005 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
1006 - let vc = storyboard.instantiateViewController(withIdentifier: "LoyaltyAnalysisViewController") as! SwiftWarplyFramework.LoyaltyAnalysisViewController
1007 - self.navigationController?.pushViewController(vc, animated: true)
1008 - }
1009 - }
1010 -
1011 - @IBAction func marketBannerButtonAction(_ sender: Any) {
1012 - if (self.unifiedCouponsDiscount > 0.0) {
1013 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
1014 - firebaseEvent._eventName = "did_tap_market_badge"
1015 - firebaseEvent.setParameter = ("screen", "Loyalty Wallet")
1016 - SwiftEventBus.post("firebase", sender: firebaseEvent)
1017 -
1018 - swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "MarketBanner"))
1019 -
1020 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
1021 - let vc = storyboard.instantiateViewController(withIdentifier: "MarketLoyaltyAnalysisViewController") as! SwiftWarplyFramework.MarketLoyaltyAnalysisViewController
1022 - self.navigationController?.pushViewController(vc, animated: true)
1023 - }
1024 - }
1025 -
1026 - @IBAction func dfyActiveCouponsBannerButtonAction(_ sender: Any) {
1027 - print("Active DFY coupon banner Tapped!")
1028 -
1029 - swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "ActiveDealsBanner"))
1030 -
1031 - let couponDetails = swiftApi.ActiveDFYCouponEventModel()
1032 - couponDetails._isPressed = true
1033 - SwiftEventBus.post("dfy_coupon_details", sender: couponDetails)
1034 - }
1035 -
1036 - @IBAction func smActiveCouponsBannerButtonAction(_ sender: Any) {
1037 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
1038 - firebaseEvent._eventName = "did_tap_market_active_badge"
1039 - firebaseEvent.setParameter = ("screen", "Loyalty Wallet")
1040 - SwiftEventBus.post("firebase", sender: firebaseEvent)
1041 -
1042 - swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "ActiveMarketBanner"))
1043 -
1044 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
1045 - let vc = storyboard.instantiateViewController(withIdentifier: "UnifiedCouponsViewController") as! SwiftWarplyFramework.UnifiedCouponsViewController
1046 - self.navigationController?.pushViewController(vc, animated: true)
1047 - }
1048 -
1049 - @IBAction func gfyActiveCouponsBannerButtonAction(_ sender: Any) {
1050 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
1051 - firebaseEvent._eventName = "did_tap_gifts_for_you_active_badge"
1052 - firebaseEvent.setParameter = ("screen", "Loyalty Wallet")
1053 - SwiftEventBus.post("firebase", sender: firebaseEvent)
1054 -
1055 - swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "ActiveLoyaltyBanner"))
1056 -
1057 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: SwiftWarplyFramework.CouponsViewController.self))
1058 - if let vc = storyboard.instantiateViewController(withIdentifier: "CouponsViewController") as? SwiftWarplyFramework.CouponsViewController{
1059 - self.navigationController?.pushViewController(vc,animated: true)
1060 - }
1061 - }
1062 -
1063 -}
1064 -
1065 -// MARK: - TableView
1066 -extension WalletViewController: UITableViewDelegate, UITableViewDataSource{
1067 -
1068 - public func numberOfSections(in tableView: UITableView) -> Int {
1069 -// return 4
1070 - return 5
1071 - }
1072 -
1073 - public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
1074 -// if (section == 0) {
1075 -// // TODO: Uncomment when UnifiedCoupons will be shown again
1076 -//// if (self.totalCouponValue == 0.0 && self.loyaltyBadge._couponCount == 0 && self.unifiedCouponsDiscount == 0.0) {
1077 -//// return 0
1078 -//// } else {
1079 -// return 1
1080 -//// }
1081 -// } else if (section == 1) {
1082 -// return self.unifiedCoupons.count
1083 -// } else if (section == 2) {
1084 -// if (self.dfyCoupons.count > 0) {
1085 -// return 1
1086 -// } else {
1087 -// return 0
1088 -// }
1089 -// } else if (section == 3) {
1090 -// return self.coupons.count
1091 -// } else {
1092 -// return 0
1093 -// }
1094 -
1095 - if (section == 0) {
1096 -// TODO: Uncomment if we want to hide empty tiles again
1097 -// let sumRedeemed = totalCouponValue + totalCouponDiscount + unifiedCouponsDiscount
1098 -// if (self.dfyCoupons.count > 0 || self.unifiedCoupons.count > 0 || self.coupons.count > 0 || sumRedeemed > 0.0) {
1099 - return 1
1100 -// } else {
1101 -// return 0
1102 -// }
1103 - } else if (section == 1) {
1104 -// TODO: Uncomment if we want to show emptyView again
1105 -// if (self.showEmptyView == true) {
1106 -// return 1
1107 -// } else {
1108 - return 0
1109 -// }
1110 - } else if (section == 2) {
1111 - return 1
1112 - }
1113 -// else if (section == 2) {
1114 -// let sumRedeemed = totalCouponValue + totalCouponDiscount + unifiedCouponsDiscount
1115 -// if (sumRedeemed > 0.0) {
1116 -// return 1
1117 -// } else {
1118 -// return 0
1119 -// }
1120 -// }
1121 - else if (section == 3) {
1122 - if (swiftApi().getShowVouchersBanner() == "true" || swiftApi().getShowVouchersBanner() == "false") {
1123 - return 1
1124 - } else {
1125 - return 0
1126 - }
1127 - } else if (section == 4) {
1128 - if (self.showSpinner == true) {
1129 - return 1
1130 - } else {
1131 - return 0
1132 - }
1133 - } else {
1134 - return 0
1135 - }
1136 - }
1137 -
1138 - public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
1139 -// if (indexPath.section == 0) {
1140 -// // TODO: Uncomment when UnifiedCoupons will be shown again
1141 -//// if (self.totalCouponValue == 0.0 && self.loyaltyBadge._couponCount == 0 && self.unifiedCouponsDiscount == 0.0) {
1142 -//// return 0.0
1143 -//// } else {
1144 -// return UITableView.automaticDimension
1145 -//// }
1146 -// } else if (indexPath.section == 1) {
1147 -// if (self.unifiedCoupons.count > 0) {
1148 -// return 130.0 + 8.0
1149 -// } else {
1150 -// return 0.0
1151 -// }
1152 -// } else if (indexPath.section == 2) {
1153 -// if (self.dfyCoupons.count > 0) {
1154 -// return UITableView.automaticDimension
1155 -// } else {
1156 -// return 0.0
1157 -// }
1158 -//
1159 -// } else if (indexPath.section == 3) {
1160 -// if (self.coupons.count > 0) {
1161 -// return 130.0 + 8.0
1162 -// } else {
1163 -// return 0.0
1164 -// }
1165 -// } else {
1166 -// return 0.0
1167 -// }
1168 -
1169 - if (indexPath.section == 0) {
1170 -// TODO: Uncomment if we want to hide empty tiles again
1171 -// let sumRedeemed = totalCouponValue + totalCouponDiscount + unifiedCouponsDiscount
1172 -// if (self.dfyCoupons.count > 0 || self.unifiedCoupons.count > 0 || self.coupons.count > 0 || sumRedeemed > 0.0) {
1173 - return UITableView.automaticDimension
1174 -// } else {
1175 -// return 0.0
1176 -// }
1177 - } else if (indexPath.section == 1) {
1178 -// TODO: Uncomment if we want to show emptyView again
1179 -// if (self.showEmptyView == true) {
1180 -// return UITableView.automaticDimension
1181 -// } else {
1182 - return 0.0
1183 -// }
1184 - } else if (indexPath.section == 2) {
1185 - return UITableView.automaticDimension
1186 - }
1187 -// else if (indexPath.section == 2) {
1188 -// let sumRedeemed = totalCouponValue + totalCouponDiscount + unifiedCouponsDiscount
1189 -// if (sumRedeemed > 0.0) {
1190 -// return UITableView.automaticDimension
1191 -// } else {
1192 -// return 0.0
1193 -// }
1194 -// }
1195 - else if (indexPath.section == 3) {
1196 - if (swiftApi().getShowVouchersBanner() == "true" || swiftApi().getShowVouchersBanner() == "false") {
1197 - return UITableView.automaticDimension
1198 - } else {
1199 - return 0.0
1200 - }
1201 - } else if (indexPath.section == 4) {
1202 - if (self.showSpinner == true) {
1203 - return UITableView.automaticDimension
1204 - } else {
1205 - return 0.0
1206 - }
1207 - } else {
1208 - return 0.0
1209 - }
1210 - }
1211 -
1212 - public func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
1213 -// if (section == 0){
1214 -// return nil
1215 -//
1216 -// } else if (section == 1) {
1217 -// if (self.unifiedCoupons.count > 0) {
1218 -// let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 75))
1219 -// view.backgroundColor = .clear
1220 -//
1221 -// let titleLabel = UILabel(frame: CGRect(x: 20, y: 40, width: view.frame.width - 40, height: 20))
1222 -// titleLabel.font = UIFont(name: "BTCosmo-Bold", size: 19)
1223 -// titleLabel.textColor = UIColor(red: 0.00, green: 0.65, blue: 0.89, alpha: 1.00)
1224 -// titleLabel.text = "SUPERMARKET DEALS"
1225 -//
1226 -// view.addSubview(titleLabel)
1227 -// return view
1228 -// } else {
1229 -// return nil
1230 -// }
1231 -//
1232 -//
1233 -// } else if (section == 2) {
1234 -// if (self.dfyCoupons.count > 0) {
1235 -// let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 65))
1236 -// view.backgroundColor = .clear
1237 -//
1238 -// let imageView = UIImageView(frame: CGRect(x: 20, y: 30, width: view.frame.width / 2, height: 25))
1239 -// imageView.contentMode = .scaleAspectFit
1240 -//// imageView.backgroundColor = .red
1241 -//
1242 -// if let dfyHeaderImage = UIImage(named: "dfy_logo_colored", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) {
1243 -// imageView.image = dfyHeaderImage
1244 -// }
1245 -// view.addSubview(imageView)
1246 -//
1247 -// return view
1248 -//
1249 -// } else {
1250 -// return nil
1251 -// }
1252 -//
1253 -//
1254 -// } else if (section == 3) {
1255 -// if (self.coupons.count > 0) {
1256 -// // let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 71))
1257 -// let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 65))
1258 -// view.backgroundColor = .clear
1259 -//
1260 -// // let titleLabel = UILabel(frame: CGRect(x: 20, y: 40, width: view.frame.width - 40, height: 21))
1261 -// let titleLabel = UILabel(frame: CGRect(x: 20, y: 30, width: view.frame.width - 40, height: 20))
1262 -// titleLabel.font = UIFont(name: "BTCosmo-Bold", size: 19)
1263 -// titleLabel.textColor = UIColor(red: 0.00, green: 0.65, blue: 0.89, alpha: 1.00)
1264 -// titleLabel.text = "GIFTS FOR YOU"
1265 -//
1266 -// view.addSubview(titleLabel)
1267 -// return view
1268 -// } else {
1269 -// return nil
1270 -// }
1271 -//
1272 -// } else {
1273 -// return nil
1274 -// }
1275 -
1276 - if (section == 0) {
1277 -// if (self.dfyCoupons.count > 0 || self.unifiedCoupons.count > 0 || self.coupons.count > 0) {
1278 -// let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 70))
1279 -// view.backgroundColor = .clear
1280 -//
1281 -// let titleLabel = UILabel(frame: CGRect(x: 20, y: 20, width: view.frame.width - 40, height: 25))
1282 -//// titleLabel.font = UIFont(name: "PeridotPE-SBold", size: 21)
1283 -// titleLabel.font = UIFont(name: "BTCosmo-Bold", size: 19)
1284 -// titleLabel.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
1285 -// titleLabel.text = "Κουπόνια"
1286 -//
1287 -// view.addSubview(titleLabel)
1288 -// return view
1289 -// } else {
1290 - return nil
1291 -// }
1292 - } else if (section == 1) {
1293 - return nil
1294 - } else if (section == 2) {
1295 - return nil
1296 - } else if (section == 3) {
1297 -// if (swiftApi().getShowVouchersBanner() == "true" || swiftApi().getShowVouchersBanner() == "false") {
1298 -// let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 70))
1299 -// view.backgroundColor = .clear
1300 -
1301 -// let separatorView = UIView(frame: CGRect(x: 20, y: 25, width: tableView.frame.width - 40, height: 1))
1302 -// separatorView.backgroundColor = UIColor(red: 0.62, green: 0.62, blue: 0.61, alpha: 1.00)
1303 -//
1304 -// let titleLabel = UILabel(frame: CGRect(x: 20, y: 20, width: view.frame.width - 40, height: 25))
1305 -// titleLabel.font = UIFont(name: "PeridotPE-SBold", size: 21)
1306 -// titleLabel.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
1307 -// titleLabel.text = "Υπόλοιπο επιδότησης"
1308 -//
1309 -// view.addSubview(titleLabel)
1310 -// return view
1311 -// } else {
1312 - return nil
1313 -// }
1314 - } else if (section == 4) {
1315 - return nil
1316 - } else {
1317 - return nil
1318 - }
1319 -
1320 - }
1321 -
1322 - public func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
1323 -// if (section == 0) {
1324 -// return 0.0
1325 -//
1326 -// } else if (section == 1) {
1327 -// if (self.unifiedCoupons.count > 0) {
1328 -// return 75.0
1329 -// } else {
1330 -// return 0.0
1331 -// }
1332 -//
1333 -// } else if (section == 2) {
1334 -// if (self.dfyCoupons.count > 0) {
1335 -// return 68.0
1336 -// } else {
1337 -// return 0.0
1338 -// }
1339 -//
1340 -// } else if (section == 3) {
1341 -// if (self.coupons.count > 0) {
1342 -// return 65.0
1343 -// } else {
1344 -// return 0.0
1345 -// }
1346 -// } else {
1347 -// return 0.0
1348 -// }
1349 -
1350 - if (section == 0) {
1351 -// if (self.dfyCoupons.count > 0 || self.unifiedCoupons.count > 0 || self.coupons.count > 0) {
1352 -// return 70.0
1353 -// } else {
1354 - return 0.0
1355 -// }
1356 - } else if (section == 1) {
1357 - return 0.0
1358 - } else if (section == 2) {
1359 - return 0.0
1360 - } else if (section == 3) {
1361 -// if (swiftApi().getShowVouchersBanner() == "true" || swiftApi().getShowVouchersBanner() == "false") {
1362 -// return 70.0
1363 -// } else {
1364 - return 0.0
1365 -// }
1366 - } else if (section == 4) {
1367 - return 0.0
1368 - } else {
1369 - return 0.0
1370 - }
1371 - }
1372 -
1373 - public func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
1374 -// return CGFloat.leastNormalMagnitude
1375 - return 0.0
1376 - }
1377 -
1378 - public func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
1379 - return nil
1380 - }
1381 -
1382 - public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
1383 -
1384 -// if (indexPath.section == 0) {
1385 -// let cell = tableView.dequeueReusableCell(withIdentifier: "WalletBannersTableViewCellId", for: indexPath) as! WalletBannersTableViewCell
1386 -// cell.configureCell(totalCouponValue: self.totalCouponValue, totalCouponDiscount: self.totalCouponDiscount, unifiedCouponsDiscount: self.unifiedCouponsDiscount, forYouExpanded: self.forYouExpanded)
1387 -// return cell
1388 -//// let cell = tableView.dequeueReusableCell(withIdentifier: "WalletBadgesTableViewCellId", for: indexPath) as! WalletBadgesTableViewCell
1389 -//// cell.configureCell(totalCouponValue: self.totalCouponValue, totalCouponDiscount: self.totalCouponDiscount, unifiedCouponsDiscount: self.unifiedCouponsDiscount)
1390 -//// return cell
1391 -// } else if (indexPath.section == 1) {
1392 -// let cell = tableView.dequeueReusableCell(withIdentifier: "UnifiedCouponsTableViewCellId", for: indexPath) as! UnifiedCouponsTableViewCell
1393 -// cell.configureCell(coupon: unifiedCoupons[indexPath.row])
1394 -// return cell
1395 -//
1396 -// } else if (indexPath.section == 2) {
1397 -// let cell = tableView.dequeueReusableCell(withIdentifier: "ActiveCodeTableViewCellId", for: indexPath) as! ActiveCodeTableViewCell
1398 -//// cell.configureCell(coupon: coupons[indexPath.row])
1399 -// return cell
1400 -//
1401 -// } else {
1402 -// let cell = tableView.dequeueReusableCell(withIdentifier: "CouponsTableViewCellId", for: indexPath) as! CouponsTableViewCell
1403 -// cell.configureCell(coupon: coupons[indexPath.row])
1404 -// return cell
1405 -// }
1406 -
1407 -
1408 - if (indexPath.section == 0) {
1409 - let cell = tableView.dequeueReusableCell(withIdentifier: "WalletActiveCouponsScrollTableViewCellId", for: indexPath) as! WalletActiveCouponsScrollTableViewCell
1410 -// cell.configureCell(dfyCount: self.dfyCoupons.count, smCount: self.unifiedCoupons.count, gfyCount: self.coupons.count, boxCount: self.boxCoupons.count)
1411 -// let smCount = self.unifiedCoupons.count + self.smCoupons.count
1412 - let smCount = 1
1413 - cell.configureCell(dfyCount: self.dfyCoupons.count, smCount: smCount, gfyCount: self.coupons.count, boxCount: 0)
1414 - cell.parent = self
1415 - return cell
1416 -
1417 - } else if (indexPath.section == 1) {
1418 - let cell = tableView.dequeueReusableCell(withIdentifier: "WalletEmptyViewTableViewCellId", for: indexPath) as! WalletEmptyViewTableViewCell
1419 - return cell
1420 - } else if (indexPath.section == 2) {
1421 - let cell = tableView.dequeueReusableCell(withIdentifier: "WalletQuestionnaireBannerTableViewCellId", for: indexPath) as! WalletQuestionnaireBannerTableViewCell
1422 - cell.configureCell(isCentered: self.showEmptyView)
1423 - return cell
1424 - }
1425 -// else if (indexPath.section == 2) {
1426 -// let cell = tableView.dequeueReusableCell(withIdentifier: "WalletHistoryBannerTableViewCellId", for: indexPath) as! WalletHistoryBannerTableViewCell
1427 -// return cell
1428 -// }
1429 - else if (indexPath.section == 3) {
1430 - let cell = tableView.dequeueReusableCell(withIdentifier: "WalletVouchersBannerTableViewCellId", for: indexPath) as! WalletVouchersBannerTableViewCell
1431 - cell.configureCell(showSeparator: self.showActiveCouponsBanners, active: swiftApi().getShowVouchersBanner() == "true")
1432 - return cell
1433 - } else {
1434 - let cell = tableView.dequeueReusableCell(withIdentifier: "WalletSpinnerTableViewCellId", for: indexPath) as! WalletSpinnerTableViewCell
1435 - return cell
1436 - }
1437 -
1438 - }
1439 -
1440 - public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
1441 -// if (indexPath.section == 0) {
1442 -// // Do nothing
1443 -//
1444 -// } else if (indexPath.section == 1) {
1445 -// // TODO: Add trackers
1446 -//// let couponSetData: swiftApi.CouponSetItemModel? = coupons[indexPath.row].couponset_data
1447 -//// let couponName = couponSetData?.name ?? ""
1448 -//// swiftApi().logTrackersEvent("click", ("Coupon:" + couponName))
1449 -//
1450 -// let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
1451 -// let vc = storyboard.instantiateViewController(withIdentifier: "UnifiedCouponBarcodeViewController") as! SwiftWarplyFramework.UnifiedCouponBarcodeViewController
1452 -// vc.coupon = unifiedCoupons[indexPath.row]
1453 -// vc.isFromWallet = true
1454 -// self.navigationController?.pushViewController(vc, animated: true)
1455 -//
1456 -// } else if (indexPath.section == 2) {
1457 -// print("Active DFY coupon banner Tapped!")
1458 -//
1459 -// swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "ActiveDealsBanner"))
1460 -//
1461 -// let couponDetails = swiftApi.ActiveDFYCouponEventModel()
1462 -// couponDetails._isPressed = true
1463 -// SwiftEventBus.post("dfy_coupon_details", sender: couponDetails)
1464 -//
1465 -// } else if (indexPath.section == 3) {
1466 -// let couponSetData: swiftApi.CouponSetItemModel? = coupons[indexPath.row].couponset_data
1467 -// let couponName = couponSetData?.name ?? ""
1468 -// swiftApi().logTrackersEvent("click", ("Coupon:" + couponName))
1469 -//
1470 -// let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
1471 -// let vc = storyboard.instantiateViewController(withIdentifier: "CouponBarcodeViewController") as! SwiftWarplyFramework.CouponBarcodeViewController
1472 -// vc.coupon = coupons[indexPath.row]
1473 -// vc.isFromWallet = true
1474 -// self.navigationController?.pushViewController(vc, animated: true)
1475 -// } else {
1476 -// // Do nothing
1477 -// }
1478 -
1479 - if (indexPath.section == 0) {
1480 - // Do nothing - Each button is handled differently
1481 -
1482 - } else if (indexPath.section == 1) {
1483 - // Do nothing
1484 - } else if (indexPath.section == 2) {
1485 - swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "Questionnaire"))
1486 -
1487 - swiftApi().openQuestionnaire(self);
1488 -
1489 - }
1490 -// else if (indexPath.section == 2) {
1491 -// let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
1492 -// firebaseEvent._eventName = "did_tap_history_badge"
1493 -// firebaseEvent.setParameter = ("screen", "Loyalty Wallet")
1494 -// SwiftEventBus.post("firebase", sender: firebaseEvent)
1495 -//
1496 -// swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "LoyaltyHistoryBadge"))
1497 -//
1498 -// let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
1499 -// let vc = storyboard.instantiateViewController(withIdentifier: "LoyaltyHistoryViewController") as! SwiftWarplyFramework.LoyaltyHistoryViewController
1500 -// self.navigationController?.pushViewController(vc, animated: true)
1501 -//
1502 -// }
1503 - else if (indexPath.section == 3) {
1504 - let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
1505 - firebaseEvent._eventName = "did_tap_vouchers_badge"
1506 - firebaseEvent.setParameter = ("screen", "Loyalty Wallet")
1507 - SwiftEventBus.post("firebase", sender: firebaseEvent)
1508 -
1509 - swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "VouchersBadge"))
1510 -
1511 - SwiftEventBus.post("vouchers_banner_pressed")
1512 -
1513 - } else if (indexPath.section == 4) {
1514 - // Do nothing
1515 - } else {
1516 - // Do nothing
1517 - }
1518 -
1519 - }
1520 -}
1 -//
2 -// WalletVouchersBannerTableViewCell.swift
3 -// SwiftWarplyFramework
4 -//
5 -// Created by Manos Chorianopoulos on 23/10/23.
6 -//
7 -
8 -import UIKit
9 -
10 -@objc public class WalletVouchersBannerTableViewCell: UITableViewCell {
11 - @IBOutlet weak var separatorView: UIView!
12 - @IBOutlet weak var separatorTopSpace: NSLayoutConstraint!
13 - @IBOutlet weak var sectionTitleLabel: UILabel!
14 - @IBOutlet weak var voucherBannerView: UIView!
15 - @IBOutlet weak var voucherBannerIconImage: UIImageView!
16 - @IBOutlet weak var voucherBannerLabel: UILabel!
17 - @IBOutlet weak var voucherBannerArrowImage: UIImageView!
18 - @IBOutlet weak var voucherCountView: UIView!
19 -
20 - let language = swiftApi().getLanguage()
21 -
22 - public override func awakeFromNib() {
23 - super.awakeFromNib()
24 - // Initialization code
25 -
26 - sectionTitleLabel.text = language == "en" ? "Subsidy balance" : "Υπόλοιπο επιδότησης"
27 -
28 - voucherBannerView.layer.cornerRadius = 16.0
29 - voucherBannerView.layer.borderWidth = 1
30 - voucherBannerView.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor
31 -
32 - // Add shadow
33 - voucherBannerView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
34 - voucherBannerView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
35 - voucherBannerView.layer.shadowOpacity = 1.0
36 - voucherBannerView.layer.shadowRadius = 1.0
37 -
38 - voucherBannerIconImage.image = UIImage(named: "wallet_voucher", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
39 - voucherBannerArrowImage.image = UIImage(named: "arrow_right_black", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
40 -
41 -// voucherBannerLabel.text = "Ενημερώσου για το υπόλοιπο επιδότησης"
42 -
43 - voucherCountView.layer.cornerRadius = 4.0
44 - voucherCountView.backgroundColor = UIColor(red: 0.92, green: 0.75, blue: 0.41, alpha: 1.00)
45 - }
46 -
47 - public override func setSelected(_ selected: Bool, animated: Bool) {
48 - super.setSelected(selected, animated: animated)
49 -
50 - // Configure the view for the selected state
51 - }
52 -
53 - func configureCell(showSeparator: Bool, active: Bool) {
54 - if (showSeparator == true) {
55 - separatorView.isHidden = false
56 - separatorTopSpace.constant = 25
57 -
58 - } else {
59 - separatorView.isHidden = true
60 - separatorTopSpace.constant = 0
61 - }
62 -
63 - if (active == true) {
64 - voucherBannerView.backgroundColor = .white
65 - voucherBannerIconImage.image = voucherBannerIconImage.image?.withRenderingMode(.alwaysTemplate)
66 - voucherBannerIconImage.tintColor = UIColor(red: 0.00, green: 0.65, blue: 0.89, alpha: 1.00)
67 - voucherBannerLabel.text = language == "en" ? "Check the available balance" : "Δες το διαθέσιμο υπόλοιπο"
68 - voucherBannerLabel.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
69 - voucherBannerLabel.frame.size.width = voucherBannerLabel.intrinsicContentSize.width
70 - voucherCountView.isHidden = true
71 -
72 - } else {
73 - voucherBannerView.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1.00)
74 - voucherBannerIconImage.image = voucherBannerIconImage.image?.withRenderingMode(.alwaysTemplate)
75 - voucherBannerIconImage.tintColor = UIColor(red: 0.52, green: 0.52, blue: 0.52, alpha: 1.00)
76 - voucherBannerLabel.text = language == "en" ? "Available balance" : "Διαθέσιμο υπόλοιπο"
77 - voucherBannerLabel.textColor = UIColor(red: 0.52, green: 0.52, blue: 0.52, alpha: 1.00)
78 - voucherBannerLabel.frame.size.width = voucherBannerLabel.intrinsicContentSize.width
79 - voucherCountView.isHidden = false
80 - }
81 - }
82 -
83 -}
...@@ -303,8 +303,6 @@ WL_VERSION_INTERFACE() ...@@ -303,8 +303,6 @@ WL_VERSION_INTERFACE()
303 303
304 - (BOOL)getInboxWithSuccessBlock:(void (^)(NSArray *list))success failureBlock:(void (^)(NSError *error))failure; 304 - (BOOL)getInboxWithSuccessBlock:(void (^)(NSArray *list))success failureBlock:(void (^)(NSError *error))failure;
305 305
306 -- (BOOL)getInbox2WithSuccessBlock:(void (^)(NSArray *list))success failureBlock:(void (^)(NSError *error))failure;
307 -
308 - (BOOL)getCampaignsWithSuccessBlock:(NSString*)language :(NSDictionary*)filters :(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure; 306 - (BOOL)getCampaignsWithSuccessBlock:(NSString*)language :(NSDictionary*)filters :(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure;
309 307
310 - (void)getCampaignsPersonalizedWithSuccessBlock:(NSString*)language :(NSDictionary*)filters :(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure; 308 - (void)getCampaignsPersonalizedWithSuccessBlock:(NSString*)language :(NSDictionary*)filters :(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure;
...@@ -345,23 +343,8 @@ WL_VERSION_INTERFACE() ...@@ -345,23 +343,8 @@ WL_VERSION_INTERFACE()
345 343
346 - (void)changePasswordWithSuccessBlock:(NSString*)oldPassword andNewPassword:(NSString*)newPassword :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; 344 - (void)changePasswordWithSuccessBlock:(NSString*)oldPassword andNewPassword:(NSString*)newPassword :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
347 345
348 -- (void)getProfileWithSuccessBlock :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
349 -
350 - (void)getMarketPassDetailsWithSuccessBlock:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; 346 - (void)getMarketPassDetailsWithSuccessBlock:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
351 347
352 -- (void)postEventWithSuccessBlock :(NSString*)Session_ID :(NSString*)OfferAudienceLevel :(NSString*)msisdn :(NSString*)UACIOfferTrackingCode :(NSString*)OFFERCODE1 :(NSString*)SCORE :(NSString*)ZONE :(NSString*)WAVE :(NSString*)VALIDITY :(NSString*)TREATMENT_CODE :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
353 -
354 -
355 -- (void)getPacingDetailsWithSuccessBlock :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
356 -
357 -- (void)setPacingDetailsWithSuccessBlock:(NSNumber*)steps :(NSString*)date :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
358 -
359 -- (void)editProfileWithSuccessBlock:(NSString*)firstName andLastName:(NSString*)lastName andEmail:(NSString*)email andSalutation:(NSString*)salutation andMsisdn:(NSString*)msisdn
360 - andNickname:(NSString*)nickname andGender:(NSString*)gender andBirthday:(NSString*)birthday andNameDay:(NSString*)nameday andTaxID:(NSString*)taxID andProfileMetadata:(NSDictionary*)profileMetadata optin:(NSNumber*) optin newsLetter:(NSNumber*)newsletter
361 - andSMS:(NSNumber*)sms andSegmentation:(NSNumber*)segmentation andSMSSegmentation:(NSNumber*)smsSegmentation :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
362 -
363 -- (void)consumerIntegrationWithSuccessBlock:(NSNumber*)nonTelco :(NSNumber*)acceptedConsent :(NSArray*)msisdnList :(NSString*)guid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
364 -
365 - (void)changeProfileImageWithSuccessBlock:(NSString*)image andUserId:(NSString*)userId :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; 348 - (void)changeProfileImageWithSuccessBlock:(NSString*)image andUserId:(NSString*)userId :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
366 349
367 350
...@@ -371,22 +354,12 @@ WL_VERSION_INTERFACE() ...@@ -371,22 +354,12 @@ WL_VERSION_INTERFACE()
371 354
372 - (void)deleteCardWithSuccessBlock:(NSString*)token :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; 355 - (void)deleteCardWithSuccessBlock:(NSString*)token :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
373 356
374 -- (void)getCouponsWithSuccessBlock:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
375 -
376 - (void)getCouponsUniversalWithSuccessBlock:(NSString*)language :(NSString*)couponsetType :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; 357 - (void)getCouponsUniversalWithSuccessBlock:(NSString*)language :(NSString*)couponsetType :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
377 358
378 -- (void)createUnifiedCouponWithSuccessBlock:(NSArray*)couponCodes :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
379 -
380 -- (void)getUnifiedCouponsWithSuccessBlock:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
381 -
382 - (void)getTransactionHistoryWithSuccessBlock:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; 359 - (void)getTransactionHistoryWithSuccessBlock:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
383 360
384 - (void)getPointsHistoryWithSuccessBlock:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; 361 - (void)getPointsHistoryWithSuccessBlock:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
385 362
386 -- (void)getSharingHistoryWithSuccessBlock:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
387 -
388 -- (void)getMarketSharingHistoryWithSuccessBlock:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
389 -
390 - (void)verifyTicketWithSuccessBlock:(NSString*)guid :(NSString*)ticket :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; 363 - (void)verifyTicketWithSuccessBlock:(NSString*)guid :(NSString*)ticket :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
391 364
392 - (void)getCosmoteUserWithSuccessBlock:(NSString*)guid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; 365 - (void)getCosmoteUserWithSuccessBlock:(NSString*)guid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
...@@ -413,30 +386,12 @@ WL_VERSION_INTERFACE() ...@@ -413,30 +386,12 @@ WL_VERSION_INTERFACE()
413 386
414 - (void) getAvailableCouponsWithSuccessBlock:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; 387 - (void) getAvailableCouponsWithSuccessBlock:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
415 388
416 -- (void) getCouponSetsDealsWithSuccessBlock:(NSNumber*) active andVisible:(NSNumber*) visible andUuids:(NSArray*) uuids :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
417 -
418 -- (void) cancelUnifiedCouponWithSuccessBlock:(NSString*) transactionId :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
419 -
420 -- (void) redeemCouponSetsWithSuccessBlock:(NSString*) uuid :(NSString*)communication_uuid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
421 -
422 -- (void) redeemCouponSetsWithSuccessBlock:(NSString*) uuid :(NSString*)communication_uuid :(NSString*)user_msisdn :(NSString*)businessService :(NSString*)offerName :(NSString*)productType :(NSString*)provDuration :(NSString*)noOfRecurrance :(NSString*)price :(NSString*)discount :(NSString*)voiceCategory :(NSString*)dataCategory :(NSString*)minsValue :(NSString*)dataValue :(NSString*)provStepValueMins :(NSString*)OfferAudienceLevel :(NSString*)UACIOfferTrackingCode :(NSString*)OFFERCODE1 :(NSString*)SCORE :(NSString*)ZONE :(NSString*)WAVE :(NSString*)VALIDITY :(NSString*)TREATMENT_CODE :(NSString*)ccms_session_id :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
423 -
424 -- (void) cosmoteCouponSharingWithSuccessBlock:(NSString*) coupon :(NSString*)sender :(NSString*)receiver :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
425 -
426 -- (void) cosmoteSharingWithSuccessBlock:(NSString*) sharingId :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
427 -
428 -- (void) cosmoteRetrieveSharingWithSuccessBlock:(NSString*) sharingId :(NSNumber*)accept :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
429 -
430 -- (void) submitOrderWithSuccessBlock:(NSString*) campaign_session_uuid :(NSString*)user_msisdn :(NSString*)businessService :(NSString*)offerName :(NSString*)productType :(NSString*)provDuration :(NSString*)noOfRecurrance :(NSString*)price :(NSString*)discount :(NSString*)voiceCategory :(NSString*)dataCategory :(NSString*)minsValue :(NSString*)dataValue :(NSString*)provStepValueMins :(NSString*)OfferAudienceLevel :(NSString*)UACIOfferTrackingCode :(NSString*)OFFERCODE1 :(NSString*)SCORE :(NSString*)ZONE :(NSString*)WAVE :(NSString*)VALIDITY :(NSString*)TREATMENT_CODE :(NSString*)ccms_session_id :(NSString*)notificationMessage :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
431 -
432 - (void) validateCouponWithSuccessBlock:(NSString*) coupon :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; 389 - (void) validateCouponWithSuccessBlock:(NSString*) coupon :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
433 390
434 - (void)loginCosmoteWithSuccessBlock:(NSString*)guid andAppUuid:(NSString*)appUuid andTicket:(NSString*)ticket :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; 391 - (void)loginCosmoteWithSuccessBlock:(NSString*)guid andAppUuid:(NSString*)appUuid andTicket:(NSString*)ticket :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
435 392
436 - (void)getSingleCampaignWithSuccessBlock:(NSString *)sessionUuid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; 393 - (void)getSingleCampaignWithSuccessBlock:(NSString *)sessionUuid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
437 394
438 -- (void)getMapDataWithSuccessBlock:(NSString *)language :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
439 -
440 /*! 395 /*!
441 @abstract Get the full page add accordint to the display_type of a campaign. 396 @abstract Get the full page add accordint to the display_type of a campaign.
442 @attributeblock successBlock This block is called when getInbox is sucessful and allOffers is empty or nil and returns an array with the available WLInboxItem items. Otherwise, the allOffers array is filtered. 397 @attributeblock successBlock This block is called when getInbox is sucessful and allOffers is empty or nil and returns an array with the available WLInboxItem items. Otherwise, the allOffers array is filtered.
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.