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
......
......@@ -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
......