Manos Chorianopoulos

UnifiedCouponBarcodeVC delete old code

......@@ -2913,9 +2913,6 @@
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="1tN-9F-yxg" userLabel="Main View">
<rect key="frame" x="0.0" y="48" width="414" height="848"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="coupons_scrollview_white" translatesAutoresizingMaskIntoConstraints="NO" id="Leh-kL-DF1">
<rect key="frame" x="0.0" y="0.0" width="414" height="852"/>
</imageView>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="1" estimatedSectionFooterHeight="-1" contentViewInsetsToSafeArea="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Jsn-Je-71G">
<rect key="frame" x="0.0" y="0.0" width="414" height="848"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
......@@ -3355,263 +3352,14 @@
<outlet property="delegate" destination="kZo-uj-MVp" id="Gfo-Do-Bkw"/>
</connections>
</tableView>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="F2x-ch-ng3">
<rect key="frame" x="0.0" y="5" width="414" height="847"/>
<subviews>
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="h6B-3P-USu">
<rect key="frame" x="0.0" y="0.0" width="414" height="852"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="jbu-lq-22w">
<rect key="frame" x="0.0" y="0.0" width="414" height="200"/>
<constraints>
<constraint firstAttribute="height" constant="200" id="qtq-sH-2GF"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Εκπτωτικό κουπόνι COSMOTE SuperMarket Deals!" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XEh-1k-bk7">
<rect key="frame" x="20" y="220" width="374" height="34"/>
<fontDescription key="fontDescription" name="BTCosmo-Bold" family="BTCosmo" pointSize="17"/>
<color key="textColor" red="0.12941176470588234" green="0.12941176470588234" blue="0.12941176470588234" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Χρησιμοποίησε τον παρακάτω κωδικό και πάρε έκπτωση στα ενεργά κουπόνια προσφορών." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="z1U-JG-k4U">
<rect key="frame" x="20" y="269" width="374" height="51"/>
<fontDescription key="fontDescription" name="PeridotPE-Regular" family="Peridot PE" pointSize="16"/>
<color key="textColor" red="0.12941176470588234" green="0.12941176470588234" blue="0.12941176470588234" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" textAlignment="center" selectable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="b5L-BJ-bRd" customClass="UnselectableTappableTextView" customModule="SwiftWarplyFramework">
<rect key="frame" x="20" y="335" width="374" height="0.0"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="height" id="Vf5-mh-mYl"/>
</constraints>
<color key="textColor" red="0.12941176470588234" green="0.12941176470588234" blue="0.12941176470588234" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" name="PeridotPE-Regular" family="Peridot PE" pointSize="16"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Κωδικός κουπονιού" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wB5-TH-zF6">
<rect key="frame" x="20" y="370" width="374" height="17"/>
<fontDescription key="fontDescription" name="PeridotPE-Bold" family="Peridot PE" pointSize="17"/>
<color key="textColor" red="0.12941176470588234" green="0.12941176470588234" blue="0.12941176470588234" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="p9P-ZR-ZC2" userLabel="Coupon View">
<rect key="frame" x="152.5" y="397" width="109.5" height="55"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Bz3-cq-84d" customClass="CopyableLabel" customModule="SwiftWarplyFramework" customModuleProvider="target">
<rect key="frame" x="20" y="13.5" width="69.5" height="28"/>
<fontDescription key="fontDescription" name="PeridotPE-Bold" family="Peridot PE" pointSize="24"/>
<color key="textColor" red="0.12941176470588234" green="0.12941176470588234" blue="0.12941176470588234" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="0.94901960784313721" green="0.94901960784313721" blue="0.95294117647058818" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="55" id="1EO-q8-orQ"/>
<constraint firstAttribute="trailing" secondItem="Bz3-cq-84d" secondAttribute="trailing" constant="20" id="HXC-0E-aSK"/>
<constraint firstItem="Bz3-cq-84d" firstAttribute="leading" secondItem="p9P-ZR-ZC2" secondAttribute="leading" constant="20" id="cs2-FC-J3v"/>
<constraint firstItem="Bz3-cq-84d" firstAttribute="centerY" secondItem="p9P-ZR-ZC2" secondAttribute="centerY" id="lQQ-qR-UUi"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ke2-PF-MgG" userLabel="Border View">
<rect key="frame" x="20" y="472" width="374" height="1"/>
<color key="backgroundColor" red="0.90196078430000004" green="0.90196078430000004" blue="0.90196078430000004" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="TtB-Ap-gwZ"/>
</constraints>
</view>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="0e4-jR-gJ2">
<rect key="frame" x="30" y="483" width="354" height="110"/>
<constraints>
<constraint firstAttribute="height" constant="110" id="aLi-ff-Zln"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="123456789101112" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KcC-nd-UJt">
<rect key="frame" x="20" y="603" width="374" height="26.5"/>
<constraints>
<constraint firstAttribute="height" constant="26.5" id="9mu-aR-zqX"/>
</constraints>
<fontDescription key="fontDescription" name="PFSquareSansPro-Regular" family="PF Square Sans Pro" pointSize="23"/>
<color key="textColor" red="0.25490196079999999" green="0.33333333329999998" blue="0.3921568627" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HK5-Qt-OFZ" userLabel="Border 2 View">
<rect key="frame" x="20" y="644.5" width="374" height="1"/>
<color key="backgroundColor" red="0.90196078430000004" green="0.90196078430000004" blue="0.90196078430000004" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="cnC-Ua-jhC"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="l3Z-rd-1se">
<rect key="frame" x="103.5" y="655.5" width="207" height="50"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="oi1-xW-7Ma"/>
</constraints>
<fontDescription key="fontDescription" name="PFSquareSansPro-Medium" family="PF Square Sans Pro" pointSize="16"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="5" maxY="0.0"/>
<state key="normal" title="Εμφάνιση barcode" image="ic_down_dark">
<color key="titleColor" red="0.25490196079999999" green="0.33333333329999998" blue="0.3921568627" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
<preferredSymbolConfiguration key="preferredSymbolConfiguration"/>
</state>
<connections>
<action selector="showBarcodeAction:" destination="kZo-uj-MVp" eventType="touchUpInside" id="PKS-vX-Eqy"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Το κουπόνι ισχύει έως 05/12/2022" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Bmm-wl-752">
<rect key="frame" x="20" y="740.5" width="374" height="15"/>
<fontDescription key="fontDescription" name="PeridotPE-Regular" family="Peridot PE" pointSize="15"/>
<color key="textColor" red="0.12941176470588234" green="0.12941176470588234" blue="0.12941176470588234" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="zaj-yW-yxb">
<rect key="frame" x="103.5" y="790.5" width="207" height="50"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="t7m-Bz-eEx"/>
</constraints>
<fontDescription key="fontDescription" name="PeridotPE-Bold" family="Peridot PE" pointSize="15"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="5" maxY="0.0"/>
<state key="normal" title="Εμφάνιση κουπονιών" image="ic_down_dark">
<color key="titleColor" red="0.12941176470588234" green="0.12941176470588234" blue="0.12941176470588234" alpha="1" colorSpace="calibratedRGB"/>
<preferredSymbolConfiguration key="preferredSymbolConfiguration"/>
</state>
<connections>
<action selector="showCouponsButtonAction:" destination="kZo-uj-MVp" eventType="touchUpInside" id="tU8-LY-Jau"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" ambiguous="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="NYi-ps-hZw">
<rect key="frame" x="139.5" y="1110.5" width="135" height="44"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="ERH-et-F0E"/>
</constraints>
<fontDescription key="fontDescription" name="PFSquareSansPro-Medium" family="PF Square Sans Pro" pointSize="16"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Δες τα καταστήματα">
<color key="titleColor" red="0.31372549020000001" green="0.61960784310000006" blue="0.1843137255" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="mapButtonAction:" destination="kZo-uj-MVp" eventType="touchUpInside" id="LNC-9q-ejl"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" ambiguous="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qEo-pP-n0h">
<rect key="frame" x="103.5" y="1174.5" width="207" height="50"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="Noz-pm-Rmy"/>
</constraints>
<fontDescription key="fontDescription" name="PFSquareSansPro-Regular" family="PF Square Sans Pro" pointSize="16"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="5" maxY="0.0"/>
<state key="normal" title="Όροι χρήσης" image="ic_down_dark">
<color key="titleColor" red="0.25490196079999999" green="0.33333333329999998" blue="0.3921568627" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
<preferredSymbolConfiguration key="preferredSymbolConfiguration"/>
</state>
<connections>
<action selector="termsButtonAction:" destination="kZo-uj-MVp" eventType="touchUpInside" id="jTa-Ty-qFn"/>
</connections>
</button>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" ambiguous="YES" editable="NO" textAlignment="center" selectable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XRd-W8-YCf" customClass="UnselectableTappableTextView" customModule="SwiftWarplyFramework">
<rect key="frame" x="20" y="1234.5" width="374" height="0.0"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="height" id="kUA-53-MNE"/>
</constraints>
<color key="textColor" red="0.25490196079999999" green="0.33333333329999998" blue="0.3921568627" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" name="PFSquareSansPro-Regular" family="PF Square Sans Pro" pointSize="15"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="p9P-ZR-ZC2" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="h6B-3P-USu" secondAttribute="leading" constant="25" id="007-bh-Mq1"/>
<constraint firstAttribute="trailing" secondItem="HK5-Qt-OFZ" secondAttribute="trailing" constant="20" id="0Gv-bT-WxV"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="p9P-ZR-ZC2" secondAttribute="trailing" constant="25" id="1bd-sw-OGt"/>
<constraint firstAttribute="trailing" secondItem="XRd-W8-YCf" secondAttribute="trailing" constant="20" id="4sc-JD-hZm"/>
<constraint firstItem="Bmm-wl-752" firstAttribute="leading" secondItem="h6B-3P-USu" secondAttribute="leading" constant="20" id="54t-tD-9yM"/>
<constraint firstAttribute="trailing" secondItem="Ke2-PF-MgG" secondAttribute="trailing" constant="20" id="5uX-Lg-16f"/>
<constraint firstItem="qEo-pP-n0h" firstAttribute="width" secondItem="h6B-3P-USu" secondAttribute="width" multiplier="0.5" id="6Qm-94-CbZ"/>
<constraint firstAttribute="trailing" secondItem="Bmm-wl-752" secondAttribute="trailing" constant="20" id="74j-fN-F1a"/>
<constraint firstItem="jbu-lq-22w" firstAttribute="top" secondItem="h6B-3P-USu" secondAttribute="top" id="77S-EB-I9n"/>
<constraint firstItem="wB5-TH-zF6" firstAttribute="leading" secondItem="h6B-3P-USu" secondAttribute="leading" constant="20" id="7Xp-Hh-b7M"/>
<constraint firstItem="XRd-W8-YCf" firstAttribute="leading" secondItem="h6B-3P-USu" secondAttribute="leading" constant="20" id="Bjx-ym-XLB"/>
<constraint firstItem="qEo-pP-n0h" firstAttribute="centerX" secondItem="h6B-3P-USu" secondAttribute="centerX" id="CKS-XP-QAN"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="qEo-pP-n0h" secondAttribute="bottom" constant="30" id="E3K-lI-LCA"/>
<constraint firstItem="0e4-jR-gJ2" firstAttribute="top" secondItem="Ke2-PF-MgG" secondAttribute="bottom" constant="10" id="FeW-6g-7nZ"/>
<constraint firstItem="p9P-ZR-ZC2" firstAttribute="top" secondItem="wB5-TH-zF6" secondAttribute="bottom" constant="10" id="G0T-2t-BKh"/>
<constraint firstItem="KcC-nd-UJt" firstAttribute="leading" secondItem="h6B-3P-USu" secondAttribute="leading" constant="20" id="GE8-CX-1fl"/>
<constraint firstItem="NYi-ps-hZw" firstAttribute="centerX" secondItem="h6B-3P-USu" secondAttribute="centerX" id="GwJ-8P-npS"/>
<constraint firstItem="XEh-1k-bk7" firstAttribute="top" secondItem="jbu-lq-22w" secondAttribute="bottom" constant="30" id="HCb-Uz-CQC"/>
<constraint firstItem="XEh-1k-bk7" firstAttribute="leading" secondItem="h6B-3P-USu" secondAttribute="leading" constant="20" id="HRC-XR-2Z2"/>
<constraint firstItem="Bmm-wl-752" firstAttribute="top" secondItem="l3Z-rd-1se" secondAttribute="bottom" constant="10" id="HbV-nu-Hpt"/>
<constraint firstAttribute="trailing" secondItem="0e4-jR-gJ2" secondAttribute="trailing" constant="30" id="HxT-Ci-qXC"/>
<constraint firstItem="zaj-yW-yxb" firstAttribute="width" secondItem="h6B-3P-USu" secondAttribute="width" multiplier="0.5" id="Jak-kG-SlN"/>
<constraint firstItem="l3Z-rd-1se" firstAttribute="top" secondItem="HK5-Qt-OFZ" secondAttribute="bottom" constant="10" id="LiN-pJ-pjN"/>
<constraint firstAttribute="trailing" secondItem="KcC-nd-UJt" secondAttribute="trailing" constant="20" id="Mfx-q9-cuK"/>
<constraint firstItem="XRd-W8-YCf" firstAttribute="top" secondItem="qEo-pP-n0h" secondAttribute="bottom" constant="10" id="Nd4-Gg-uk1"/>
<constraint firstItem="HK5-Qt-OFZ" firstAttribute="leading" secondItem="h6B-3P-USu" secondAttribute="leading" constant="20" id="Nt2-qa-UoE"/>
<constraint firstItem="z1U-JG-k4U" firstAttribute="top" secondItem="XEh-1k-bk7" secondAttribute="bottom" constant="15" id="OK6-wa-Ybp"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="XRd-W8-YCf" secondAttribute="bottom" constant="30" id="PqJ-aK-gFO"/>
<constraint firstItem="zaj-yW-yxb" firstAttribute="top" secondItem="Bmm-wl-752" secondAttribute="bottom" constant="30" id="QYD-3G-JMi"/>
<constraint firstAttribute="trailing" secondItem="wB5-TH-zF6" secondAttribute="trailing" constant="20" id="RUA-zf-2M5"/>
<constraint firstItem="p9P-ZR-ZC2" firstAttribute="centerX" secondItem="h6B-3P-USu" secondAttribute="centerX" id="Roj-dQ-hYS"/>
<constraint firstItem="KcC-nd-UJt" firstAttribute="top" secondItem="0e4-jR-gJ2" secondAttribute="bottom" constant="10" id="SH6-4R-cCp"/>
<constraint firstAttribute="trailing" secondItem="XEh-1k-bk7" secondAttribute="trailing" constant="20" id="XIz-C7-XrD"/>
<constraint firstItem="l3Z-rd-1se" firstAttribute="centerX" secondItem="h6B-3P-USu" secondAttribute="centerX" id="YD9-GP-0ms"/>
<constraint firstItem="qEo-pP-n0h" firstAttribute="top" secondItem="NYi-ps-hZw" secondAttribute="bottom" constant="20" id="Zt9-R1-mr2"/>
<constraint firstItem="b5L-BJ-bRd" firstAttribute="leading" secondItem="h6B-3P-USu" secondAttribute="leading" constant="20" id="arK-Zd-Hgy"/>
<constraint firstItem="Ke2-PF-MgG" firstAttribute="top" secondItem="p9P-ZR-ZC2" secondAttribute="bottom" constant="20" id="cmv-I1-vKp"/>
<constraint firstItem="z1U-JG-k4U" firstAttribute="leading" secondItem="h6B-3P-USu" secondAttribute="leading" constant="20" id="cyH-Xu-zU6"/>
<constraint firstItem="wB5-TH-zF6" firstAttribute="top" secondItem="b5L-BJ-bRd" secondAttribute="bottom" constant="35" id="fR9-cP-N5X"/>
<constraint firstAttribute="trailing" secondItem="z1U-JG-k4U" secondAttribute="trailing" constant="20" id="ghn-UI-BtO"/>
<constraint firstAttribute="trailing" secondItem="b5L-BJ-bRd" secondAttribute="trailing" constant="20" id="iby-Dv-64i"/>
<constraint firstItem="Ke2-PF-MgG" firstAttribute="leading" secondItem="h6B-3P-USu" secondAttribute="leading" constant="20" id="jsN-8I-dDs"/>
<constraint firstAttribute="trailing" secondItem="jbu-lq-22w" secondAttribute="trailing" id="nZs-Mo-gQn"/>
<constraint firstItem="zaj-yW-yxb" firstAttribute="centerX" secondItem="h6B-3P-USu" secondAttribute="centerX" id="ner-V9-uet"/>
<constraint firstItem="jbu-lq-22w" firstAttribute="leading" secondItem="h6B-3P-USu" secondAttribute="leading" id="nlJ-Jr-W1y"/>
<constraint firstItem="l3Z-rd-1se" firstAttribute="width" secondItem="h6B-3P-USu" secondAttribute="width" multiplier="0.5" id="pBD-ac-8QV"/>
<constraint firstItem="HK5-Qt-OFZ" firstAttribute="top" secondItem="KcC-nd-UJt" secondAttribute="bottom" constant="15" id="sjJ-5g-cKb"/>
<constraint firstItem="0e4-jR-gJ2" firstAttribute="leading" secondItem="h6B-3P-USu" secondAttribute="leading" constant="30" id="t1y-43-ggS"/>
<constraint firstItem="b5L-BJ-bRd" firstAttribute="top" secondItem="z1U-JG-k4U" secondAttribute="bottom" constant="15" id="xxC-cP-Rv9"/>
</constraints>
</view>
</subviews>
<constraints>
<constraint firstItem="h6B-3P-USu" firstAttribute="top" secondItem="Bwm-0z-5fj" secondAttribute="top" id="0QV-nm-q49"/>
<constraint firstItem="h6B-3P-USu" firstAttribute="bottom" secondItem="Bwm-0z-5fj" secondAttribute="bottom" id="cMM-3m-nO7"/>
<constraint firstItem="h6B-3P-USu" firstAttribute="trailing" secondItem="Bwm-0z-5fj" secondAttribute="trailing" id="dHs-br-RnG"/>
<constraint firstItem="h6B-3P-USu" firstAttribute="width" secondItem="J9l-2m-hLG" secondAttribute="width" id="p3R-hD-ebm"/>
<constraint firstItem="h6B-3P-USu" firstAttribute="leading" secondItem="Bwm-0z-5fj" secondAttribute="leading" id="zDh-cb-g0k"/>
</constraints>
<viewLayoutGuide key="contentLayoutGuide" id="Bwm-0z-5fj"/>
<viewLayoutGuide key="frameLayoutGuide" id="J9l-2m-hLG"/>
</scrollView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="k6Y-8d-5AX">
<rect key="frame" x="0.0" y="420" width="414" height="11.5"/>
</imageView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="F2x-ch-ng3" secondAttribute="bottom" id="Bxi-Lf-m8N"/>
<constraint firstItem="h6B-3P-USu" firstAttribute="height" relation="greaterThanOrEqual" secondItem="1tN-9F-yxg" secondAttribute="height" id="JTm-bV-cw8"/>
<constraint firstItem="F2x-ch-ng3" firstAttribute="top" secondItem="1tN-9F-yxg" secondAttribute="top" id="Jos-cl-7VR"/>
<constraint firstItem="Jsn-Je-71G" firstAttribute="top" secondItem="1tN-9F-yxg" secondAttribute="top" id="KbP-p7-cQj"/>
<constraint firstItem="k6Y-8d-5AX" firstAttribute="leading" secondItem="1tN-9F-yxg" secondAttribute="leading" id="SIr-Hi-Dyx"/>
<constraint firstItem="F2x-ch-ng3" firstAttribute="leading" secondItem="1tN-9F-yxg" secondAttribute="leading" id="U0W-zW-DaZ"/>
<constraint firstItem="Jsn-Je-71G" firstAttribute="leading" secondItem="1tN-9F-yxg" secondAttribute="leading" id="UYc-62-g5M"/>
<constraint firstAttribute="trailing" secondItem="Jsn-Je-71G" secondAttribute="trailing" id="Vqx-91-Gax"/>
<constraint firstAttribute="trailing" secondItem="F2x-ch-ng3" secondAttribute="trailing" id="fiO-e6-Uyi"/>
<constraint firstAttribute="bottom" secondItem="Jsn-Je-71G" secondAttribute="bottom" id="hCl-yM-7aq"/>
<constraint firstItem="Leh-kL-DF1" firstAttribute="top" secondItem="1tN-9F-yxg" secondAttribute="top" id="i78-sg-xrF"/>
<constraint firstAttribute="trailing" secondItem="k6Y-8d-5AX" secondAttribute="trailing" id="iXg-hc-zBk"/>
<constraint firstItem="Leh-kL-DF1" firstAttribute="leading" secondItem="1tN-9F-yxg" secondAttribute="leading" id="mcD-r4-3uU"/>
<constraint firstItem="k6Y-8d-5AX" firstAttribute="top" secondItem="1tN-9F-yxg" secondAttribute="top" id="o5b-Jd-fzM"/>
<constraint firstAttribute="trailing" secondItem="Leh-kL-DF1" secondAttribute="trailing" id="syn-qO-3hi"/>
<constraint firstAttribute="bottom" secondItem="Leh-kL-DF1" secondAttribute="bottom" id="uv2-fR-r9D"/>
</constraints>
<variation key="default">
<mask key="subviews">
<exclude reference="Leh-kL-DF1"/>
<exclude reference="F2x-ch-ng3"/>
<exclude reference="k6Y-8d-5AX"/>
</mask>
</variation>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="fJk-Nc-evo"/>
......@@ -3624,41 +3372,8 @@
</constraints>
</view>
<connections>
<outlet property="backgroundImage" destination="Leh-kL-DF1" id="Yh4-J9-2fn"/>
<outlet property="barcodeImage" destination="0e4-jR-gJ2" id="K57-UT-nEz"/>
<outlet property="barcodeImageHeight" destination="aLi-ff-Zln" id="fmv-UO-1xh"/>
<outlet property="barcodeImageTopSpace" destination="FeW-6g-7nZ" id="geW-rH-Ncb"/>
<outlet property="barcodeLabel" destination="KcC-nd-UJt" id="nuA-M8-lfz"/>
<outlet property="barcodeLabelHeight" destination="9mu-aR-zqX" id="LkC-oC-uBB"/>
<outlet property="barcodeLabelTopSpace" destination="SH6-4R-cCp" id="Ika-Hf-UZJ"/>
<outlet property="border1TopSpace" destination="cmv-I1-vKp" id="uDK-md-rLQ"/>
<outlet property="border2TopSpace" destination="sjJ-5g-cKb" id="Irm-bW-hhb"/>
<outlet property="borderView2Height" destination="cnC-Ua-jhC" id="Sft-A8-tkZ"/>
<outlet property="borderViewHeight" destination="TtB-Ap-gwZ" id="8uH-4S-wv9"/>
<outlet property="couponImage" destination="jbu-lq-22w" id="S5m-GI-lAj"/>
<outlet property="couponImageHeight" destination="qtq-sH-2GF" id="deR-r5-eSP"/>
<outlet property="couponNumberLabel" destination="Bz3-cq-84d" id="4BL-AF-mRu"/>
<outlet property="couponView" destination="p9P-ZR-ZC2" id="eTA-tl-HKI"/>
<outlet property="discriptionLabel" destination="z1U-JG-k4U" id="svr-qs-rtD"/>
<outlet property="expirationLabel" destination="Bmm-wl-752" id="DjA-bw-ewR"/>
<outlet property="mainView" destination="1tN-9F-yxg" id="57p-Ru-90A"/>
<outlet property="mapButton" destination="NYi-ps-hZw" id="IgR-mN-HJO"/>
<outlet property="mapButtonHeight" destination="ERH-et-F0E" id="IrJ-ng-0OU"/>
<outlet property="merchantDescrTextView" destination="b5L-BJ-bRd" id="FyS-oQ-cm4"/>
<outlet property="merchantDescrTextViewHeight" destination="Vf5-mh-mYl" id="FMX-nf-Q5b"/>
<outlet property="merchantDescrTextViewTopSpace" destination="xxC-cP-Rv9" id="2oC-LP-Qih"/>
<outlet property="nameLabel" destination="XEh-1k-bk7" id="z04-hZ-hkV"/>
<outlet property="scrollContentView" destination="h6B-3P-USu" id="MWb-in-8tj"/>
<outlet property="scrollView" destination="F2x-ch-ng3" id="dbe-Qt-LyZ"/>
<outlet property="showBarcodeButton" destination="l3Z-rd-1se" id="8M5-vy-RzO"/>
<outlet property="showBarcodeButtonHeight" destination="oi1-xW-7Ma" id="6lt-Ex-DuD"/>
<outlet property="showBarcodeButtonTopSpace" destination="LiN-pJ-pjN" id="aXh-ZZ-cWO"/>
<outlet property="showCouponsButton" destination="zaj-yW-yxb" id="gVY-xH-aMw"/>
<outlet property="tableView" destination="Jsn-Je-71G" id="mZF-SD-0R2"/>
<outlet property="termsButton" destination="qEo-pP-n0h" id="1QS-vK-40s"/>
<outlet property="termsTextView" destination="XRd-W8-YCf" id="Lad-5v-1WT"/>
<outlet property="termsTextViewHeight" destination="kUA-53-MNE" id="R1h-wF-gA7"/>
<outlet property="topBorderLine" destination="k6Y-8d-5AX" id="P78-tI-PAD"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="ZLv-p2-P1H" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
......
......@@ -10,69 +10,9 @@ import RSBarcodes_Swift
import AVFoundation
// import SwiftEventBus
final class ContentSizedTableView: UITableView {
override var contentSize:CGSize {
didSet {
invalidateIntrinsicContentSize()
}
}
override var intrinsicContentSize:CGSize {
layoutIfNeeded()
return CGSize(width: UIView.noIntrinsicMetric, height: contentSize.height)
}
}
//extension UIScrollView {
// func updateContentView() {
// contentSize.height = subviews.sorted(by: { $0.frame.maxY < $1.frame.maxY }).last?.frame.maxY ?? contentSize.height
// }
//}
extension UITableView {
func updateContentView() {
contentSize.height = subviews.sorted(by: { $0.frame.maxY < $1.frame.maxY }).last?.frame.maxY ?? contentSize.height
}
}
@objc public class UnifiedCouponBarcodeViewController: UIViewController, UITextViewDelegate {
@objc public class UnifiedCouponBarcodeViewController: UIViewController {
@IBOutlet weak var mainView: UIView!
@IBOutlet weak var backgroundImage: UIImageView!
@IBOutlet weak var scrollView: UIScrollView!
@IBOutlet weak var scrollContentView: UIView!
@IBOutlet weak var couponImage: UIImageView!
@IBOutlet weak var couponImageHeight: NSLayoutConstraint!
@IBOutlet weak var nameLabel: UILabel!
@IBOutlet weak var discriptionLabel: UILabel!
@IBOutlet weak var merchantDescrTextView: UnselectableTappableTextView!
@IBOutlet weak var merchantDescrTextViewHeight: NSLayoutConstraint!
@IBOutlet weak var merchantDescrTextViewTopSpace: NSLayoutConstraint!
@IBOutlet weak var couponView: UIView!
@IBOutlet weak var couponNumberLabel: CopyableLabel!
@IBOutlet weak var barcodeImage: UIImageView!
@IBOutlet weak var barcodeImageHeight: NSLayoutConstraint!
@IBOutlet weak var barcodeLabel: UILabel!
@IBOutlet weak var barcodeLabelHeight: NSLayoutConstraint!
@IBOutlet weak var showBarcodeButton: UIButton!
@IBOutlet weak var expirationLabel: UILabel!
@IBOutlet weak var termsButton: UIButton!
@IBOutlet weak var termsTextView: UnselectableTappableTextView!
@IBOutlet weak var termsTextViewHeight: NSLayoutConstraint!
@IBOutlet weak var borderViewHeight: NSLayoutConstraint!
@IBOutlet weak var borderView2Height: NSLayoutConstraint!
@IBOutlet weak var border1TopSpace: NSLayoutConstraint!
@IBOutlet weak var barcodeImageTopSpace: NSLayoutConstraint!
@IBOutlet weak var barcodeLabelTopSpace: NSLayoutConstraint!
@IBOutlet weak var border2TopSpace: NSLayoutConstraint!
@IBOutlet weak var mapButton: UIButton!
@IBOutlet weak var topBorderLine: UIImageView!
@IBOutlet weak var mapButtonHeight: NSLayoutConstraint!
@IBOutlet weak var mapButtonTopSpace: NSLayoutConstraint!
@IBOutlet weak var showBarcodeButtonHeight: NSLayoutConstraint!
@IBOutlet weak var showBarcodeButtonTopSpace: NSLayoutConstraint!
@IBOutlet weak var tableView: UITableView!
@IBOutlet weak var tableViewHeight: NSLayoutConstraint!
@IBOutlet weak var showCouponsButton: UIButton!
let uiscreen: CGRect = UIScreen.main.bounds
......@@ -91,8 +31,6 @@ extension UITableView {
super.viewDidLoad()
self.hidesBottomBarWhenPushed = true
merchantDescrTextView.delegate = self
termsTextView.delegate = self
tableView.delegate = self
tableView.dataSource = self
......@@ -101,237 +39,6 @@ extension UITableView {
setBackButton()
setNavigationTitle("Εκπτωτικό κουπόνι")
// backgroundImage.image = UIImage(named: "coupons_scrollview_white", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil)
backgroundImage.image = UIImage(named: "coupons_scrollview_white", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
// scrollView.clipsToBounds = true
// scrollView.layer.cornerRadius = 30
// scrollView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
// let image = UIImage(named: "top_border_line", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)!
// var aspectR: CGFloat = 0.0
//
// aspectR = image.size.width/image.size.height
//
// topBorderLine.translatesAutoresizingMaskIntoConstraints = false
// topBorderLine.image = image
// topBorderLine.contentMode = .scaleAspectFill
//
// NSLayoutConstraint.activate([
// topBorderLine.topAnchor.constraint(equalTo: mainView.topAnchor, constant: 0),
// topBorderLine.leadingAnchor.constraint(equalTo: mainView.leadingAnchor, constant: 0),
// topBorderLine.trailingAnchor.constraint(equalTo: mainView.trailingAnchor, constant: 0),
// topBorderLine.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.width),
// topBorderLine.heightAnchor.constraint(equalTo: topBorderLine.widthAnchor, multiplier: 1/aspectR)
// ])
// COUPONSET: desc, img_preview, name, terms
// COUPON: coupon, expiration, discount, status
// let couponSetData: swiftApi.CouponSetItemModel? = coupon?.couponset_data
// couponImage.load(link: couponSetData?.img_preview ?? "", placeholder: UIImage(), cache: URLCache())
couponImage.image = UIImage(named: "market_bg", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
couponImage.contentMode = .scaleAspectFill
couponImageHeight.constant = 230 // 253 // self.uiscreen.height * 0.25
nameLabel.text = "Εκπτωτικό κουπόνι COSMOTE SuperMarket Deals!"
discriptionLabel.text = "Χρησιμοποίησε τον παρακάτω κωδικό και πάρε έκπτωση στα ενεργά κουπόνια προσφορών."
merchantDescrTextView.text = ""
merchantDescrTextViewTopSpace.constant = CGFloat(0)
merchantDescrTextViewHeight.constant = CGFloat(0)
merchantDescrTextView.isHidden = true
// let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList()
// for merchant in merchantList {
// if (merchant._uuid == couponSetData?.merchant_uuid) {
// let htmlMerchDescrText = merchant._body
//
// if (htmlMerchDescrText != "") {
// merchantDescrTextView.attributedText = htmlMerchDescrText.htmlToAttributedString
// merchantDescrTextView.font = UIFont(name: "PeridotPE-Regular", size: 16)
// merchantDescrTextView.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
// merchantDescrTextView.textAlignment = .center
// merchantDescrTextView.isScrollEnabled = false
// merchantDescrTextView.isUserInteractionEnabled = true
// merchantDescrTextView.isEditable = false
// merchantDescrTextView.isSelectable = true
// merchantDescrTextView.dataDetectorTypes = [.link]
//
// merchantDescrTextView.isHidden = false
// merchantDescrTextViewTopSpace.constant = CGFloat(15)
// let targetSize = CGSize(width: merchantDescrTextView.frame.width, height: CGFloat(MAXFLOAT))
// merchantDescrTextViewHeight.constant = merchantDescrTextView.sizeThatFits(targetSize).height
// }
//
// break;
// }
// }
couponView.layer.cornerRadius = 16
couponNumberLabel.text = ((coupon?._code != 0) ? String(coupon?._code ?? 0) : "")
couponView.frame = CGRect(x: 0.0, y: 0.0, width: couponView.intrinsicContentSize.width, height: 55)
let barcodeString = constructBarcode() ?? ""
barcodeLabel.text = barcodeString
// Uncomment if Barcode Section is active again
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)) {
barcodeImage.image = barcodeUIImage
barcodeImageHeight.constant = self.uiscreen.height * 0.1
showBarcodeButton.isHidden = false
showBarcodeButtonHeight.constant = 50
showBarcodeButtonTopSpace.constant = 10
} else {
barcodeImageHeight.constant = 0
showBarcodeButton.isHidden = true
showBarcodeButtonHeight.constant = 0
showBarcodeButtonTopSpace.constant = 0
}
// === Hide Barcode Section
// barcodeImage.isHidden = true
// barcodeImageHeight.constant = CGFloat(0)
// barcodeLabel.isHidden = true
// barcodeLabelHeight.constant = CGFloat(0)
//
// borderViewHeight.constant = CGFloat(0)
// borderView2Height.constant = CGFloat(0)
//
// border1TopSpace.constant = CGFloat(0) // 20
// barcodeImageTopSpace.constant = CGFloat(0) // 10
// barcodeLabelTopSpace.constant = CGFloat(0) // 10
// border2TopSpace.constant = CGFloat(0) // 15
//
showBarcodeButton.isHidden = true
showBarcodeButtonHeight.constant = 0
showBarcodeButtonTopSpace.constant = 0
// ===
showBarcodeButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 16)
showBarcodeButton.setTitle("Εμφάνιση barcode", for: .normal)
showBarcodeButton.setTitleColor(UIColor(red: 0.25, green: 0.33, blue: 0.39, alpha: 1.00), for: .normal)
showBarcodeButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
showBarcodeButton.semanticContentAttribute = .forceRightToLeft
showBarcodeButton.tintColor = UIColor(red: 0.21, green: 0.32, blue: 0.41, alpha: 1.00)
showBarcodeButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0);
showBarcodeButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 5);
showBarcodeButton.imageView?.layer.transform = CATransform3DMakeScale(0.8, 0.8, 0.8)
if let earliestExpiration = coupon?._coupons.min(by: { ($0.expiration ?? "") < ($1.expiration ?? "") }) {
expirationLabel.text = "Το κουπόνι ισχύει έως " + (earliestExpiration.expiration ?? "")
} else {
expirationLabel.text = ""
}
mapButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 18)
mapButton.setTitle("Δες τα supermarket", for: .normal)
mapButton.setTitleColor(UIColor(red: 1.00, green: 1.00, blue: 1.00, alpha: 1.00), for: .normal)
mapButton.backgroundColor = UIColor(red: 0.47, green: 0.75, blue: 0.08, alpha: 1.00)
mapButton.layer.cornerRadius = 8.0
mapButton.frame = CGRect(x: 0.0, y: 0.0, width: mapButton.intrinsicContentSize.width, height: 44)
mapButton.contentEdgeInsets = UIEdgeInsets(top: 1, left: 16, bottom: 0, right: 16)
// mapButton.isHidden = true
// mapButtonHeight.constant = 0
// mapButtonTopSpace.constant = 0
// let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList()
// for merchant in merchantList {
// if (merchant._uuid == couponSetData?.merchant_uuid) {
// if (merchant._show_map == true) {
// mapButton.setTitle("Δες τα καταστήματα", for: .normal)
// mapButton.frame = CGRect(x: 0.0, y: 0.0, width: mapButton.intrinsicContentSize.width, height: 44)
// mapButton.contentEdgeInsets = UIEdgeInsets(top: 1, left: 16, bottom: 0, right: 16)
// mapButton.isHidden = false
// mapBtnVisible = true
// eshopBtnVisible = false
// mapButtonHeight.constant = 44
// mapButtonTopSpace.constant = 10
// } else if (merchant._eshop == true) {
// mapButton.setTitle("Δες το eshop", for: .normal)
// mapButton.frame = CGRect(x: 0.0, y: 0.0, width: mapButton.intrinsicContentSize.width, height: 44)
// mapButton.contentEdgeInsets = UIEdgeInsets(top: 1, left: 16, bottom: 0, right: 16)
// mapButton.isHidden = false
// mapBtnVisible = false
// eshopBtnVisible = true
// mapButtonHeight.constant = 44
// mapButtonTopSpace.constant = 10
// } else {
// mapButton.isHidden = true
// mapBtnVisible = false
// eshopBtnVisible = false
// mapButtonHeight.constant = 0
// mapButtonTopSpace.constant = 0
// }
// eshopWebsite = merchant._website
// break;
// }
// }
// Fix width for ipad
// if UIDevice.current.userInterfaceIdiom == .pad {
// // iPad
// mapButton.widthAnchor.constraint(equalToConstant: 250).isActive = true
// } else {
// // not iPad (iPhone, mac, tv, carPlay, unspecified)
// mapButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
// }
showCouponsButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 15)
// termsButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
showCouponsButton.setTitle("Εμφάνιση κουπονιών", for: .normal)
showCouponsButton.setTitleColor(UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00), for: .normal)
showCouponsButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
showCouponsButton.semanticContentAttribute = .forceRightToLeft
showCouponsButton.tintColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 1.00)
showCouponsButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0);
showCouponsButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 5);
showCouponsButton.imageView?.layer.transform = CATransform3DMakeScale(0.8, 0.8, 0.8)
// tableView.isScrollEnabled = false
// tableView.isHidden = true
// tableViewHeight.constant = CGFloat(0)
// tableView.isHidden = false
// let targetSize = CGSize(width: tableView.frame.width, height: CGFloat(MAXFLOAT))
// tableViewHeight.constant = tableView.sizeThatFits(targetSize).height
termsButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Regular", size: 16)
// termsButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
termsButton.setTitle("Όροι χρήσης", for: .normal)
termsButton.setTitleColor(UIColor(red: 0.25, green: 0.33, blue: 0.39, alpha: 1.00), for: .normal)
termsButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
termsButton.semanticContentAttribute = .forceRightToLeft
termsButton.tintColor = UIColor(red: 0.21, green: 0.32, blue: 0.41, alpha: 1.00)
termsButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0);
termsButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 5);
termsButton.imageView?.layer.transform = CATransform3DMakeScale(0.8, 0.8, 0.8)
let termsText = "1. Το εκπτωτικό κουπόνι ισχύει έως την ημερομηνία που αναφέρεται παραπάνω\n2. To εκπτωτικό κουπόνι αφορά στα ενεργά κουπόνια προσφορών όπως αναφέρονται παραπάνω.\n3. Το εκπτωτικό κουπόνι μπορεί να χρησιμοποιηθεί σε μια μόνο συναλλαγή.\n4. Εάν δεν γίνει χρήση ενός επιμέρους κουπονιού προσφοράς από το εκπτωτικό κουπόνι, το κουπόνι προσφοράς επιστρέφει στο καλάθι στην ενότητα COSMOTE SuperMarket Deals"
termsTextView.attributedText = NSAttributedString(string: termsText)
termsTextView.font = UIFont(name: "PFSquareSansPro-Regular", size: 15)
termsTextView.textColor = UIColor(red: 0.25, green: 0.33, blue: 0.39, alpha: 1.00)
termsTextView.textAlignment = .center
termsTextView.isScrollEnabled = false
termsTextView.isUserInteractionEnabled = true
termsTextView.isEditable = false
termsTextView.isSelectable = true
termsTextView.dataDetectorTypes = [.link]
// Uncomment if Barcode Section is active again
// toggleTerms()
// toggleBarcode()
// Logs
// print("Coupon: " + (coupon?.coupon ?? ""))
// print("Coupon Name: " + (couponSetData?.name ?? ""))
......@@ -347,152 +54,26 @@ extension UITableView {
}
public func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
UIApplication.shared.open(URL)
// Disable `.preview` by 3D Touch and other interactions
return false
}
// MARK: - Functions
func toggleTerms() {
if (termsVisible) {
termsTextView.isHidden = false
let targetSize = CGSize(width: termsTextView.frame.width, height: CGFloat(MAXFLOAT))
termsTextViewHeight.constant = termsTextView.sizeThatFits(targetSize).height
termsButton.setImage(UIImage(named: "ic_up_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
} else {
termsTextView.isHidden = true
termsTextViewHeight.constant = CGFloat(0)
termsButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
}
}
func toggleBarcode() {
if (barcodeVisible) {
barcodeImage.isHidden = false
if (barcodeImage.image == nil) {
barcodeImageHeight.constant = CGFloat(0)
} else {
barcodeImageHeight.constant = self.uiscreen.height * 0.1
}
barcodeLabel.isHidden = false
let targetSize = CGSize(width: barcodeLabel.frame.width, height: CGFloat(MAXFLOAT))
barcodeLabelHeight.constant = barcodeLabel.sizeThatFits(targetSize).height
borderViewHeight.constant = CGFloat(1)
borderView2Height.constant = CGFloat(1)
border1TopSpace.constant = CGFloat(20) // 20
barcodeImageTopSpace.constant = CGFloat(10) // 10
barcodeLabelTopSpace.constant = CGFloat(10) // 10
border2TopSpace.constant = CGFloat(15) // 15
showBarcodeButton.setTitle("Απόκρυψη barcode", for: .normal)
showBarcodeButton.setImage(UIImage(named: "ic_up_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
} else {
barcodeImage.isHidden = true
barcodeImageHeight.constant = CGFloat(0)
barcodeLabel.isHidden = true
barcodeLabelHeight.constant = CGFloat(0)
borderViewHeight.constant = CGFloat(0)
borderView2Height.constant = CGFloat(0)
border1TopSpace.constant = CGFloat(0) // 20
barcodeImageTopSpace.constant = CGFloat(0) // 10
barcodeLabelTopSpace.constant = CGFloat(0) // 10
border2TopSpace.constant = CGFloat(0) // 15
showBarcodeButton.setTitle("Εμφάνιση barcode", for: .normal)
showBarcodeButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
}
}
func toggleCoupons() {
if (couponsVisible) {
tableView.isHidden = false
let targetSize = CGSize(width: tableView.frame.width, height: CGFloat(MAXFLOAT))
tableViewHeight.constant = tableView.sizeThatFits(targetSize).height
// tableViewHeight.constant = tableView.intrinsicContentSize.height
showCouponsButton.setImage(UIImage(named: "ic_up_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
} else {
tableView.isHidden = true
tableViewHeight.constant = CGFloat(0)
showCouponsButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
}
// scrollView.contentSize = CGSizeMake(scrollView.frame.size.width, scrollView.intrinsicContentSize.height);
// self.view.layoutIfNeeded()
// let targetSize = CGSize(width: scrollView.frame.width, height: CGFloat(MAXFLOAT))
// tableViewHeight.constant = tableView.sizeThatFits(targetSize).height
// scrollView.contentSize = CGSizeMake(scrollView.frame.size.width, CGFloat(MAXFLOAT));
// scrollView.updateContentView()
// tableView.updateContentView()
}
func constructBarcode() -> String? {
// EAN 13 barcode construction
// let couponData = coupon?.couponset_data
let couponString = coupon?._barcode ?? ""
if (!couponString.isEmpty) {
var checkDigit = 0;
var result = 0;
var fixedCouponCode = couponString;
if (fixedCouponCode.count < 12) {
let loops = 12 - fixedCouponCode.count;
var zerosStr = "";
for i in 0 ..< loops {
zerosStr += "0"
}
// fixedCouponCode = zerosStr + fixedCouponCode;
fixedCouponCode = fixedCouponCode + zerosStr;
}
var multiplier = 3;
for idx in (0 ... (fixedCouponCode.count - 1)).reversed() {
let curChar = fixedCouponCode[idx];
result += (Int(curChar) ?? 0) * multiplier;
multiplier = multiplier == 3 ? 1 : 3;
}
checkDigit = 10 - (result % 10);
let barcodeStr = fixedCouponCode + String(checkDigit);
return barcodeStr;
}
return ""
}
// MARK: - Actions
@IBAction func showCouponsButtonAction(_ sender: Any) {
couponsVisible = !couponsVisible
// self.tableView.reloadSections(IndexSet(0..<2), with: .none)
self.tableView.reloadData()
// toggleCoupons()
}
@IBAction func showBarcodeAction(_ sender: Any) {
barcodeVisible = !barcodeVisible
// self.tableView.reloadSections(IndexSet(integer: 0), with: .none)
self.tableView.reloadData()
// toggleBarcode()
}
@IBAction func termsButtonAction(_ sender: Any) {
termsVisible = !termsVisible
// self.tableView.reloadSections(IndexSet(integer: 2), with: .none)
self.tableView.reloadData()
// toggleTerms()
}
@IBAction func mapButtonAction(_ sender: Any) {
......