Manos Chorianopoulos

PopupMerchantCategoriesViewController fixes

...@@ -6595,19 +6595,19 @@ ...@@ -6595,19 +6595,19 @@
6595 <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> 6595 <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
6596 <subviews> 6596 <subviews>
6597 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="JzI-pZ-MNc"> 6597 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="JzI-pZ-MNc">
6598 - <rect key="frame" x="0.0" y="672" width="414" height="224"/> 6598 + <rect key="frame" x="0.0" y="662" width="414" height="234"/>
6599 <subviews> 6599 <subviews>
6600 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jEM-IU-eiM" userLabel="Header View"> 6600 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jEM-IU-eiM" userLabel="Header View">
6601 - <rect key="frame" x="20" y="15" width="374" height="20"/> 6601 + <rect key="frame" x="20" y="15" width="374" height="30"/>
6602 <subviews> 6602 <subviews>
6603 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Βρες το προϊον στα supermarket" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ybq-Lc-ajo"> 6603 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Βρες το προϊον στα supermarket" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ybq-Lc-ajo">
6604 - <rect key="frame" x="0.0" y="0.0" width="324" height="20"/> 6604 + <rect key="frame" x="0.0" y="5" width="324" height="20"/>
6605 <fontDescription key="fontDescription" name="BTCosmo-Bold" family="BTCosmo" pointSize="17"/> 6605 <fontDescription key="fontDescription" name="BTCosmo-Bold" family="BTCosmo" pointSize="17"/>
6606 <color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> 6606 <color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
6607 <nil key="highlightedColor"/> 6607 <nil key="highlightedColor"/>
6608 </label> 6608 </label>
6609 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xAb-b2-o7k"> 6609 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xAb-b2-o7k">
6610 - <rect key="frame" x="344" y="-5" width="30" height="30"/> 6610 + <rect key="frame" x="344" y="0.0" width="30" height="30"/>
6611 <constraints> 6611 <constraints>
6612 <constraint firstAttribute="width" constant="30" id="l9h-yH-nF9"/> 6612 <constraint firstAttribute="width" constant="30" id="l9h-yH-nF9"/>
6613 <constraint firstAttribute="height" constant="30" id="pBV-Cd-ego"/> 6613 <constraint firstAttribute="height" constant="30" id="pBV-Cd-ego"/>
...@@ -6622,16 +6622,16 @@ ...@@ -6622,16 +6622,16 @@
6622 </subviews> 6622 </subviews>
6623 <color key="backgroundColor" systemColor="systemBackgroundColor"/> 6623 <color key="backgroundColor" systemColor="systemBackgroundColor"/>
6624 <constraints> 6624 <constraints>
6625 + <constraint firstAttribute="bottom" secondItem="xAb-b2-o7k" secondAttribute="bottom" id="0GW-CL-k5M"/>
6625 <constraint firstItem="Ybq-Lc-ajo" firstAttribute="leading" secondItem="jEM-IU-eiM" secondAttribute="leading" id="46I-7U-Ulb"/> 6626 <constraint firstItem="Ybq-Lc-ajo" firstAttribute="leading" secondItem="jEM-IU-eiM" secondAttribute="leading" id="46I-7U-Ulb"/>
6626 - <constraint firstItem="xAb-b2-o7k" firstAttribute="centerY" secondItem="jEM-IU-eiM" secondAttribute="centerY" id="GcV-M2-J4V"/>
6627 - <constraint firstAttribute="bottom" secondItem="Ybq-Lc-ajo" secondAttribute="bottom" id="WOw-4M-kDQ"/>
6628 <constraint firstItem="xAb-b2-o7k" firstAttribute="leading" secondItem="Ybq-Lc-ajo" secondAttribute="trailing" constant="20" id="ZeO-pQ-Lew"/> 6627 <constraint firstItem="xAb-b2-o7k" firstAttribute="leading" secondItem="Ybq-Lc-ajo" secondAttribute="trailing" constant="20" id="ZeO-pQ-Lew"/>
6628 + <constraint firstItem="xAb-b2-o7k" firstAttribute="top" secondItem="jEM-IU-eiM" secondAttribute="top" id="beT-Hv-kyp"/>
6629 <constraint firstAttribute="trailing" secondItem="xAb-b2-o7k" secondAttribute="trailing" id="dUI-5D-lZg"/> 6629 <constraint firstAttribute="trailing" secondItem="xAb-b2-o7k" secondAttribute="trailing" id="dUI-5D-lZg"/>
6630 - <constraint firstItem="Ybq-Lc-ajo" firstAttribute="top" secondItem="jEM-IU-eiM" secondAttribute="top" id="rY9-wm-h5A"/> 6630 + <constraint firstItem="Ybq-Lc-ajo" firstAttribute="centerY" secondItem="jEM-IU-eiM" secondAttribute="centerY" id="hcl-mU-jW4"/>
6631 </constraints> 6631 </constraints>
6632 </view> 6632 </view>
6633 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jn0-7E-Vpz"> 6633 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jn0-7E-Vpz">
6634 - <rect key="frame" x="51" y="50" width="312" height="55"/> 6634 + <rect key="frame" x="51" y="60" width="312" height="55"/>
6635 <constraints> 6635 <constraints>
6636 <constraint firstAttribute="height" constant="55" id="8hL-nI-pET"/> 6636 <constraint firstAttribute="height" constant="55" id="8hL-nI-pET"/>
6637 <constraint firstAttribute="width" constant="312" id="HyB-dA-8lF"/> 6637 <constraint firstAttribute="width" constant="312" id="HyB-dA-8lF"/>
...@@ -6643,11 +6643,10 @@ ...@@ -6643,11 +6643,10 @@
6643 </state> 6643 </state>
6644 <connections> 6644 <connections>
6645 <action selector="mapButtonAction:" destination="ecE-vH-QNF" eventType="touchUpInside" id="ouv-Tg-8VM"/> 6645 <action selector="mapButtonAction:" destination="ecE-vH-QNF" eventType="touchUpInside" id="ouv-Tg-8VM"/>
6646 - <action selector="redeemButtomAction:" destination="CDt-eI-msA" eventType="touchUpInside" id="rJb-HZ-0dN"/>
6647 </connections> 6646 </connections>
6648 </button> 6647 </button>
6649 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="wXX-H2-cJy"> 6648 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="wXX-H2-cJy">
6650 - <rect key="frame" x="51" y="127" width="312" height="55"/> 6649 + <rect key="frame" x="51" y="137" width="312" height="55"/>
6651 <constraints> 6650 <constraints>
6652 <constraint firstAttribute="width" constant="312" id="IrT-Tj-Tg4"/> 6651 <constraint firstAttribute="width" constant="312" id="IrT-Tj-Tg4"/>
6653 <constraint firstAttribute="height" constant="55" id="cag-PL-ges"/> 6652 <constraint firstAttribute="height" constant="55" id="cag-PL-ges"/>
...@@ -6659,7 +6658,6 @@ ...@@ -6659,7 +6658,6 @@
6659 </state> 6658 </state>
6660 <connections> 6659 <connections>
6661 <action selector="eshopsButtonAction:" destination="ecE-vH-QNF" eventType="touchUpInside" id="vea-u7-83s"/> 6660 <action selector="eshopsButtonAction:" destination="ecE-vH-QNF" eventType="touchUpInside" id="vea-u7-83s"/>
6662 - <action selector="mapButtonAction:" destination="CDt-eI-msA" eventType="touchUpInside" id="rjN-wt-ZaQ"/>
6663 </connections> 6661 </connections>
6664 </button> 6662 </button>
6665 </subviews> 6663 </subviews>
...@@ -6699,7 +6697,7 @@ ...@@ -6699,7 +6697,7 @@
6699 <outlet property="eshopsButton" destination="wXX-H2-cJy" id="Rge-nz-CFC"/> 6697 <outlet property="eshopsButton" destination="wXX-H2-cJy" id="Rge-nz-CFC"/>
6700 <outlet property="headerLabel" destination="Ybq-Lc-ajo" id="LDn-ay-yzp"/> 6698 <outlet property="headerLabel" destination="Ybq-Lc-ajo" id="LDn-ay-yzp"/>
6701 <outlet property="mapButton" destination="jn0-7E-Vpz" id="HR8-gv-jkU"/> 6699 <outlet property="mapButton" destination="jn0-7E-Vpz" id="HR8-gv-jkU"/>
6702 - <outlet property="popupView" destination="z3G-LR-Caw" id="iPa-kN-AmH"/> 6700 + <outlet property="popupView" destination="JzI-pZ-MNc" id="0g5-f3-d22"/>
6703 </connections> 6701 </connections>
6704 </viewController> 6702 </viewController>
6705 <placeholder placeholderIdentifier="IBFirstResponder" id="OwD-fu-wY3" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/> 6703 <placeholder placeholderIdentifier="IBFirstResponder" id="OwD-fu-wY3" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
......
...@@ -7,6 +7,12 @@ ...@@ -7,6 +7,12 @@
7 7
8 import UIKit 8 import UIKit
9 9
10 +// Define a protocol
11 +protocol PopupMerchantCategoriesViewControllerDelegate: AnyObject {
12 + func didTapMapButton()
13 + func didTapEshopsButton()
14 +}
15 +
10 class PopupMerchantCategoriesViewController: UIViewController { 16 class PopupMerchantCategoriesViewController: UIViewController {
11 @IBOutlet weak var popupView: UIView! 17 @IBOutlet weak var popupView: UIView!
12 @IBOutlet weak var headerLabel: UILabel! 18 @IBOutlet weak var headerLabel: UILabel!
...@@ -16,6 +22,9 @@ class PopupMerchantCategoriesViewController: UIViewController { ...@@ -16,6 +22,9 @@ class PopupMerchantCategoriesViewController: UIViewController {
16 22
17 public var headerText: String? = "" 23 public var headerText: String? = ""
18 24
25 + // Delegate variable
26 + weak var delegate: PopupMerchantCategoriesViewControllerDelegate?
27 +
19 override func viewDidLoad() { 28 override func viewDidLoad() {
20 super.viewDidLoad() 29 super.viewDidLoad()
21 30
...@@ -32,14 +41,14 @@ class PopupMerchantCategoriesViewController: UIViewController { ...@@ -32,14 +41,14 @@ class PopupMerchantCategoriesViewController: UIViewController {
32 headerLabel.isHidden = true 41 headerLabel.isHidden = true
33 42
34 mapButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 17) 43 mapButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 17)
35 - mapButton.setTitle("Βρες το στα supermarket", for: .normal) 44 + mapButton.setTitle("Δες τα καταστήματα στο χάρτη", for: .normal)
36 mapButton.setTitleColor(.white, for: .normal) 45 mapButton.setTitleColor(.white, for: .normal)
37 mapButton.backgroundColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00) 46 mapButton.backgroundColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00)
38 mapButton.layer.cornerRadius = 16.0 47 mapButton.layer.cornerRadius = 16.0
39 mapButton.frame = CGRect(x: 0.0, y: 0.0, width: 312, height: 55) 48 mapButton.frame = CGRect(x: 0.0, y: 0.0, width: 312, height: 55)
40 49
41 eshopsButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 17) 50 eshopsButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 17)
42 - eshopsButton.setTitle(ώρισέ το", for: .normal) 51 + eshopsButton.setTitle(ες τα eshop", for: .normal)
43 eshopsButton.setTitleColor(UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00), for: .normal) 52 eshopsButton.setTitleColor(UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00), for: .normal)
44 eshopsButton.layer.cornerRadius = 15.0 53 eshopsButton.layer.cornerRadius = 15.0
45 eshopsButton.frame = CGRect(x: 0.0, y: 0.0, width: 312, height: 55) 54 eshopsButton.frame = CGRect(x: 0.0, y: 0.0, width: 312, height: 55)
...@@ -48,34 +57,28 @@ class PopupMerchantCategoriesViewController: UIViewController { ...@@ -48,34 +57,28 @@ class PopupMerchantCategoriesViewController: UIViewController {
48 eshopsButton.layer.borderColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00).cgColor 57 eshopsButton.layer.borderColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00).cgColor
49 } 58 }
50 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 +
51 // MARK: - UIButton Actions 70 // MARK: - UIButton Actions
52 @IBAction func closeButtonAction(_ sender: Any) { 71 @IBAction func closeButtonAction(_ sender: Any) {
53 self.dismiss(animated: true, completion: {}) 72 self.dismiss(animated: true, completion: {})
54 } 73 }
55 74
56 @IBAction func mapButtonAction(_ sender: Any) { 75 @IBAction func mapButtonAction(_ sender: Any) {
57 - swiftApi().logTrackersEvent("click", "SeeShops") 76 + self.dismiss(animated: true, completion: {})
58 - 77 + mapButtonTapped()
59 - let vc = SwiftWarplyFramework.MapsViewController(nibName: "MapsViewController", bundle: Bundle(for: MyEmptyClass.self))
60 -// vc.couponSet = coupon?.couponset_data
61 - vc.isMarket = true
62 - self.navigationController?.pushViewController(vc, animated: true)
63 -
64 } 78 }
65 79
66 @IBAction func eshopsButtonAction(_ sender: Any) { 80 @IBAction func eshopsButtonAction(_ sender: Any) {
67 - 81 + self.dismiss(animated: true, completion: {})
68 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self)) 82 + eshopsButtonTapped()
69 - if let popupVC = storyboard.instantiateViewController(withIdentifier: "PopupMerchantsViewController") as? SwiftWarplyFramework.PopupMerchantsViewController {
70 - popupVC.modalPresentationStyle = .overCurrentContext
71 - popupVC.modalTransitionStyle = .crossDissolve
72 -// popupVC.coupon = coupon
73 - popupVC.headerText = "Δες τα eshop"
74 - popupVC.buttonTitle = "Δες το eshop"
75 -// popupVC.buttonIcon = "shopping_cart"
76 - popupVC.footerText = "Η διαθεσιμότητα ενδέχεται να διαφέρει ανάλογα με την τοποθεσία."
77 -
78 - self.present(popupVC, animated: true, completion: nil)
79 - }
80 } 83 }
81 } 84 }
......
...@@ -165,6 +165,7 @@ import SwiftEventBus ...@@ -165,6 +165,7 @@ import SwiftEventBus
165 popupVC.modalPresentationStyle = .overCurrentContext 165 popupVC.modalPresentationStyle = .overCurrentContext
166 popupVC.modalTransitionStyle = .crossDissolve 166 popupVC.modalTransitionStyle = .crossDissolve
167 // popupVC.coupon = coupon 167 // popupVC.coupon = coupon
168 + popupVC.delegate = self
168 169
169 self.present(popupVC, animated: true, completion: nil) 170 self.present(popupVC, animated: true, completion: nil)
170 } 171 }
...@@ -369,3 +370,32 @@ extension UnifiedCouponBarcodeViewController: UITableViewDelegate, UITableViewDa ...@@ -369,3 +370,32 @@ extension UnifiedCouponBarcodeViewController: UITableViewDelegate, UITableViewDa
369 } 370 }
370 371
371 } 372 }
373 +
374 +// MARK: - MerchantTableViewCellDelegate
375 +extension UnifiedCouponBarcodeViewController: PopupMerchantCategoriesViewControllerDelegate {
376 +
377 + func didTapMapButton() {
378 + swiftApi().logTrackersEvent("click", "SeeShops")
379 +
380 + let vc = SwiftWarplyFramework.MapsViewController(nibName: "MapsViewController", bundle: Bundle(for: MyEmptyClass.self))
381 +// vc.couponSet = coupon?.couponset_data
382 + vc.isMarket = true
383 + self.navigationController?.pushViewController(vc, animated: true)
384 + }
385 +
386 + func didTapEshopsButton() {
387 + let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
388 + if let popupVC = storyboard.instantiateViewController(withIdentifier: "PopupMerchantsViewController") as? SwiftWarplyFramework.PopupMerchantsViewController {
389 + popupVC.modalPresentationStyle = .overCurrentContext
390 + popupVC.modalTransitionStyle = .crossDissolve
391 +// popupVC.coupon = coupon
392 + popupVC.headerText = "Δες τα eshop"
393 + popupVC.buttonTitle = "Δες το eshop"
394 +// popupVC.buttonIcon = "shopping_cart"
395 + popupVC.footerText = "Η διαθεσιμότητα ενδέχεται να διαφέρει ανάλογα με την τοποθεσία."
396 +
397 + self.present(popupVC, animated: true, completion: nil)
398 + }
399 + }
400 +
401 +}
......