Manos Chorianopoulos

Add merchant description to CouponBarcodeVC

......@@ -10,7 +10,7 @@ import UIKit
import AVFoundation
// import SwiftEventBus
@objc public class CouponBarcodeViewController: UIViewController {
@objc public class CouponBarcodeViewController: UIViewController, UITextViewDelegate {
@IBOutlet weak var mainView: UIView!
@IBOutlet weak var backgroundImage: UIImageView!
@IBOutlet weak var scrollView: UIScrollView!
......@@ -19,6 +19,9 @@ import AVFoundation
@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!
......@@ -29,7 +32,7 @@ import AVFoundation
@IBOutlet weak var expirationLabel: UILabel!
@IBOutlet weak var redeemButton: UIButton!
@IBOutlet weak var termsButton: UIButton!
@IBOutlet weak var termsTextView: UITextView!
@IBOutlet weak var termsTextView: UnselectableTappableTextView!
@IBOutlet weak var termsTextViewHeight: NSLayoutConstraint!
@IBOutlet weak var borderViewHeight: NSLayoutConstraint!
@IBOutlet weak var borderView2Height: NSLayoutConstraint!
......@@ -60,6 +63,8 @@ import AVFoundation
super.viewDidLoad()
self.hidesBottomBarWhenPushed = true
merchantDescrTextView.delegate = self
termsTextView.delegate = self
// Do any additional setup after loading the view.
setBackButton()
......@@ -101,6 +106,38 @@ import AVFoundation
nameLabel.text = couponSetData?.name ?? ""
discriptionLabel.text = couponSetData?.short_description ?? ""
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: "PFSquareSansPro-Regular", size: 17)
merchantDescrTextView.textColor = UIColor(red: 0.25, green: 0.33, blue: 0.39, 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 = 8
couponNumberLabel.text = coupon?.coupon ?? ""
couponView.frame = CGRect(x: 0.0, y: 0.0, width: couponView.intrinsicContentSize.width, height: 55)
......@@ -246,6 +283,11 @@ import AVFoundation
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()
......@@ -265,6 +307,14 @@ import AVFoundation
}
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) {
......
......@@ -1384,13 +1384,13 @@
<!--Coupon Barcode View Controller-->
<scene sceneID="7Dn-sf-iEB">
<objects>
<viewController storyboardIdentifier="CouponBarcodeViewController" hidesBottomBarWhenPushed="YES" id="CDt-eI-msA" customClass="CouponBarcodeViewController" customModule="SwiftWarplyFramework" customModuleProvider="target" sceneMemberID="viewController">
<viewController storyboardIdentifier="CouponBarcodeViewController" hidesBottomBarWhenPushed="YES" id="CDt-eI-msA" customClass="CouponBarcodeViewController" customModule="ResourcesBundle" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="p8P-DP-0kH">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="P3Q-nP-aSj" userLabel="Main View">
<rect key="frame" x="0.0" y="44" width="414" height="852"/>
<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="B6L-Zs-Vnz">
<rect key="frame" x="0.0" y="0.0" width="414" height="852"/>
......@@ -1419,17 +1419,27 @@
<color key="textColor" red="0.25490196079999999" green="0.33333333329999998" blue="0.3921568627" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" textAlignment="center" selectable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tzW-b9-Rbx" 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="7ch-2U-9oE"/>
</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>
<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">
<rect key="frame" x="20" y="355" width="374" height="17"/>
<rect key="frame" x="20" y="370" width="374" height="17"/>
<fontDescription key="fontDescription" name="PFSquareSansPro-Medium" family="PF Square Sans Pro" pointSize="17"/>
<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="Zdf-1r-FdJ" userLabel="Coupon View">
<rect key="frame" x="152.5" y="382" width="109.5" height="55"/>
<rect key="frame" x="152.5" y="397" width="109" 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="BJS-kk-CBZ" customClass="CopyableLabel" customModule="SwiftWarplyFramework" customModuleProvider="target">
<rect key="frame" x="20" y="13.5" width="69.5" height="28"/>
<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">
<rect key="frame" x="20" y="13.5" width="69" height="28"/>
<fontDescription key="fontDescription" name="PFSquareSansPro-Bold" family="PF Square Sans Pro" pointSize="28"/>
<color key="textColor" red="0.25490196078431371" green="0.33333333333333331" blue="0.39215686274509803" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
......@@ -1444,20 +1454,20 @@
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jrM-7n-fSw" userLabel="Border View">
<rect key="frame" x="20" y="457" width="374" height="1"/>
<rect key="frame" x="20" y="472" width="374" height="1"/>
<color key="backgroundColor" red="0.90196078431372551" green="0.90196078431372551" blue="0.90196078431372551" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="eF3-7T-hMu"/>
</constraints>
</view>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="huh-zh-82C">
<rect key="frame" x="30" y="468" width="354" height="110"/>
<rect key="frame" x="30" y="483" width="354" height="110"/>
<constraints>
<constraint firstAttribute="height" constant="110" id="LJq-uV-eb8"/>
</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="EKv-Mx-6Yv">
<rect key="frame" x="20" y="588" width="374" height="26.5"/>
<rect key="frame" x="20" y="603" width="374" height="26.5"/>
<constraints>
<constraint firstAttribute="height" constant="26.5" id="LfJ-bC-nLk"/>
</constraints>
......@@ -1466,14 +1476,14 @@
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6rV-2m-QMZ" userLabel="Border 2 View">
<rect key="frame" x="20" y="629.5" width="374" height="1"/>
<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="DVl-3B-zqo"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Zw5-Wj-WD5">
<rect key="frame" x="103.5" y="640.5" width="207" height="50"/>
<rect key="frame" x="103.5" y="655.5" width="207" height="50"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="ZSP-NX-0a7"/>
</constraints>
......@@ -1488,13 +1498,13 @@
</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="UhC-Lj-tfN">
<rect key="frame" x="20" y="725.5" width="374" height="15"/>
<rect key="frame" x="20" y="740.5" width="374" height="15"/>
<fontDescription key="fontDescription" name="PFSquareSansPro-Regular" family="PF Square Sans Pro" pointSize="15"/>
<color key="textColor" red="0.25490196079999999" green="0.33333333329999998" blue="0.3921568627" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8cR-Rc-YMJ">
<rect key="frame" x="169" y="775.5" width="76" height="44"/>
<rect key="frame" x="172.5" y="790.5" width="69" height="44"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="ccg-NP-FIH"/>
</constraints>
......@@ -1508,7 +1518,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="W5f-1T-iW6">
<rect key="frame" x="139.5" y="829.5" width="135" height="44"/>
<rect key="frame" x="139.5" y="844.5" width="135" height="44"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="3pq-y5-f66"/>
</constraints>
......@@ -1522,7 +1532,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8UD-WL-JB7">
<rect key="frame" x="103.5" y="893.5" width="207" height="50"/>
<rect key="frame" x="103.5" y="908.5" width="207" height="50"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="xdq-YS-AL4"/>
</constraints>
......@@ -1536,8 +1546,8 @@
<action selector="termsButtonAction:" destination="CDt-eI-msA" eventType="touchUpInside" id="zrs-az-yjI"/>
</connections>
</button>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" textAlignment="center" selectable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xjX-HZ-MpD">
<rect key="frame" x="20" y="953.5" width="374" height="0.0"/>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" textAlignment="center" selectable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xjX-HZ-MpD" customClass="UnselectableTappableTextView" customModule="SwiftWarplyFramework">
<rect key="frame" x="20" y="968.5" width="374" height="0.0"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="height" id="3GU-tg-S3t"/>
......@@ -1560,6 +1570,7 @@
<constraint firstItem="mri-Wl-spg" firstAttribute="top" secondItem="Xz4-EE-EzJ" secondAttribute="bottom" constant="15" id="9W8-fX-IzR"/>
<constraint firstItem="xjX-HZ-MpD" firstAttribute="leading" secondItem="1ec-eH-fkX" secondAttribute="leading" constant="20" id="AIW-Kf-tkQ"/>
<constraint firstItem="Zw5-Wj-WD5" firstAttribute="centerX" secondItem="1ec-eH-fkX" secondAttribute="centerX" id="BgT-3L-aZo"/>
<constraint firstItem="tzW-b9-Rbx" firstAttribute="top" secondItem="mri-Wl-spg" secondAttribute="bottom" constant="15" id="Cep-Md-KJT"/>
<constraint firstItem="jrM-7n-fSw" firstAttribute="top" secondItem="Zdf-1r-FdJ" secondAttribute="bottom" constant="20" id="G5W-a3-pag"/>
<constraint firstItem="huh-zh-82C" firstAttribute="top" secondItem="jrM-7n-fSw" secondAttribute="bottom" constant="10" id="GQF-H5-SZp"/>
<constraint firstItem="iiM-5P-m5s" firstAttribute="top" secondItem="1ec-eH-fkX" secondAttribute="top" id="H9I-TB-xig"/>
......@@ -1569,16 +1580,17 @@
<constraint firstAttribute="trailing" secondItem="6rV-2m-QMZ" secondAttribute="trailing" constant="20" id="NGe-PV-pQl"/>
<constraint firstAttribute="trailing" secondItem="mri-Wl-spg" secondAttribute="trailing" constant="20" id="NmE-Pu-v1S"/>
<constraint firstAttribute="trailing" secondItem="EKv-Mx-6Yv" secondAttribute="trailing" constant="20" id="OeB-T7-87x"/>
<constraint firstAttribute="trailing" secondItem="tzW-b9-Rbx" secondAttribute="trailing" constant="20" id="PCc-Gh-FFR"/>
<constraint firstItem="W5f-1T-iW6" firstAttribute="centerX" secondItem="1ec-eH-fkX" secondAttribute="centerX" id="Pug-Ej-C69"/>
<constraint firstItem="W5f-1T-iW6" firstAttribute="top" secondItem="8cR-Rc-YMJ" secondAttribute="bottom" constant="10" id="Rbe-XQ-CIj"/>
<constraint firstAttribute="trailing" secondItem="jrM-7n-fSw" secondAttribute="trailing" constant="20" id="ReY-xR-F8V"/>
<constraint firstItem="Xz4-EE-EzJ" firstAttribute="top" secondItem="iiM-5P-m5s" secondAttribute="bottom" constant="20" id="Ryr-v8-THU"/>
<constraint firstItem="Sg1-QU-FY1" firstAttribute="top" secondItem="tzW-b9-Rbx" secondAttribute="bottom" constant="35" id="WWh-BA-7qP"/>
<constraint firstItem="xjX-HZ-MpD" firstAttribute="top" secondItem="8UD-WL-JB7" secondAttribute="bottom" constant="10" id="XFI-ij-KkC"/>
<constraint firstItem="mri-Wl-spg" firstAttribute="leading" secondItem="1ec-eH-fkX" secondAttribute="leading" constant="20" id="YLo-Lg-Lda"/>
<constraint firstItem="Zdf-1r-FdJ" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="1ec-eH-fkX" secondAttribute="leading" constant="25" id="ZQd-cZ-JwO"/>
<constraint firstItem="6rV-2m-QMZ" firstAttribute="leading" secondItem="1ec-eH-fkX" secondAttribute="leading" constant="20" id="bcQ-yl-h1d"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="Zdf-1r-FdJ" secondAttribute="trailing" constant="25" id="c0p-Op-6VI"/>
<constraint firstItem="Sg1-QU-FY1" firstAttribute="top" secondItem="mri-Wl-spg" secondAttribute="bottom" constant="35" id="dOs-ap-XJ4"/>
<constraint firstItem="iiM-5P-m5s" firstAttribute="leading" secondItem="1ec-eH-fkX" secondAttribute="leading" id="e6i-V3-Csq"/>
<constraint firstItem="8UD-WL-JB7" firstAttribute="centerX" secondItem="1ec-eH-fkX" secondAttribute="centerX" id="eFM-ex-Dye"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="8UD-WL-JB7" secondAttribute="bottom" constant="30" id="emI-WB-sXK"/>
......@@ -1591,6 +1603,7 @@
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="xjX-HZ-MpD" secondAttribute="bottom" constant="30" id="kLr-ZV-vCo"/>
<constraint firstAttribute="trailing" secondItem="UhC-Lj-tfN" secondAttribute="trailing" constant="20" id="lM1-ep-Zec"/>
<constraint firstItem="Xz4-EE-EzJ" firstAttribute="leading" secondItem="1ec-eH-fkX" secondAttribute="leading" constant="20" id="lMf-pF-Bp6"/>
<constraint firstItem="tzW-b9-Rbx" firstAttribute="leading" secondItem="1ec-eH-fkX" secondAttribute="leading" constant="20" id="oYF-cS-wt4"/>
<constraint firstItem="UhC-Lj-tfN" firstAttribute="top" secondItem="Zw5-Wj-WD5" secondAttribute="bottom" constant="35" id="ora-fw-TKe"/>
<constraint firstAttribute="trailing" secondItem="iiM-5P-m5s" secondAttribute="trailing" id="qWA-17-dEY"/>
<constraint firstAttribute="trailing" secondItem="xjX-HZ-MpD" secondAttribute="trailing" constant="20" id="rIc-bw-vfp"/>
......@@ -1665,6 +1678,9 @@
<outlet property="mapButton" destination="W5f-1T-iW6" id="2IL-QE-TdM"/>
<outlet property="mapButtonHeight" destination="3pq-y5-f66" id="oFZ-P9-dUD"/>
<outlet property="mapButtonTopSpace" destination="Rbe-XQ-CIj" id="Mpv-Gg-awa"/>
<outlet property="merchantDescrTextView" destination="tzW-b9-Rbx" id="qNm-R0-Ga2"/>
<outlet property="merchantDescrTextViewHeight" destination="7ch-2U-9oE" id="eat-iQ-eIS"/>
<outlet property="merchantDescrTextViewTopSpace" destination="Cep-Md-KJT" id="39u-Io-Zqp"/>
<outlet property="nameLabel" destination="Xz4-EE-EzJ" id="zTY-n5-36h"/>
<outlet property="redeemButton" destination="8cR-Rc-YMJ" id="atB-0m-8ff"/>
<outlet property="scrollContentView" destination="1ec-eH-fkX" id="IZE-ie-TUA"/>
......
......@@ -490,3 +490,35 @@ extension UINavigationController {
return nil
}
}
/// Class to allow links but no selection.
/// Basically, it disables unwanted UIGestureRecognizer from UITextView.
class UnselectableTappableTextView: UITextView {
// required to prevent blue background selection from any situation
override var selectedTextRange: UITextRange? {
get { return nil }
set {}
}
override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
if gestureRecognizer is UIPanGestureRecognizer {
// required for compatibility with isScrollEnabled
return super.gestureRecognizerShouldBegin(gestureRecognizer)
}
if let tapGestureRecognizer = gestureRecognizer as? UITapGestureRecognizer,
tapGestureRecognizer.numberOfTapsRequired == 1 {
// required for compatibility with links
return super.gestureRecognizerShouldBegin(gestureRecognizer)
}
// allowing smallDelayRecognizer for links
if let longPressGestureRecognizer = gestureRecognizer as? UILongPressGestureRecognizer,
// comparison value is used to distinguish between 0.12 (smallDelayRecognizer) and 0.5 (textSelectionForce and textLoupe)
longPressGestureRecognizer.minimumPressDuration < 0.325 {
return super.gestureRecognizerShouldBegin(gestureRecognizer)
}
// preventing selection from loupe/magnifier (_UITextSelectionForceGesture), multi tap, tap and a half, etc.
gestureRecognizer.isEnabled = false
return false
}
}
......