Manos Chorianopoulos

Add merchant description to CouponBarcodeVC

...@@ -10,7 +10,7 @@ import UIKit ...@@ -10,7 +10,7 @@ import UIKit
10 import AVFoundation 10 import AVFoundation
11 // import SwiftEventBus 11 // import SwiftEventBus
12 12
13 -@objc public class CouponBarcodeViewController: UIViewController { 13 +@objc public class CouponBarcodeViewController: UIViewController, UITextViewDelegate {
14 @IBOutlet weak var mainView: UIView! 14 @IBOutlet weak var mainView: UIView!
15 @IBOutlet weak var backgroundImage: UIImageView! 15 @IBOutlet weak var backgroundImage: UIImageView!
16 @IBOutlet weak var scrollView: UIScrollView! 16 @IBOutlet weak var scrollView: UIScrollView!
...@@ -19,6 +19,9 @@ import AVFoundation ...@@ -19,6 +19,9 @@ import AVFoundation
19 @IBOutlet weak var couponImageHeight: NSLayoutConstraint! 19 @IBOutlet weak var couponImageHeight: NSLayoutConstraint!
20 @IBOutlet weak var nameLabel: UILabel! 20 @IBOutlet weak var nameLabel: UILabel!
21 @IBOutlet weak var discriptionLabel: 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!
22 @IBOutlet weak var couponView: UIView! 25 @IBOutlet weak var couponView: UIView!
23 @IBOutlet weak var couponNumberLabel: CopyableLabel! 26 @IBOutlet weak var couponNumberLabel: CopyableLabel!
24 @IBOutlet weak var barcodeImage: UIImageView! 27 @IBOutlet weak var barcodeImage: UIImageView!
...@@ -29,7 +32,7 @@ import AVFoundation ...@@ -29,7 +32,7 @@ import AVFoundation
29 @IBOutlet weak var expirationLabel: UILabel! 32 @IBOutlet weak var expirationLabel: UILabel!
30 @IBOutlet weak var redeemButton: UIButton! 33 @IBOutlet weak var redeemButton: UIButton!
31 @IBOutlet weak var termsButton: UIButton! 34 @IBOutlet weak var termsButton: UIButton!
32 - @IBOutlet weak var termsTextView: UITextView! 35 + @IBOutlet weak var termsTextView: UnselectableTappableTextView!
33 @IBOutlet weak var termsTextViewHeight: NSLayoutConstraint! 36 @IBOutlet weak var termsTextViewHeight: NSLayoutConstraint!
34 @IBOutlet weak var borderViewHeight: NSLayoutConstraint! 37 @IBOutlet weak var borderViewHeight: NSLayoutConstraint!
35 @IBOutlet weak var borderView2Height: NSLayoutConstraint! 38 @IBOutlet weak var borderView2Height: NSLayoutConstraint!
...@@ -60,6 +63,8 @@ import AVFoundation ...@@ -60,6 +63,8 @@ import AVFoundation
60 super.viewDidLoad() 63 super.viewDidLoad()
61 64
62 self.hidesBottomBarWhenPushed = true 65 self.hidesBottomBarWhenPushed = true
66 + merchantDescrTextView.delegate = self
67 + termsTextView.delegate = self
63 68
64 // Do any additional setup after loading the view. 69 // Do any additional setup after loading the view.
65 setBackButton() 70 setBackButton()
...@@ -101,6 +106,38 @@ import AVFoundation ...@@ -101,6 +106,38 @@ import AVFoundation
101 nameLabel.text = couponSetData?.name ?? "" 106 nameLabel.text = couponSetData?.name ?? ""
102 discriptionLabel.text = couponSetData?.short_description ?? "" 107 discriptionLabel.text = couponSetData?.short_description ?? ""
103 108
109 + merchantDescrTextView.text = ""
110 + merchantDescrTextViewTopSpace.constant = CGFloat(0)
111 + merchantDescrTextViewHeight.constant = CGFloat(0)
112 + merchantDescrTextView.isHidden = true
113 +
114 + let merchantList:Array<swiftApi.MerchantModel> = swiftApi().getMerchantList()
115 +
116 + for merchant in merchantList {
117 + if (merchant._uuid == couponSetData?.merchant_uuid) {
118 + let htmlMerchDescrText = merchant._body
119 +
120 + if (htmlMerchDescrText != "") {
121 + merchantDescrTextView.attributedText = htmlMerchDescrText.htmlToAttributedString
122 + merchantDescrTextView.font = UIFont(name: "PFSquareSansPro-Regular", size: 17)
123 + merchantDescrTextView.textColor = UIColor(red: 0.25, green: 0.33, blue: 0.39, alpha: 1.00)
124 + merchantDescrTextView.textAlignment = .center
125 + merchantDescrTextView.isScrollEnabled = false
126 + merchantDescrTextView.isUserInteractionEnabled = true
127 + merchantDescrTextView.isEditable = false
128 + merchantDescrTextView.isSelectable = true
129 + merchantDescrTextView.dataDetectorTypes = [.link]
130 +
131 + merchantDescrTextView.isHidden = false
132 + merchantDescrTextViewTopSpace.constant = CGFloat(15)
133 + let targetSize = CGSize(width: merchantDescrTextView.frame.width, height: CGFloat(MAXFLOAT))
134 + merchantDescrTextViewHeight.constant = merchantDescrTextView.sizeThatFits(targetSize).height
135 + }
136 +
137 + break;
138 + }
139 + }
140 +
104 couponView.layer.cornerRadius = 8 141 couponView.layer.cornerRadius = 8
105 couponNumberLabel.text = coupon?.coupon ?? "" 142 couponNumberLabel.text = coupon?.coupon ?? ""
106 couponView.frame = CGRect(x: 0.0, y: 0.0, width: couponView.intrinsicContentSize.width, height: 55) 143 couponView.frame = CGRect(x: 0.0, y: 0.0, width: couponView.intrinsicContentSize.width, height: 55)
...@@ -246,6 +283,11 @@ import AVFoundation ...@@ -246,6 +283,11 @@ import AVFoundation
246 termsTextView.textAlignment = .center 283 termsTextView.textAlignment = .center
247 termsTextView.isScrollEnabled = false 284 termsTextView.isScrollEnabled = false
248 285
286 + termsTextView.isUserInteractionEnabled = true
287 + termsTextView.isEditable = false
288 + termsTextView.isSelectable = true
289 + termsTextView.dataDetectorTypes = [.link]
290 +
249 // Uncomment if Barcode Section is active again 291 // Uncomment if Barcode Section is active again
250 // toggleTerms() 292 // toggleTerms()
251 toggleBarcode() 293 toggleBarcode()
...@@ -265,6 +307,14 @@ import AVFoundation ...@@ -265,6 +307,14 @@ import AVFoundation
265 307
266 } 308 }
267 309
310 + public func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
311 + UIApplication.shared.open(URL)
312 +
313 + // Disable `.preview` by 3D Touch and other interactions
314 + return false
315 + }
316 +
317 +
268 // MARK: - Functions 318 // MARK: - Functions
269 func toggleTerms() { 319 func toggleTerms() {
270 if (termsVisible) { 320 if (termsVisible) {
......
...@@ -1384,13 +1384,13 @@ ...@@ -1384,13 +1384,13 @@
1384 <!--Coupon Barcode View Controller--> 1384 <!--Coupon Barcode View Controller-->
1385 <scene sceneID="7Dn-sf-iEB"> 1385 <scene sceneID="7Dn-sf-iEB">
1386 <objects> 1386 <objects>
1387 - <viewController storyboardIdentifier="CouponBarcodeViewController" hidesBottomBarWhenPushed="YES" id="CDt-eI-msA" customClass="CouponBarcodeViewController" customModule="SwiftWarplyFramework" customModuleProvider="target" sceneMemberID="viewController"> 1387 + <viewController storyboardIdentifier="CouponBarcodeViewController" hidesBottomBarWhenPushed="YES" id="CDt-eI-msA" customClass="CouponBarcodeViewController" customModule="ResourcesBundle" customModuleProvider="target" sceneMemberID="viewController">
1388 <view key="view" contentMode="scaleToFill" id="p8P-DP-0kH"> 1388 <view key="view" contentMode="scaleToFill" id="p8P-DP-0kH">
1389 <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> 1389 <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
1390 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> 1390 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1391 <subviews> 1391 <subviews>
1392 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="P3Q-nP-aSj" userLabel="Main View"> 1392 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="P3Q-nP-aSj" userLabel="Main View">
1393 - <rect key="frame" x="0.0" y="44" width="414" height="852"/> 1393 + <rect key="frame" x="0.0" y="48" width="414" height="848"/>
1394 <subviews> 1394 <subviews>
1395 <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="coupons_scrollview_white" translatesAutoresizingMaskIntoConstraints="NO" id="B6L-Zs-Vnz"> 1395 <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="coupons_scrollview_white" translatesAutoresizingMaskIntoConstraints="NO" id="B6L-Zs-Vnz">
1396 <rect key="frame" x="0.0" y="0.0" width="414" height="852"/> 1396 <rect key="frame" x="0.0" y="0.0" width="414" height="852"/>
...@@ -1419,17 +1419,27 @@ ...@@ -1419,17 +1419,27 @@
1419 <color key="textColor" red="0.25490196079999999" green="0.33333333329999998" blue="0.3921568627" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/> 1419 <color key="textColor" red="0.25490196079999999" green="0.33333333329999998" blue="0.3921568627" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
1420 <nil key="highlightedColor"/> 1420 <nil key="highlightedColor"/>
1421 </label> 1421 </label>
1422 + <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" textAlignment="center" selectable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tzW-b9-Rbx" customClass="UnselectableTappableTextView" customModule="SwiftWarplyFramework">
1423 + <rect key="frame" x="20" y="335" width="374" height="0.0"/>
1424 + <color key="backgroundColor" systemColor="systemBackgroundColor"/>
1425 + <constraints>
1426 + <constraint firstAttribute="height" id="7ch-2U-9oE"/>
1427 + </constraints>
1428 + <color key="textColor" red="0.25490196079999999" green="0.33333333329999998" blue="0.3921568627" alpha="1" colorSpace="calibratedRGB"/>
1429 + <fontDescription key="fontDescription" name="PFSquareSansPro-Regular" family="PF Square Sans Pro" pointSize="15"/>
1430 + <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
1431 + </textView>
1422 <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="Sg1-QU-FY1"> 1432 <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="Sg1-QU-FY1">
1423 - <rect key="frame" x="20" y="355" width="374" height="17"/> 1433 + <rect key="frame" x="20" y="370" width="374" height="17"/>
1424 <fontDescription key="fontDescription" name="PFSquareSansPro-Medium" family="PF Square Sans Pro" pointSize="17"/> 1434 <fontDescription key="fontDescription" name="PFSquareSansPro-Medium" family="PF Square Sans Pro" pointSize="17"/>
1425 <color key="textColor" red="0.25490196079999999" green="0.33333333329999998" blue="0.3921568627" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/> 1435 <color key="textColor" red="0.25490196079999999" green="0.33333333329999998" blue="0.3921568627" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
1426 <nil key="highlightedColor"/> 1436 <nil key="highlightedColor"/>
1427 </label> 1437 </label>
1428 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Zdf-1r-FdJ" userLabel="Coupon View"> 1438 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Zdf-1r-FdJ" userLabel="Coupon View">
1429 - <rect key="frame" x="152.5" y="382" width="109.5" height="55"/> 1439 + <rect key="frame" x="152.5" y="397" width="109" height="55"/>
1430 <subviews> 1440 <subviews>
1431 - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BJS-kk-CBZ" customClass="CopyableLabel" customModule="SwiftWarplyFramework" customModuleProvider="target"> 1441 + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BJS-kk-CBZ" customClass="CopyableLabel" customModule="ResourcesBundle" customModuleProvider="target">
1432 - <rect key="frame" x="20" y="13.5" width="69.5" height="28"/> 1442 + <rect key="frame" x="20" y="13.5" width="69" height="28"/>
1433 <fontDescription key="fontDescription" name="PFSquareSansPro-Bold" family="PF Square Sans Pro" pointSize="28"/> 1443 <fontDescription key="fontDescription" name="PFSquareSansPro-Bold" family="PF Square Sans Pro" pointSize="28"/>
1434 <color key="textColor" red="0.25490196078431371" green="0.33333333333333331" blue="0.39215686274509803" alpha="1" colorSpace="calibratedRGB"/> 1444 <color key="textColor" red="0.25490196078431371" green="0.33333333333333331" blue="0.39215686274509803" alpha="1" colorSpace="calibratedRGB"/>
1435 <nil key="highlightedColor"/> 1445 <nil key="highlightedColor"/>
...@@ -1444,20 +1454,20 @@ ...@@ -1444,20 +1454,20 @@
1444 </constraints> 1454 </constraints>
1445 </view> 1455 </view>
1446 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jrM-7n-fSw" userLabel="Border View"> 1456 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jrM-7n-fSw" userLabel="Border View">
1447 - <rect key="frame" x="20" y="457" width="374" height="1"/> 1457 + <rect key="frame" x="20" y="472" width="374" height="1"/>
1448 <color key="backgroundColor" red="0.90196078431372551" green="0.90196078431372551" blue="0.90196078431372551" alpha="1" colorSpace="calibratedRGB"/> 1458 <color key="backgroundColor" red="0.90196078431372551" green="0.90196078431372551" blue="0.90196078431372551" alpha="1" colorSpace="calibratedRGB"/>
1449 <constraints> 1459 <constraints>
1450 <constraint firstAttribute="height" constant="1" id="eF3-7T-hMu"/> 1460 <constraint firstAttribute="height" constant="1" id="eF3-7T-hMu"/>
1451 </constraints> 1461 </constraints>
1452 </view> 1462 </view>
1453 <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="huh-zh-82C"> 1463 <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="huh-zh-82C">
1454 - <rect key="frame" x="30" y="468" width="354" height="110"/> 1464 + <rect key="frame" x="30" y="483" width="354" height="110"/>
1455 <constraints> 1465 <constraints>
1456 <constraint firstAttribute="height" constant="110" id="LJq-uV-eb8"/> 1466 <constraint firstAttribute="height" constant="110" id="LJq-uV-eb8"/>
1457 </constraints> 1467 </constraints>
1458 </imageView> 1468 </imageView>
1459 <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="EKv-Mx-6Yv"> 1469 <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="EKv-Mx-6Yv">
1460 - <rect key="frame" x="20" y="588" width="374" height="26.5"/> 1470 + <rect key="frame" x="20" y="603" width="374" height="26.5"/>
1461 <constraints> 1471 <constraints>
1462 <constraint firstAttribute="height" constant="26.5" id="LfJ-bC-nLk"/> 1472 <constraint firstAttribute="height" constant="26.5" id="LfJ-bC-nLk"/>
1463 </constraints> 1473 </constraints>
...@@ -1466,14 +1476,14 @@ ...@@ -1466,14 +1476,14 @@
1466 <nil key="highlightedColor"/> 1476 <nil key="highlightedColor"/>
1467 </label> 1477 </label>
1468 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6rV-2m-QMZ" userLabel="Border 2 View"> 1478 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6rV-2m-QMZ" userLabel="Border 2 View">
1469 - <rect key="frame" x="20" y="629.5" width="374" height="1"/> 1479 + <rect key="frame" x="20" y="644.5" width="374" height="1"/>
1470 <color key="backgroundColor" red="0.90196078430000004" green="0.90196078430000004" blue="0.90196078430000004" alpha="1" colorSpace="calibratedRGB"/> 1480 <color key="backgroundColor" red="0.90196078430000004" green="0.90196078430000004" blue="0.90196078430000004" alpha="1" colorSpace="calibratedRGB"/>
1471 <constraints> 1481 <constraints>
1472 <constraint firstAttribute="height" constant="1" id="DVl-3B-zqo"/> 1482 <constraint firstAttribute="height" constant="1" id="DVl-3B-zqo"/>
1473 </constraints> 1483 </constraints>
1474 </view> 1484 </view>
1475 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Zw5-Wj-WD5"> 1485 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Zw5-Wj-WD5">
1476 - <rect key="frame" x="103.5" y="640.5" width="207" height="50"/> 1486 + <rect key="frame" x="103.5" y="655.5" width="207" height="50"/>
1477 <constraints> 1487 <constraints>
1478 <constraint firstAttribute="height" constant="50" id="ZSP-NX-0a7"/> 1488 <constraint firstAttribute="height" constant="50" id="ZSP-NX-0a7"/>
1479 </constraints> 1489 </constraints>
...@@ -1488,13 +1498,13 @@ ...@@ -1488,13 +1498,13 @@
1488 </connections> 1498 </connections>
1489 </button> 1499 </button>
1490 <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="UhC-Lj-tfN"> 1500 <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="UhC-Lj-tfN">
1491 - <rect key="frame" x="20" y="725.5" width="374" height="15"/> 1501 + <rect key="frame" x="20" y="740.5" width="374" height="15"/>
1492 <fontDescription key="fontDescription" name="PFSquareSansPro-Regular" family="PF Square Sans Pro" pointSize="15"/> 1502 <fontDescription key="fontDescription" name="PFSquareSansPro-Regular" family="PF Square Sans Pro" pointSize="15"/>
1493 <color key="textColor" red="0.25490196079999999" green="0.33333333329999998" blue="0.3921568627" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/> 1503 <color key="textColor" red="0.25490196079999999" green="0.33333333329999998" blue="0.3921568627" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
1494 <nil key="highlightedColor"/> 1504 <nil key="highlightedColor"/>
1495 </label> 1505 </label>
1496 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8cR-Rc-YMJ"> 1506 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8cR-Rc-YMJ">
1497 - <rect key="frame" x="169" y="775.5" width="76" height="44"/> 1507 + <rect key="frame" x="172.5" y="790.5" width="69" height="44"/>
1498 <constraints> 1508 <constraints>
1499 <constraint firstAttribute="height" constant="44" id="ccg-NP-FIH"/> 1509 <constraint firstAttribute="height" constant="44" id="ccg-NP-FIH"/>
1500 </constraints> 1510 </constraints>
...@@ -1508,7 +1518,7 @@ ...@@ -1508,7 +1518,7 @@
1508 </connections> 1518 </connections>
1509 </button> 1519 </button>
1510 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="W5f-1T-iW6"> 1520 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="W5f-1T-iW6">
1511 - <rect key="frame" x="139.5" y="829.5" width="135" height="44"/> 1521 + <rect key="frame" x="139.5" y="844.5" width="135" height="44"/>
1512 <constraints> 1522 <constraints>
1513 <constraint firstAttribute="height" constant="44" id="3pq-y5-f66"/> 1523 <constraint firstAttribute="height" constant="44" id="3pq-y5-f66"/>
1514 </constraints> 1524 </constraints>
...@@ -1522,7 +1532,7 @@ ...@@ -1522,7 +1532,7 @@
1522 </connections> 1532 </connections>
1523 </button> 1533 </button>
1524 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8UD-WL-JB7"> 1534 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8UD-WL-JB7">
1525 - <rect key="frame" x="103.5" y="893.5" width="207" height="50"/> 1535 + <rect key="frame" x="103.5" y="908.5" width="207" height="50"/>
1526 <constraints> 1536 <constraints>
1527 <constraint firstAttribute="height" constant="50" id="xdq-YS-AL4"/> 1537 <constraint firstAttribute="height" constant="50" id="xdq-YS-AL4"/>
1528 </constraints> 1538 </constraints>
...@@ -1536,8 +1546,8 @@ ...@@ -1536,8 +1546,8 @@
1536 <action selector="termsButtonAction:" destination="CDt-eI-msA" eventType="touchUpInside" id="zrs-az-yjI"/> 1546 <action selector="termsButtonAction:" destination="CDt-eI-msA" eventType="touchUpInside" id="zrs-az-yjI"/>
1537 </connections> 1547 </connections>
1538 </button> 1548 </button>
1539 - <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" textAlignment="center" selectable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xjX-HZ-MpD"> 1549 + <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" textAlignment="center" selectable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xjX-HZ-MpD" customClass="UnselectableTappableTextView" customModule="SwiftWarplyFramework">
1540 - <rect key="frame" x="20" y="953.5" width="374" height="0.0"/> 1550 + <rect key="frame" x="20" y="968.5" width="374" height="0.0"/>
1541 <color key="backgroundColor" systemColor="systemBackgroundColor"/> 1551 <color key="backgroundColor" systemColor="systemBackgroundColor"/>
1542 <constraints> 1552 <constraints>
1543 <constraint firstAttribute="height" id="3GU-tg-S3t"/> 1553 <constraint firstAttribute="height" id="3GU-tg-S3t"/>
...@@ -1560,6 +1570,7 @@ ...@@ -1560,6 +1570,7 @@
1560 <constraint firstItem="mri-Wl-spg" firstAttribute="top" secondItem="Xz4-EE-EzJ" secondAttribute="bottom" constant="15" id="9W8-fX-IzR"/> 1570 <constraint firstItem="mri-Wl-spg" firstAttribute="top" secondItem="Xz4-EE-EzJ" secondAttribute="bottom" constant="15" id="9W8-fX-IzR"/>
1561 <constraint firstItem="xjX-HZ-MpD" firstAttribute="leading" secondItem="1ec-eH-fkX" secondAttribute="leading" constant="20" id="AIW-Kf-tkQ"/> 1571 <constraint firstItem="xjX-HZ-MpD" firstAttribute="leading" secondItem="1ec-eH-fkX" secondAttribute="leading" constant="20" id="AIW-Kf-tkQ"/>
1562 <constraint firstItem="Zw5-Wj-WD5" firstAttribute="centerX" secondItem="1ec-eH-fkX" secondAttribute="centerX" id="BgT-3L-aZo"/> 1572 <constraint firstItem="Zw5-Wj-WD5" firstAttribute="centerX" secondItem="1ec-eH-fkX" secondAttribute="centerX" id="BgT-3L-aZo"/>
1573 + <constraint firstItem="tzW-b9-Rbx" firstAttribute="top" secondItem="mri-Wl-spg" secondAttribute="bottom" constant="15" id="Cep-Md-KJT"/>
1563 <constraint firstItem="jrM-7n-fSw" firstAttribute="top" secondItem="Zdf-1r-FdJ" secondAttribute="bottom" constant="20" id="G5W-a3-pag"/> 1574 <constraint firstItem="jrM-7n-fSw" firstAttribute="top" secondItem="Zdf-1r-FdJ" secondAttribute="bottom" constant="20" id="G5W-a3-pag"/>
1564 <constraint firstItem="huh-zh-82C" firstAttribute="top" secondItem="jrM-7n-fSw" secondAttribute="bottom" constant="10" id="GQF-H5-SZp"/> 1575 <constraint firstItem="huh-zh-82C" firstAttribute="top" secondItem="jrM-7n-fSw" secondAttribute="bottom" constant="10" id="GQF-H5-SZp"/>
1565 <constraint firstItem="iiM-5P-m5s" firstAttribute="top" secondItem="1ec-eH-fkX" secondAttribute="top" id="H9I-TB-xig"/> 1576 <constraint firstItem="iiM-5P-m5s" firstAttribute="top" secondItem="1ec-eH-fkX" secondAttribute="top" id="H9I-TB-xig"/>
...@@ -1569,16 +1580,17 @@ ...@@ -1569,16 +1580,17 @@
1569 <constraint firstAttribute="trailing" secondItem="6rV-2m-QMZ" secondAttribute="trailing" constant="20" id="NGe-PV-pQl"/> 1580 <constraint firstAttribute="trailing" secondItem="6rV-2m-QMZ" secondAttribute="trailing" constant="20" id="NGe-PV-pQl"/>
1570 <constraint firstAttribute="trailing" secondItem="mri-Wl-spg" secondAttribute="trailing" constant="20" id="NmE-Pu-v1S"/> 1581 <constraint firstAttribute="trailing" secondItem="mri-Wl-spg" secondAttribute="trailing" constant="20" id="NmE-Pu-v1S"/>
1571 <constraint firstAttribute="trailing" secondItem="EKv-Mx-6Yv" secondAttribute="trailing" constant="20" id="OeB-T7-87x"/> 1582 <constraint firstAttribute="trailing" secondItem="EKv-Mx-6Yv" secondAttribute="trailing" constant="20" id="OeB-T7-87x"/>
1583 + <constraint firstAttribute="trailing" secondItem="tzW-b9-Rbx" secondAttribute="trailing" constant="20" id="PCc-Gh-FFR"/>
1572 <constraint firstItem="W5f-1T-iW6" firstAttribute="centerX" secondItem="1ec-eH-fkX" secondAttribute="centerX" id="Pug-Ej-C69"/> 1584 <constraint firstItem="W5f-1T-iW6" firstAttribute="centerX" secondItem="1ec-eH-fkX" secondAttribute="centerX" id="Pug-Ej-C69"/>
1573 <constraint firstItem="W5f-1T-iW6" firstAttribute="top" secondItem="8cR-Rc-YMJ" secondAttribute="bottom" constant="10" id="Rbe-XQ-CIj"/> 1585 <constraint firstItem="W5f-1T-iW6" firstAttribute="top" secondItem="8cR-Rc-YMJ" secondAttribute="bottom" constant="10" id="Rbe-XQ-CIj"/>
1574 <constraint firstAttribute="trailing" secondItem="jrM-7n-fSw" secondAttribute="trailing" constant="20" id="ReY-xR-F8V"/> 1586 <constraint firstAttribute="trailing" secondItem="jrM-7n-fSw" secondAttribute="trailing" constant="20" id="ReY-xR-F8V"/>
1575 <constraint firstItem="Xz4-EE-EzJ" firstAttribute="top" secondItem="iiM-5P-m5s" secondAttribute="bottom" constant="20" id="Ryr-v8-THU"/> 1587 <constraint firstItem="Xz4-EE-EzJ" firstAttribute="top" secondItem="iiM-5P-m5s" secondAttribute="bottom" constant="20" id="Ryr-v8-THU"/>
1588 + <constraint firstItem="Sg1-QU-FY1" firstAttribute="top" secondItem="tzW-b9-Rbx" secondAttribute="bottom" constant="35" id="WWh-BA-7qP"/>
1576 <constraint firstItem="xjX-HZ-MpD" firstAttribute="top" secondItem="8UD-WL-JB7" secondAttribute="bottom" constant="10" id="XFI-ij-KkC"/> 1589 <constraint firstItem="xjX-HZ-MpD" firstAttribute="top" secondItem="8UD-WL-JB7" secondAttribute="bottom" constant="10" id="XFI-ij-KkC"/>
1577 <constraint firstItem="mri-Wl-spg" firstAttribute="leading" secondItem="1ec-eH-fkX" secondAttribute="leading" constant="20" id="YLo-Lg-Lda"/> 1590 <constraint firstItem="mri-Wl-spg" firstAttribute="leading" secondItem="1ec-eH-fkX" secondAttribute="leading" constant="20" id="YLo-Lg-Lda"/>
1578 <constraint firstItem="Zdf-1r-FdJ" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="1ec-eH-fkX" secondAttribute="leading" constant="25" id="ZQd-cZ-JwO"/> 1591 <constraint firstItem="Zdf-1r-FdJ" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="1ec-eH-fkX" secondAttribute="leading" constant="25" id="ZQd-cZ-JwO"/>
1579 <constraint firstItem="6rV-2m-QMZ" firstAttribute="leading" secondItem="1ec-eH-fkX" secondAttribute="leading" constant="20" id="bcQ-yl-h1d"/> 1592 <constraint firstItem="6rV-2m-QMZ" firstAttribute="leading" secondItem="1ec-eH-fkX" secondAttribute="leading" constant="20" id="bcQ-yl-h1d"/>
1580 <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="Zdf-1r-FdJ" secondAttribute="trailing" constant="25" id="c0p-Op-6VI"/> 1593 <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="Zdf-1r-FdJ" secondAttribute="trailing" constant="25" id="c0p-Op-6VI"/>
1581 - <constraint firstItem="Sg1-QU-FY1" firstAttribute="top" secondItem="mri-Wl-spg" secondAttribute="bottom" constant="35" id="dOs-ap-XJ4"/>
1582 <constraint firstItem="iiM-5P-m5s" firstAttribute="leading" secondItem="1ec-eH-fkX" secondAttribute="leading" id="e6i-V3-Csq"/> 1594 <constraint firstItem="iiM-5P-m5s" firstAttribute="leading" secondItem="1ec-eH-fkX" secondAttribute="leading" id="e6i-V3-Csq"/>
1583 <constraint firstItem="8UD-WL-JB7" firstAttribute="centerX" secondItem="1ec-eH-fkX" secondAttribute="centerX" id="eFM-ex-Dye"/> 1595 <constraint firstItem="8UD-WL-JB7" firstAttribute="centerX" secondItem="1ec-eH-fkX" secondAttribute="centerX" id="eFM-ex-Dye"/>
1584 <constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="8UD-WL-JB7" secondAttribute="bottom" constant="30" id="emI-WB-sXK"/> 1596 <constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="8UD-WL-JB7" secondAttribute="bottom" constant="30" id="emI-WB-sXK"/>
...@@ -1591,6 +1603,7 @@ ...@@ -1591,6 +1603,7 @@
1591 <constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="xjX-HZ-MpD" secondAttribute="bottom" constant="30" id="kLr-ZV-vCo"/> 1603 <constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="xjX-HZ-MpD" secondAttribute="bottom" constant="30" id="kLr-ZV-vCo"/>
1592 <constraint firstAttribute="trailing" secondItem="UhC-Lj-tfN" secondAttribute="trailing" constant="20" id="lM1-ep-Zec"/> 1604 <constraint firstAttribute="trailing" secondItem="UhC-Lj-tfN" secondAttribute="trailing" constant="20" id="lM1-ep-Zec"/>
1593 <constraint firstItem="Xz4-EE-EzJ" firstAttribute="leading" secondItem="1ec-eH-fkX" secondAttribute="leading" constant="20" id="lMf-pF-Bp6"/> 1605 <constraint firstItem="Xz4-EE-EzJ" firstAttribute="leading" secondItem="1ec-eH-fkX" secondAttribute="leading" constant="20" id="lMf-pF-Bp6"/>
1606 + <constraint firstItem="tzW-b9-Rbx" firstAttribute="leading" secondItem="1ec-eH-fkX" secondAttribute="leading" constant="20" id="oYF-cS-wt4"/>
1594 <constraint firstItem="UhC-Lj-tfN" firstAttribute="top" secondItem="Zw5-Wj-WD5" secondAttribute="bottom" constant="35" id="ora-fw-TKe"/> 1607 <constraint firstItem="UhC-Lj-tfN" firstAttribute="top" secondItem="Zw5-Wj-WD5" secondAttribute="bottom" constant="35" id="ora-fw-TKe"/>
1595 <constraint firstAttribute="trailing" secondItem="iiM-5P-m5s" secondAttribute="trailing" id="qWA-17-dEY"/> 1608 <constraint firstAttribute="trailing" secondItem="iiM-5P-m5s" secondAttribute="trailing" id="qWA-17-dEY"/>
1596 <constraint firstAttribute="trailing" secondItem="xjX-HZ-MpD" secondAttribute="trailing" constant="20" id="rIc-bw-vfp"/> 1609 <constraint firstAttribute="trailing" secondItem="xjX-HZ-MpD" secondAttribute="trailing" constant="20" id="rIc-bw-vfp"/>
...@@ -1665,6 +1678,9 @@ ...@@ -1665,6 +1678,9 @@
1665 <outlet property="mapButton" destination="W5f-1T-iW6" id="2IL-QE-TdM"/> 1678 <outlet property="mapButton" destination="W5f-1T-iW6" id="2IL-QE-TdM"/>
1666 <outlet property="mapButtonHeight" destination="3pq-y5-f66" id="oFZ-P9-dUD"/> 1679 <outlet property="mapButtonHeight" destination="3pq-y5-f66" id="oFZ-P9-dUD"/>
1667 <outlet property="mapButtonTopSpace" destination="Rbe-XQ-CIj" id="Mpv-Gg-awa"/> 1680 <outlet property="mapButtonTopSpace" destination="Rbe-XQ-CIj" id="Mpv-Gg-awa"/>
1681 + <outlet property="merchantDescrTextView" destination="tzW-b9-Rbx" id="qNm-R0-Ga2"/>
1682 + <outlet property="merchantDescrTextViewHeight" destination="7ch-2U-9oE" id="eat-iQ-eIS"/>
1683 + <outlet property="merchantDescrTextViewTopSpace" destination="Cep-Md-KJT" id="39u-Io-Zqp"/>
1668 <outlet property="nameLabel" destination="Xz4-EE-EzJ" id="zTY-n5-36h"/> 1684 <outlet property="nameLabel" destination="Xz4-EE-EzJ" id="zTY-n5-36h"/>
1669 <outlet property="redeemButton" destination="8cR-Rc-YMJ" id="atB-0m-8ff"/> 1685 <outlet property="redeemButton" destination="8cR-Rc-YMJ" id="atB-0m-8ff"/>
1670 <outlet property="scrollContentView" destination="1ec-eH-fkX" id="IZE-ie-TUA"/> 1686 <outlet property="scrollContentView" destination="1ec-eH-fkX" id="IZE-ie-TUA"/>
......
...@@ -490,3 +490,35 @@ extension UINavigationController { ...@@ -490,3 +490,35 @@ extension UINavigationController {
490 return nil 490 return nil
491 } 491 }
492 } 492 }
493 +
494 +/// Class to allow links but no selection.
495 +/// Basically, it disables unwanted UIGestureRecognizer from UITextView.
496 +class UnselectableTappableTextView: UITextView {
497 +
498 + // required to prevent blue background selection from any situation
499 + override var selectedTextRange: UITextRange? {
500 + get { return nil }
501 + set {}
502 + }
503 +
504 + override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
505 + if gestureRecognizer is UIPanGestureRecognizer {
506 + // required for compatibility with isScrollEnabled
507 + return super.gestureRecognizerShouldBegin(gestureRecognizer)
508 + }
509 + if let tapGestureRecognizer = gestureRecognizer as? UITapGestureRecognizer,
510 + tapGestureRecognizer.numberOfTapsRequired == 1 {
511 + // required for compatibility with links
512 + return super.gestureRecognizerShouldBegin(gestureRecognizer)
513 + }
514 + // allowing smallDelayRecognizer for links
515 + if let longPressGestureRecognizer = gestureRecognizer as? UILongPressGestureRecognizer,
516 + // comparison value is used to distinguish between 0.12 (smallDelayRecognizer) and 0.5 (textSelectionForce and textLoupe)
517 + longPressGestureRecognizer.minimumPressDuration < 0.325 {
518 + return super.gestureRecognizerShouldBegin(gestureRecognizer)
519 + }
520 + // preventing selection from loupe/magnifier (_UITextSelectionForceGesture), multi tap, tap and a half, etc.
521 + gestureRecognizer.isEnabled = false
522 + return false
523 + }
524 +}
......