Manos Chorianopoulos

MapsViewController ui fixes

......@@ -29,7 +29,8 @@ private extension CSMButton {
setImage(UIImage(named: "ic_directions", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 18)
setTitleColor(.white, for: .normal)
backgroundColor = UIColor(rgb: 0x79BF14)
// backgroundColor = UIColor(rgb: 0x79BF14)
backgroundColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00)
layer.cornerRadius = 12.0
imageEdgeInsets = UIEdgeInsets(top:0.0, left:0.0, bottom:0.0, right:5.0);
......
......@@ -21,9 +21,11 @@ import MapKit
@IBOutlet private var hoursView: UILabel!
@IBOutlet private var phoneView: UILabel!
@IBOutlet private var addressView: UILabel!
@IBOutlet private var directionsButton: CSMButton!
@IBOutlet private var directionsButton: UIButton!
@IBOutlet private var infoTopConstraint: NSLayoutConstraint!
@IBOutlet weak var topBorderLine: UIImageView!
@IBOutlet weak var phoneImageView: UIImageView!
@IBOutlet weak var addressImageView: UIImageView!
// public
public var couponSet: swiftApi.CouponSetItemModel?
......@@ -48,6 +50,8 @@ import MapKit
setNavigationTitle("Καταστήματα")
backgroundImage.image = UIImage(named: "coupons_scrollview_white", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
phoneImageView.image = UIImage(named: "ic_phone", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
addressImageView.image = UIImage(named: "ic_address", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
mapView.delegate = self
mapView.centerToLocation(initialLocation, regionRadius: 1000000)
......@@ -56,25 +60,26 @@ import MapKit
// mapView.layer.cornerRadius = 30
// mapView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
let image = UIImage(named: "top_border_line", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)!
var aspectR: CGFloat = 0.0
aspectR = image.size.width/image.size.height
topBorderLine.translatesAutoresizingMaskIntoConstraints = false
topBorderLine.image = image
topBorderLine.contentMode = .scaleAspectFill
// let image = UIImage(named: "top_border_line", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)!
// var aspectR: CGFloat = 0.0
//
// aspectR = image.size.width/image.size.height
NSLayoutConstraint.activate([
topBorderLine.topAnchor.constraint(equalTo: mainView.topAnchor, constant: 0),
topBorderLine.leadingAnchor.constraint(equalTo: mainView.leadingAnchor, constant: 0),
topBorderLine.trailingAnchor.constraint(equalTo: mainView.trailingAnchor, constant: 0),
topBorderLine.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.width),
topBorderLine.heightAnchor.constraint(equalTo: topBorderLine.widthAnchor, multiplier: 1/aspectR)
])
// topBorderLine.translatesAutoresizingMaskIntoConstraints = false
// topBorderLine.image = image
// topBorderLine.contentMode = .scaleAspectFill
//
// NSLayoutConstraint.activate([
// topBorderLine.topAnchor.constraint(equalTo: mainView.topAnchor, constant: 0),
// topBorderLine.leadingAnchor.constraint(equalTo: mainView.leadingAnchor, constant: 0),
// topBorderLine.trailingAnchor.constraint(equalTo: mainView.trailingAnchor, constant: 0),
// topBorderLine.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.width),
// topBorderLine.heightAnchor.constraint(equalTo: topBorderLine.widthAnchor, multiplier: 1/aspectR)
// ])
closeButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
closeButton.setImage(UIImage(named: "ic_close_3", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
titleView.font = UIFont(name: "PFSquareSansPro-Bold", size: 19)
titleView.textColor = UIColor(rgb: 0x757575)
......@@ -94,13 +99,18 @@ import MapKit
//directionsButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 16)
directionsButton.setTitle("Οδηγίες", for: .normal)
directionsButton.setImage(UIImage(named: "ic_directions", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
// directionsButton.sizeToFit()
directionsButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 18)
directionsButton.setTitleColor(.white, for: .normal)
directionsButton.tintColor = .white
directionsButton.backgroundColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00)
directionsButton.layer.cornerRadius = 16.0
// directionsButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 5);
// directionsButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0);
// directionsButton.sizeToFit()
//directionsButton.setTitleColor(.white, for: .normal)
//directionsButton.backgroundColor = UIColor(red: 0.47, green: 0.75, blue: 0.08, alpha: 1.00)
//directionsButton.layer.cornerRadius = 12.0
directionsButton.frame = CGRect(x: 0.0, y: 0.0, width: directionsButton.intrinsicContentSize.width+10, height: 50)
// directionsButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 15, bottom: 0, right: 15)
directionsButton.setInsets(forContentPadding: UIEdgeInsets(top: 0, left: 15, bottom: 0, right: 15), imageTitlePadding: 10)
load()
}
......@@ -149,16 +159,16 @@ import MapKit
let filteredMerchants = (merchantsData ?? []).filter({ return (($0._latitude != 0.0) && ($0._longitude != 0.0)) })
if (self.isMarket == true) {
// if (self.isMarket == true) {
self.merchantsArray = filteredMerchants
if let parent = (merchantsData ?? []).first(where: {(($0._latitude == 0.0) && ($0._longitude == 0.0))}) {
self.parentMerchant = parent
}
} else {
self.merchantsArray = merchantsData ?? []
}
// } else {
// self.merchantsArray = merchantsData ?? []
// }
self.loadMapPins()
......@@ -318,7 +328,8 @@ import MapKit
private func loadPinDetailsView(_ annotation: MerchantAnnotation) {
self.selectedMerchant = annotation.model
self.titleView.text = self.selectedMerchant?._admin_name
// self.titleView.text = self.selectedMerchant?._admin_name
self.titleView.text = self.parentMerchant?._admin_name
if (self.isMarket == true) {
self.nameImageView.load(link: self.parentMerchant?._img_preview ?? "", placeholder: UIImage(), cache: URLCache())
......
......@@ -11,6 +11,7 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MapsViewController" customModule="SwiftWarplyFramework" customModuleProvider="target">
<connections>
<outlet property="addressImageView" destination="Bic-c4-J9E" id="pOr-y5-qYi"/>
<outlet property="addressView" destination="syP-Hv-OGD" id="LUw-pI-3va"/>
<outlet property="backgroundImage" destination="tVJ-fk-ani" id="ETq-VL-6q7"/>
<outlet property="closeButton" destination="lEb-V2-2FC" id="aEd-fS-pbO"/>
......@@ -21,6 +22,7 @@
<outlet property="mapView" destination="F1c-ck-cQa" id="cdx-31-BiL"/>
<outlet property="nameImageView" destination="eDV-A1-pOO" id="JYq-eT-kEG"/>
<outlet property="nameView" destination="MsK-eg-pkk" id="60t-lm-O8m"/>
<outlet property="phoneImageView" destination="KhY-nt-uwH" id="1lt-DL-aRN"/>
<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"/>
......@@ -41,7 +43,7 @@
<mapView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" mapType="standard" translatesAutoresizingMaskIntoConstraints="NO" id="F1c-ck-cQa">
<rect key="frame" x="0.0" y="0.0" width="414" height="848"/>
</mapView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Z8H-fT-Lo9">
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Z8H-fT-Lo9">
<rect key="frame" x="0.0" y="420" width="414" height="11.5"/>
</imageView>
</subviews>
......@@ -62,6 +64,7 @@
<variation key="default">
<mask key="subviews">
<exclude reference="tVJ-fk-ani"/>
<exclude reference="Z8H-fT-Lo9"/>
</mask>
</variation>
</view>
......@@ -69,7 +72,7 @@
<rect key="frame" x="0.0" y="576" width="414" height="320"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="INTERSPORT" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oVh-dv-f7a" userLabel="Title">
<rect key="frame" x="30" y="20" width="294" height="30"/>
<rect key="frame" x="30" y="20" width="304" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="Gf2-VN-pNV"/>
</constraints>
......@@ -78,7 +81,7 @@
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="right" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="lEb-V2-2FC" userLabel="Close">
<rect key="frame" x="344" y="20" width="40" height="40"/>
<rect key="frame" x="354" y="15" width="40" height="40"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="40" id="gnd-qn-qo5"/>
......@@ -93,74 +96,77 @@
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="F55-qj-PDc" userLabel="LineTop">
<rect key="frame" x="10" y="40" width="394" height="1"/>
<rect key="frame" x="10" y="61.5" width="394" height="1"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="18a-J3-UZm"/>
</constraints>
</view>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="eDV-A1-pOO" userLabel="NameLogo">
<rect key="frame" x="30" y="66" width="30" height="30"/>
<rect key="frame" x="30" y="87.5" width="30" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="30" id="IjG-Iw-fIq"/>
<constraint firstAttribute="height" constant="30" id="LnS-gV-hIi"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" text="Intersport Χαλανδρίου" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MsK-eg-pkk" userLabel="NameLabel">
<rect key="frame" x="70" y="60.5" width="314" height="21.5"/>
<rect key="frame" x="70" y="82" width="314" height="21.5"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="SHs-vI-jD7" userLabel="LineMiddle">
<rect key="frame" x="10" y="121" width="394" height="1"/>
<rect key="frame" x="10" y="142.5" width="394" height="1"/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="hMo-qH-T2k"/>
</constraints>
</view>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_phone" translatesAutoresizingMaskIntoConstraints="NO" id="KhY-nt-uwH" userLabel="phoneIcon">
<rect key="frame" x="30" y="152" width="20" height="20"/>
<rect key="frame" x="30" y="173.5" width="20" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="1rt-pN-Dld"/>
<constraint firstAttribute="width" constant="20" id="3Rd-ir-r7Q"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" text="210-6230543" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="knh-D9-CuM" userLabel="phoneLabel">
<rect key="frame" x="60" y="142" width="324" height="40"/>
<rect key="frame" x="60" y="163.5" width="324" height="40"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="sAf-f8-8jc" userLabel="LineBottom">
<rect key="frame" x="10" y="202" width="394" height="1"/>
<rect key="frame" x="10" y="223.5" width="394" height="1"/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="vSP-6I-Lz6"/>
</constraints>
</view>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_address" translatesAutoresizingMaskIntoConstraints="NO" id="Bic-c4-J9E" userLabel="AddressIcon">
<rect key="frame" x="30" y="234.5" width="20" height="20"/>
<rect key="frame" x="30" y="245.5" width="20" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="A8o-MY-I6f"/>
<constraint firstAttribute="width" constant="20" id="Xma-bp-6IZ"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" text="ΕΘΝΙΚΗΣ ΑΝΤΙΣΤΑΣΕΩΣ 4 41" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="syP-Hv-OGD" userLabel="AddressLabel">
<rect key="frame" x="60" y="223" width="239" height="43"/>
<rect key="frame" x="60" y="244.5" width="246" height="21.5"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" horizontalCompressionResistancePriority="751" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bw3-J9-wHr" userLabel="Directions" customClass="CSMButton" customModule="SwiftWarplyFramework" customModuleProvider="target">
<rect key="frame" x="309" y="223" width="75" height="43"/>
<button opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" horizontalCompressionResistancePriority="751" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bw3-J9-wHr" userLabel="Directions">
<rect key="frame" x="340" y="238.5" width="54" height="34"/>
<constraints>
<constraint firstAttribute="height" constant="34" id="9wg-ge-pC0"/>
</constraints>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Button"/>
<connections>
<action selector="directionsButtomAction:" destination="-1" eventType="touchUpInside" id="nMR-Jk-Wm4"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" text="Δευτέρα - Τετάρτη" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="u9U-A7-lbO" userLabel="HoursLabel">
<rect key="frame" x="70" y="80.5" width="314" height="21.5"/>
<rect key="frame" x="70" y="102" width="314" height="21.5"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<color key="textColor" systemColor="systemGray2Color"/>
<nil key="highlightedColor"/>
......@@ -171,8 +177,6 @@
<constraints>
<constraint firstItem="u9U-A7-lbO" firstAttribute="leading" secondItem="eDV-A1-pOO" secondAttribute="trailing" constant="10" id="0Z2-uE-kRe"/>
<constraint firstItem="XS2-AR-3j9" firstAttribute="trailing" secondItem="MsK-eg-pkk" secondAttribute="trailing" constant="30" id="1qW-i8-MRk"/>
<constraint firstItem="XS2-AR-3j9" firstAttribute="bottom" secondItem="bw3-J9-wHr" secondAttribute="bottom" constant="20" id="3vm-pn-qpa"/>
<constraint firstItem="lEb-V2-2FC" firstAttribute="top" secondItem="Zc1-ew-qcl" secondAttribute="top" constant="20" id="5bY-RU-ons"/>
<constraint firstItem="knh-D9-CuM" firstAttribute="top" secondItem="SHs-vI-jD7" secondAttribute="bottom" constant="20" id="61g-5C-XbI"/>
<constraint firstItem="sAf-f8-8jc" firstAttribute="leading" secondItem="XS2-AR-3j9" secondAttribute="leading" constant="10" id="7W6-cn-WdZ"/>
<constraint firstItem="bw3-J9-wHr" firstAttribute="centerY" secondItem="Bic-c4-J9E" secondAttribute="centerY" id="AHw-0D-gur"/>
......@@ -180,12 +184,12 @@
<constraint firstItem="KhY-nt-uwH" firstAttribute="leading" secondItem="XS2-AR-3j9" secondAttribute="leading" constant="30" id="Dok-gZ-xf1"/>
<constraint firstItem="SHs-vI-jD7" firstAttribute="leading" secondItem="Zc1-ew-qcl" secondAttribute="leading" constant="10" id="Lj8-XN-HTj"/>
<constraint firstAttribute="trailing" secondItem="F55-qj-PDc" secondAttribute="trailing" constant="10" id="MCj-ek-cnb"/>
<constraint firstAttribute="trailing" secondItem="lEb-V2-2FC" secondAttribute="trailing" constant="30" id="NcX-rr-7OU"/>
<constraint firstAttribute="trailing" secondItem="lEb-V2-2FC" secondAttribute="trailing" constant="20" id="NcX-rr-7OU"/>
<constraint firstItem="syP-Hv-OGD" firstAttribute="leading" secondItem="Bic-c4-J9E" secondAttribute="trailing" constant="10" id="Rl4-cn-VTG"/>
<constraint firstAttribute="trailing" secondItem="SHs-vI-jD7" secondAttribute="trailing" constant="10" id="Smw-Bv-Qlr"/>
<constraint firstItem="lEb-V2-2FC" firstAttribute="leading" secondItem="oVh-dv-f7a" secondAttribute="trailing" constant="20" id="ULP-b9-ToV"/>
<constraint firstItem="bw3-J9-wHr" firstAttribute="centerY" secondItem="syP-Hv-OGD" secondAttribute="centerY" id="VMT-7b-JjS"/>
<constraint firstItem="MsK-eg-pkk" firstAttribute="leading" secondItem="eDV-A1-pOO" secondAttribute="trailing" constant="10" id="Vg7-xl-oA2"/>
<constraint firstItem="bw3-J9-wHr" firstAttribute="top" secondItem="sAf-f8-8jc" secondAttribute="bottom" constant="20" id="YhG-Th-URU"/>
<constraint firstItem="oVh-dv-f7a" firstAttribute="leading" secondItem="Zc1-ew-qcl" secondAttribute="leading" constant="30" id="Zd1-SB-SlA"/>
<constraint firstItem="KhY-nt-uwH" firstAttribute="top" secondItem="SHs-vI-jD7" secondAttribute="bottom" constant="30" id="a6s-J0-5rJ"/>
<constraint firstItem="knh-D9-CuM" firstAttribute="leading" secondItem="KhY-nt-uwH" secondAttribute="trailing" constant="10" id="aeR-MK-4WB"/>
......@@ -196,9 +200,10 @@
<constraint firstItem="XS2-AR-3j9" firstAttribute="trailing" secondItem="u9U-A7-lbO" secondAttribute="trailing" constant="30" id="hZz-zi-NzM"/>
<constraint firstItem="XS2-AR-3j9" firstAttribute="trailing" secondItem="sAf-f8-8jc" secondAttribute="trailing" constant="10" id="hn5-U5-rvW"/>
<constraint firstItem="sAf-f8-8jc" firstAttribute="top" secondItem="SHs-vI-jD7" secondAttribute="bottom" constant="80" id="htI-gJ-mSm"/>
<constraint firstAttribute="trailing" secondItem="bw3-J9-wHr" secondAttribute="trailing" constant="30" id="hya-Ns-ldi"/>
<constraint firstAttribute="trailing" secondItem="bw3-J9-wHr" secondAttribute="trailing" constant="20" id="hya-Ns-ldi"/>
<constraint firstItem="Bic-c4-J9E" firstAttribute="leading" secondItem="Zc1-ew-qcl" secondAttribute="leading" constant="30" id="iUf-BZ-0kl"/>
<constraint firstItem="F55-qj-PDc" firstAttribute="leading" secondItem="Zc1-ew-qcl" secondAttribute="leading" constant="10" id="jK6-2e-p3v"/>
<constraint firstItem="lEb-V2-2FC" firstAttribute="centerY" secondItem="oVh-dv-f7a" secondAttribute="centerY" id="lnJ-gm-ewM"/>
<constraint firstItem="XS2-AR-3j9" firstAttribute="bottom" secondItem="syP-Hv-OGD" secondAttribute="bottom" constant="20" id="luv-Gm-76K"/>
<constraint firstItem="sAf-f8-8jc" firstAttribute="top" secondItem="knh-D9-CuM" secondAttribute="bottom" constant="20" id="m6I-QE-hbq"/>
<constraint firstItem="eDV-A1-pOO" firstAttribute="top" secondItem="F55-qj-PDc" secondAttribute="bottom" constant="25" id="nAA-6u-CUo"/>
......@@ -206,7 +211,7 @@
<constraint firstItem="MsK-eg-pkk" firstAttribute="centerY" secondItem="eDV-A1-pOO" secondAttribute="centerY" constant="-10" id="wpA-Xv-RdU"/>
<constraint firstItem="syP-Hv-OGD" firstAttribute="top" secondItem="sAf-f8-8jc" secondAttribute="bottom" constant="20" id="xD6-zI-9Nl"/>
<constraint firstItem="SHs-vI-jD7" firstAttribute="top" secondItem="F55-qj-PDc" secondAttribute="bottom" constant="80" id="xPl-UV-cMd"/>
<constraint firstItem="bw3-J9-wHr" firstAttribute="leading" secondItem="syP-Hv-OGD" secondAttribute="trailing" constant="10" id="zAU-89-R2t"/>
<constraint firstItem="bw3-J9-wHr" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="syP-Hv-OGD" secondAttribute="trailing" constant="10" id="zAU-89-R2t"/>
</constraints>
</view>
</subviews>
......
......@@ -607,3 +607,23 @@ extension UIView {
layer.mask = shape
}
}
extension UIButton {
func setInsets(
forContentPadding contentPadding: UIEdgeInsets,
imageTitlePadding: CGFloat
) {
self.contentEdgeInsets = UIEdgeInsets(
top: contentPadding.top,
left: contentPadding.left,
bottom: contentPadding.bottom,
right: contentPadding.right + imageTitlePadding
)
self.titleEdgeInsets = UIEdgeInsets(
top: 0,
left: imageTitlePadding,
bottom: 0,
right: -imageTitlePadding
)
}
}
......