Manos Chorianopoulos

fix top gradient border line

......@@ -17,6 +17,7 @@ import UIKit
@IBOutlet weak var nameLabel: UILabel!
@IBOutlet weak var descriptionLabel: UILabel!
@IBOutlet weak var redeemButton: UIButton!
@IBOutlet weak var topBorderLine: UIImageView!
public var ccms: swiftApi.LoyaltyContextualOfferModel?
......@@ -41,9 +42,22 @@ import UIKit
backgroundImage.image = UIImage(named: "coupons_scrollview_white", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil)
scrollView.clipsToBounds = true
scrollView.layer.cornerRadius = 30
scrollView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
// scrollView.clipsToBounds = true
// scrollView.layer.cornerRadius = 30
// scrollView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
let image = UIImage(named: "top_border_line", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil)!
var aspectR: CGFloat = 0.0
aspectR = image.size.width/image.size.height
topBorderLine.translatesAutoresizingMaskIntoConstraints = false
topBorderLine.image = image
topBorderLine.contentMode = .scaleAspectFit
NSLayoutConstraint.activate([
topBorderLine.heightAnchor.constraint(equalTo: topBorderLine.widthAnchor, multiplier: 1/aspectR)
])
couponImage.load(link: ccms?._imageUrl ?? "", placeholder: UIImage(), cache: URLCache())
couponImage.contentMode = .scaleAspectFill
......
......@@ -37,6 +37,7 @@ import AVFoundation
@IBOutlet weak var barcodeLabelTopSpace: NSLayoutConstraint!
@IBOutlet weak var border2TopSpace: NSLayoutConstraint!
@IBOutlet weak var mapButton: UIButton!
@IBOutlet weak var topBorderLine: UIImageView!
let uiscreen: CGRect = UIScreen.main.bounds
......@@ -57,9 +58,22 @@ import AVFoundation
backgroundImage.image = UIImage(named: "coupons_scrollview_white", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil)
scrollView.clipsToBounds = true
scrollView.layer.cornerRadius = 30
scrollView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
// scrollView.clipsToBounds = true
// scrollView.layer.cornerRadius = 30
// scrollView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
let image = UIImage(named: "top_border_line", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil)!
var aspectR: CGFloat = 0.0
aspectR = image.size.width/image.size.height
topBorderLine.translatesAutoresizingMaskIntoConstraints = false
topBorderLine.image = image
topBorderLine.contentMode = .scaleAspectFit
NSLayoutConstraint.activate([
topBorderLine.heightAnchor.constraint(equalTo: topBorderLine.widthAnchor, multiplier: 1/aspectR)
])
// COUPONSET: desc, img_preview, name, terms
// COUPON: coupon, expiration, discount, status
......
......@@ -21,7 +21,8 @@ import SwiftEventBus
@IBOutlet weak var termsButton: UIButton!
@IBOutlet weak var termsTextView: UITextView!
@IBOutlet weak var termsTextViewHeight: NSLayoutConstraint!
@IBOutlet weak var topBorderLine: UIImageView!
public var ccms: swiftApi.LoyaltyContextualOfferModel?
public var profile:swiftApi.ProfileModel? = swiftApi().getConsumer()
......@@ -48,9 +49,22 @@ import SwiftEventBus
backgroundImage.image = UIImage(named: "coupons_scrollview_white", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil)
scrollView.clipsToBounds = true
scrollView.layer.cornerRadius = 30
scrollView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
// scrollView.clipsToBounds = true
// scrollView.layer.cornerRadius = 30
// scrollView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
let image = UIImage(named: "top_border_line", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil)!
var aspectR: CGFloat = 0.0
aspectR = image.size.width/image.size.height
topBorderLine.translatesAutoresizingMaskIntoConstraints = false
topBorderLine.image = image
topBorderLine.contentMode = .scaleAspectFit
NSLayoutConstraint.activate([
topBorderLine.heightAnchor.constraint(equalTo: topBorderLine.widthAnchor, multiplier: 1/aspectR)
])
couponImage.load(link: couponset?.img_preview ?? "", placeholder: UIImage(), cache: URLCache())
couponImage.contentMode = .scaleAspectFill
......
......@@ -1568,19 +1568,30 @@
<viewLayoutGuide key="contentLayoutGuide" id="4fu-Tq-CEO"/>
<viewLayoutGuide key="frameLayoutGuide" id="282-tV-FBh"/>
</scrollView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="PQs-Qn-5Rq">
<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 firstItem="PQs-Qn-5Rq" firstAttribute="leading" secondItem="P3Q-nP-aSj" secondAttribute="leading" id="93F-BU-7zv"/>
<constraint firstItem="D1m-2B-ehg" firstAttribute="leading" secondItem="P3Q-nP-aSj" secondAttribute="leading" id="AMp-IG-CcQ"/>
<constraint firstItem="B6L-Zs-Vnz" firstAttribute="top" secondItem="P3Q-nP-aSj" secondAttribute="top" id="BfW-Mh-FDd"/>
<constraint firstItem="1ec-eH-fkX" firstAttribute="height" relation="greaterThanOrEqual" secondItem="P3Q-nP-aSj" secondAttribute="height" id="F9b-Gx-lxj"/>
<constraint firstAttribute="bottom" secondItem="B6L-Zs-Vnz" secondAttribute="bottom" id="OZW-L0-2gZ"/>
<constraint firstAttribute="trailing" secondItem="D1m-2B-ehg" secondAttribute="trailing" id="OZg-9O-qKw"/>
<constraint firstItem="D1m-2B-ehg" firstAttribute="top" secondItem="P3Q-nP-aSj" secondAttribute="top" constant="2" id="b1K-LA-UXY"/>
<constraint firstItem="PQs-Qn-5Rq" firstAttribute="top" secondItem="P3Q-nP-aSj" secondAttribute="top" id="Yp2-9M-DSP"/>
<constraint firstItem="D1m-2B-ehg" firstAttribute="top" secondItem="P3Q-nP-aSj" secondAttribute="top" id="b1K-LA-UXY"/>
<constraint firstAttribute="trailing" secondItem="PQs-Qn-5Rq" secondAttribute="trailing" id="ibn-xE-xh3"/>
<constraint firstItem="B6L-Zs-Vnz" firstAttribute="leading" secondItem="P3Q-nP-aSj" secondAttribute="leading" id="oyw-NE-7bF"/>
<constraint firstAttribute="trailing" secondItem="B6L-Zs-Vnz" secondAttribute="trailing" id="twW-h7-cNb"/>
<constraint firstAttribute="bottom" secondItem="D1m-2B-ehg" secondAttribute="bottom" id="vw6-dc-3pg"/>
</constraints>
<variation key="default">
<mask key="subviews">
<exclude reference="B6L-Zs-Vnz"/>
</mask>
</variation>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="mZk-p4-W2P"/>
......@@ -1619,6 +1630,7 @@
<outlet property="termsButton" destination="8UD-WL-JB7" id="azl-dZ-6ey"/>
<outlet property="termsTextView" destination="xjX-HZ-MpD" id="8ZQ-e0-1Ib"/>
<outlet property="termsTextViewHeight" destination="3GU-tg-S3t" id="H3e-IQ-FGo"/>
<outlet property="topBorderLine" destination="PQs-Qn-5Rq" id="V9f-xB-2zP"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="tvH-ht-75E" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
......@@ -1785,19 +1797,30 @@
<viewLayoutGuide key="contentLayoutGuide" id="fXc-vI-HgW"/>
<viewLayoutGuide key="frameLayoutGuide" id="wi0-bn-nU4"/>
</scrollView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Ndy-dK-SEh">
<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="trailing" secondItem="QF0-ih-7ii" secondAttribute="trailing" id="1Dp-wN-6ea"/>
<constraint firstItem="qjm-11-Clh" firstAttribute="top" secondItem="y5q-8M-0jB" secondAttribute="top" constant="2" id="KFV-m0-qD9"/>
<constraint firstItem="qjm-11-Clh" firstAttribute="top" secondItem="y5q-8M-0jB" secondAttribute="top" id="KFV-m0-qD9"/>
<constraint firstAttribute="trailing" secondItem="qjm-11-Clh" secondAttribute="trailing" id="SLZ-0e-4Gf"/>
<constraint firstItem="9kx-ct-jms" firstAttribute="height" relation="greaterThanOrEqual" secondItem="y5q-8M-0jB" secondAttribute="height" id="X7v-Nl-Qah"/>
<constraint firstItem="Ndy-dK-SEh" firstAttribute="top" secondItem="y5q-8M-0jB" secondAttribute="top" id="bNQ-nG-5dQ"/>
<constraint firstItem="QF0-ih-7ii" firstAttribute="leading" secondItem="y5q-8M-0jB" secondAttribute="leading" id="ioY-Nv-rN8"/>
<constraint firstItem="Ndy-dK-SEh" firstAttribute="leading" secondItem="y5q-8M-0jB" secondAttribute="leading" id="lUo-SN-OzX"/>
<constraint firstItem="qjm-11-Clh" firstAttribute="leading" secondItem="y5q-8M-0jB" secondAttribute="leading" id="oVa-yv-1v2"/>
<constraint firstAttribute="trailing" secondItem="Ndy-dK-SEh" secondAttribute="trailing" id="otm-98-ABh"/>
<constraint firstItem="QF0-ih-7ii" firstAttribute="top" secondItem="y5q-8M-0jB" secondAttribute="top" id="pO7-RQ-VKz"/>
<constraint firstAttribute="bottom" secondItem="qjm-11-Clh" secondAttribute="bottom" id="rtH-Ju-JYH"/>
<constraint firstAttribute="bottom" secondItem="QF0-ih-7ii" secondAttribute="bottom" id="ry3-Ls-aHe"/>
</constraints>
<variation key="default">
<mask key="subviews">
<exclude reference="QF0-ih-7ii"/>
</mask>
</variation>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="ca4-2z-k86"/>
......@@ -1824,6 +1847,7 @@
<outlet property="senderArrowImage" destination="Ul8-d9-FfM" id="dol-tk-Wt3"/>
<outlet property="senderButton" destination="YD8-9K-Fp9" id="ZxN-6t-1SJ"/>
<outlet property="senderLabel" destination="GX7-IF-Gdd" id="U5C-LC-trH"/>
<outlet property="topBorderLine" destination="Ndy-dK-SEh" id="kKE-Vf-wGQ"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="0nA-Nd-CMT" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
......@@ -2093,19 +2117,30 @@
<viewLayoutGuide key="contentLayoutGuide" id="Fnc-An-qkX"/>
<viewLayoutGuide key="frameLayoutGuide" id="ffd-ce-497"/>
</scrollView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="hcQ-Ve-1FD">
<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 firstItem="1N5-oA-ZTb" firstAttribute="leading" secondItem="Jqu-cp-CWU" secondAttribute="leading" id="6xu-Fr-ayy"/>
<constraint firstItem="Oep-XD-blB" firstAttribute="leading" secondItem="Jqu-cp-CWU" secondAttribute="leading" id="EcY-pv-yN5"/>
<constraint firstAttribute="trailing" secondItem="hcQ-Ve-1FD" secondAttribute="trailing" id="I7B-N7-VTl"/>
<constraint firstItem="uTN-Qr-wBi" firstAttribute="height" relation="greaterThanOrEqual" secondItem="Jqu-cp-CWU" secondAttribute="height" id="IW1-Sy-djh"/>
<constraint firstItem="hcQ-Ve-1FD" firstAttribute="top" secondItem="Jqu-cp-CWU" secondAttribute="top" id="PES-LR-OoW"/>
<constraint firstItem="Oep-XD-blB" firstAttribute="top" secondItem="Jqu-cp-CWU" secondAttribute="top" id="Ykm-QS-49G"/>
<constraint firstAttribute="trailing" secondItem="1N5-oA-ZTb" secondAttribute="trailing" id="dQR-wy-Qcd"/>
<constraint firstItem="1N5-oA-ZTb" firstAttribute="top" secondItem="Jqu-cp-CWU" secondAttribute="top" constant="2" id="g8J-5T-9Mg"/>
<constraint firstItem="hcQ-Ve-1FD" firstAttribute="leading" secondItem="Jqu-cp-CWU" secondAttribute="leading" id="fuQ-bO-ePL"/>
<constraint firstItem="1N5-oA-ZTb" firstAttribute="top" secondItem="Jqu-cp-CWU" secondAttribute="top" id="g8J-5T-9Mg"/>
<constraint firstAttribute="bottom" secondItem="1N5-oA-ZTb" secondAttribute="bottom" id="kaG-d8-5oJ"/>
<constraint firstAttribute="bottom" secondItem="Oep-XD-blB" secondAttribute="bottom" id="kkx-h0-joG"/>
<constraint firstAttribute="trailing" secondItem="Oep-XD-blB" secondAttribute="trailing" id="xnN-ZO-lA9"/>
</constraints>
<variation key="default">
<mask key="subviews">
<exclude reference="Oep-XD-blB"/>
</mask>
</variation>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="TUZ-8z-puM"/>
......@@ -2130,6 +2165,7 @@
<outlet property="termsButton" destination="KvN-fk-rlm" id="pj7-bA-bhe"/>
<outlet property="termsTextView" destination="siA-c8-Ub8" id="EfZ-wm-ED6"/>
<outlet property="termsTextViewHeight" destination="BWJ-i6-UeO" id="GHO-YH-B9e"/>
<outlet property="topBorderLine" destination="hcQ-Ve-1FD" id="gJz-Qi-wo1"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="zFf-Es-4zg" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
......@@ -2413,7 +2449,7 @@
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="8dQ-SF-Z4E">
<rect key="frame" x="0.0" y="44" width="414" height="852"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="coupons_scrollview_white" translatesAutoresizingMaskIntoConstraints="NO" id="6ch-LK-yKY">
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="coupons_scrollview_white" translatesAutoresizingMaskIntoConstraints="NO" id="6ch-LK-yKY">
<rect key="frame" x="0.0" y="0.0" width="414" height="852"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
......@@ -2582,15 +2618,26 @@
<viewLayoutGuide key="contentLayoutGuide" id="BMi-Lt-iHA"/>
<viewLayoutGuide key="frameLayoutGuide" id="lpe-11-PKD"/>
</scrollView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="WsP-XD-haT">
<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 firstItem="AUR-1f-OXi" firstAttribute="top" secondItem="8dQ-SF-Z4E" secondAttribute="top" constant="2" id="2WB-7r-OOO"/>
<constraint firstItem="AUR-1f-OXi" firstAttribute="top" secondItem="8dQ-SF-Z4E" secondAttribute="top" id="2WB-7r-OOO"/>
<constraint firstItem="WsP-XD-haT" firstAttribute="leading" secondItem="8dQ-SF-Z4E" secondAttribute="leading" id="4gP-JN-7AO"/>
<constraint firstAttribute="bottom" secondItem="AUR-1f-OXi" secondAttribute="bottom" id="4vG-Q8-bNz"/>
<constraint firstAttribute="trailing" secondItem="WsP-XD-haT" secondAttribute="trailing" id="Axz-ps-gqf"/>
<constraint firstItem="YmP-9y-EV0" firstAttribute="height" relation="greaterThanOrEqual" secondItem="8dQ-SF-Z4E" secondAttribute="height" id="GdS-pE-6aU"/>
<constraint firstAttribute="trailing" secondItem="AUR-1f-OXi" secondAttribute="trailing" id="mNF-0M-9EM"/>
<constraint firstItem="AUR-1f-OXi" firstAttribute="leading" secondItem="8dQ-SF-Z4E" secondAttribute="leading" id="p3L-E5-UPD"/>
<constraint firstItem="WsP-XD-haT" firstAttribute="top" secondItem="8dQ-SF-Z4E" secondAttribute="top" id="wEx-J2-Kvu"/>
</constraints>
<variation key="default">
<mask key="subviews">
<exclude reference="6ch-LK-yKY"/>
</mask>
</variation>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="oUF-UR-3Da"/>
......@@ -2618,6 +2665,7 @@
<outlet property="nameLabel" destination="XJ0-lK-2fk" id="tL4-Ay-gb9"/>
<outlet property="scrollContentView" destination="YmP-9y-EV0" id="PLV-e9-qOd"/>
<outlet property="scrollView" destination="AUR-1f-OXi" id="u5N-8L-BVU"/>
<outlet property="topBorderLine" destination="WsP-XD-haT" id="xLG-6a-aSR"/>
<outlet property="valueLabel" destination="G7w-Tk-Yfm" id="9oX-f1-xS4"/>
<outlet property="valueView" destination="7La-Zf-BX7" id="Jeq-bO-HrK"/>
</connections>
......@@ -2707,19 +2755,30 @@
<viewLayoutGuide key="contentLayoutGuide" id="SCq-zB-WYb"/>
<viewLayoutGuide key="frameLayoutGuide" id="Ian-NJ-q5c"/>
</scrollView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="2cS-C7-kUz">
<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 firstItem="7rs-yJ-Kvn" firstAttribute="leading" secondItem="gV8-Ze-9jD" secondAttribute="leading" id="2f9-NI-DVc"/>
<constraint firstItem="fVG-0L-fYi" firstAttribute="leading" secondItem="gV8-Ze-9jD" secondAttribute="leading" id="8Wo-dr-SYr"/>
<constraint firstItem="2cS-C7-kUz" firstAttribute="leading" secondItem="gV8-Ze-9jD" secondAttribute="leading" id="9NQ-xJ-p7b"/>
<constraint firstAttribute="bottom" secondItem="fVG-0L-fYi" secondAttribute="bottom" id="F1h-dY-Qy9"/>
<constraint firstItem="7rs-yJ-Kvn" firstAttribute="top" secondItem="gV8-Ze-9jD" secondAttribute="top" id="Qqw-BH-PAa"/>
<constraint firstAttribute="bottom" secondItem="7rs-yJ-Kvn" secondAttribute="bottom" id="Syn-fK-lXo"/>
<constraint firstAttribute="trailing" secondItem="2cS-C7-kUz" secondAttribute="trailing" id="Trd-n7-OVT"/>
<constraint firstAttribute="trailing" secondItem="fVG-0L-fYi" secondAttribute="trailing" id="chL-lE-bqc"/>
<constraint firstItem="NHe-cF-AMf" firstAttribute="height" relation="greaterThanOrEqual" secondItem="gV8-Ze-9jD" secondAttribute="height" id="l9o-Lk-50b"/>
<constraint firstItem="fVG-0L-fYi" firstAttribute="top" secondItem="gV8-Ze-9jD" secondAttribute="top" constant="2" id="qnB-Bi-4Qj"/>
<constraint firstItem="fVG-0L-fYi" firstAttribute="top" secondItem="gV8-Ze-9jD" secondAttribute="top" id="qnB-Bi-4Qj"/>
<constraint firstAttribute="trailing" secondItem="7rs-yJ-Kvn" secondAttribute="trailing" id="tpM-bQ-uV4"/>
<constraint firstItem="2cS-C7-kUz" firstAttribute="top" secondItem="gV8-Ze-9jD" secondAttribute="top" id="uzM-0H-7yH"/>
</constraints>
<variation key="default">
<mask key="subviews">
<exclude reference="7rs-yJ-Kvn"/>
</mask>
</variation>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="meX-xg-hMW"/>
......@@ -2741,6 +2800,7 @@
<outlet property="redeemButton" destination="qnn-bi-fLK" id="GzF-I5-zC3"/>
<outlet property="scrollContentView" destination="NHe-cF-AMf" id="Jgu-0v-nhF"/>
<outlet property="scrollView" destination="fVG-0L-fYi" id="Ia7-im-DSP"/>
<outlet property="topBorderLine" destination="2cS-C7-kUz" id="wxQ-K4-mao"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="LXH-Az-i1V" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
......
......@@ -22,6 +22,7 @@ import MapKit
@IBOutlet private var addressView: UILabel!
@IBOutlet private var directionsButton: CSMButton!
@IBOutlet private var infoTopConstraint: NSLayoutConstraint!
@IBOutlet weak var topBorderLine: UIImageView!
// public
public var couponSet: swiftApi.CouponSetItemModel?
......@@ -48,9 +49,22 @@ import MapKit
mapView.delegate = self
mapView.centerToLocation(initialLocation, regionRadius: 1000000)
mapView.clipsToBounds = true
mapView.layer.cornerRadius = 30
mapView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
// mapView.clipsToBounds = true
// mapView.layer.cornerRadius = 30
// mapView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
let image = UIImage(named: "top_border_line", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil)!
var aspectR: CGFloat = 0.0
aspectR = image.size.width/image.size.height
topBorderLine.translatesAutoresizingMaskIntoConstraints = false
topBorderLine.image = image
topBorderLine.contentMode = .scaleAspectFit
NSLayoutConstraint.activate([
topBorderLine.heightAnchor.constraint(equalTo: topBorderLine.widthAnchor, multiplier: 1/aspectR)
])
closeButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
......
......@@ -22,6 +22,7 @@
<outlet property="nameView" destination="MsK-eg-pkk" id="60t-lm-O8m"/>
<outlet property="phoneView" destination="knh-D9-CuM" id="ES2-6e-vRx"/>
<outlet property="titleView" destination="oVh-dv-f7a" id="dst-Ku-EFw"/>
<outlet property="topBorderLine" destination="Z8H-fT-Lo9" id="Vl0-Nb-YhC"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
......@@ -37,20 +38,31 @@
<rect key="frame" x="0.0" y="0.0" width="414" height="852"/>
</imageView>
<mapView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" mapType="standard" translatesAutoresizingMaskIntoConstraints="NO" id="F1c-ck-cQa">
<rect key="frame" x="0.0" y="2" width="414" height="850"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="852"/>
</mapView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Z8H-fT-Lo9">
<rect key="frame" x="0.0" y="420" width="414" height="11.5"/>
</imageView>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="tVJ-fk-ani" secondAttribute="bottom" id="5cR-5W-AwC"/>
<constraint firstItem="tVJ-fk-ani" firstAttribute="top" secondItem="rKl-bF-Zpf" secondAttribute="top" id="EMb-Ay-M18"/>
<constraint firstItem="Z8H-fT-Lo9" firstAttribute="leading" secondItem="rKl-bF-Zpf" secondAttribute="leading" id="Kwp-fj-9nx"/>
<constraint firstAttribute="trailing" secondItem="tVJ-fk-ani" secondAttribute="trailing" id="LLM-SY-Ejo"/>
<constraint firstItem="F1c-ck-cQa" firstAttribute="leading" secondItem="rKl-bF-Zpf" secondAttribute="leading" id="P7b-Km-FIn"/>
<constraint firstItem="F1c-ck-cQa" firstAttribute="top" secondItem="rKl-bF-Zpf" secondAttribute="top" constant="2" id="X2Z-Vc-V9u"/>
<constraint firstItem="Z8H-fT-Lo9" firstAttribute="top" secondItem="rKl-bF-Zpf" secondAttribute="top" id="VAV-Go-hI2"/>
<constraint firstItem="F1c-ck-cQa" firstAttribute="top" secondItem="rKl-bF-Zpf" secondAttribute="top" id="X2Z-Vc-V9u"/>
<constraint firstAttribute="trailing" secondItem="F1c-ck-cQa" secondAttribute="trailing" id="dcT-Pn-T5v"/>
<constraint firstItem="tVJ-fk-ani" firstAttribute="leading" secondItem="rKl-bF-Zpf" secondAttribute="leading" id="eVM-4A-gJc"/>
<constraint firstAttribute="bottom" secondItem="F1c-ck-cQa" secondAttribute="bottom" id="ipi-oy-9jV"/>
<constraint firstAttribute="trailing" secondItem="Z8H-fT-Lo9" secondAttribute="trailing" id="nUU-tN-OvE"/>
</constraints>
<variation key="default">
<mask key="subviews">
<exclude reference="tVJ-fk-ani"/>
</mask>
</variation>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Zc1-ew-qcl">
<rect key="frame" x="0.0" y="576" width="414" height="320"/>
......
......@@ -23,6 +23,7 @@ import SwiftEventBus
@IBOutlet weak var senderButton: UIButton!
@IBOutlet weak var numberTextField: UITextField!
@IBOutlet weak var redeemButton: UIButton!
@IBOutlet weak var topBorderLine: UIImageView!
let uiscreen: CGRect = UIScreen.main.bounds
......@@ -52,9 +53,22 @@ import SwiftEventBus
backgroundImage.image = UIImage(named: "coupons_scrollview_white", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil)
scrollView.clipsToBounds = true
scrollView.layer.cornerRadius = 30
scrollView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
// scrollView.clipsToBounds = true
// scrollView.layer.cornerRadius = 30
// scrollView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
let image = UIImage(named: "top_border_line", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil)!
var aspectR: CGFloat = 0.0
aspectR = image.size.width/image.size.height
topBorderLine.translatesAutoresizingMaskIntoConstraints = false
topBorderLine.image = image
topBorderLine.contentMode = .scaleAspectFit
NSLayoutConstraint.activate([
topBorderLine.heightAnchor.constraint(equalTo: topBorderLine.widthAnchor, multiplier: 1/aspectR)
])
// COUPONSET: desc, img_preview, name, terms
// COUPON: coupon, expiration, discount, status
......
......@@ -26,6 +26,7 @@ import UIKit
@IBOutlet weak var moreButton: UIButton!
@IBOutlet weak var moreTextView: UITextView!
@IBOutlet weak var moreTextViewHeight: NSLayoutConstraint!
@IBOutlet weak var topBorderLine: UIImageView!
let uiscreen: CGRect = UIScreen.main.bounds
......@@ -52,9 +53,22 @@ import UIKit
backgroundImage.image = UIImage(named: "coupons_scrollview_white", in: Bundle(for: MyEmptyClass.self), 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: Bundle(for: MyEmptyClass.self), compatibleWith: nil)!
var aspectR: CGFloat = 0.0
aspectR = image.size.width/image.size.height
topBorderLine.translatesAutoresizingMaskIntoConstraints = false
topBorderLine.image = image
topBorderLine.contentMode = .scaleAspectFit
NSLayoutConstraint.activate([
topBorderLine.heightAnchor.constraint(equalTo: topBorderLine.widthAnchor, multiplier: 1/aspectR)
])
// scrollView.clipsToBounds = true
// scrollView.layer.cornerRadius = 30
// scrollView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
heroImage.load(link: ccms?._imageOfferUrl ?? "", placeholder: UIImage(), cache: URLCache())
heroImage.contentMode = .scaleAspectFill
......