Manos Chorianopoulos

add emptyView at WalletVC

......@@ -7,7 +7,7 @@
<key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>1</integer>
</dict>
</dict>
</dict>
......
......@@ -7,7 +7,7 @@
<key>SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>0</integer>
</dict>
</dict>
</dict>
......
......@@ -908,9 +908,38 @@
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="8YP-uG-vbV">
<rect key="frame" x="20" y="209" width="374" height="454"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="aYf-dv-3Ik">
<rect key="frame" x="149.5" y="0.0" width="75" height="75"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="75" id="Ppz-og-cjb"/>
<constraint firstAttribute="height" constant="75" id="bGk-uv-Lhs"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SIP-ou-T3X">
<rect key="frame" x="0.0" y="95" width="374" height="18"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/>
<color key="textColor" red="1" green="1" blue="1" alpha="0.60999999999999999" colorSpace="custom" customColorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="aYf-dv-3Ik" firstAttribute="top" secondItem="8YP-uG-vbV" secondAttribute="top" id="9v0-Tb-qtX"/>
<constraint firstItem="SIP-ou-T3X" firstAttribute="leading" secondItem="8YP-uG-vbV" secondAttribute="leading" id="Adj-64-b2U"/>
<constraint firstItem="aYf-dv-3Ik" firstAttribute="centerX" secondItem="8YP-uG-vbV" secondAttribute="centerX" id="a2J-DK-6lp"/>
<constraint firstItem="SIP-ou-T3X" firstAttribute="top" secondItem="aYf-dv-3Ik" secondAttribute="bottom" constant="20" id="y2l-af-OSc"/>
<constraint firstAttribute="trailing" secondItem="SIP-ou-T3X" secondAttribute="trailing" id="yDl-jG-ia2"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" red="0.21960784310000001" green="0.32156862749999998" blue="0.4039215686" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="8YP-uG-vbV" firstAttribute="top" secondItem="Et1-y7-npI" secondAttribute="bottom" constant="30" id="0PG-cl-zHC"/>
<constraint firstItem="8YP-uG-vbV" firstAttribute="leading" secondItem="ICd-s2-mfF" secondAttribute="leading" constant="20" id="34j-DQ-Raf"/>
<constraint firstItem="gdf-s4-2CF" firstAttribute="top" secondItem="Fef-hi-2VL" secondAttribute="bottom" constant="40" id="4FL-Zz-Okv"/>
<constraint firstAttribute="trailing" secondItem="FiI-Ni-wy4" secondAttribute="trailing" constant="20" id="AF7-ZD-Nbs"/>
<constraint firstAttribute="bottom" secondItem="FiI-Ni-wy4" secondAttribute="bottom" constant="10" id="Gep-UO-kv9"/>
......@@ -927,7 +956,9 @@
<constraint firstItem="hdz-dS-6jm" firstAttribute="top" secondItem="Et1-y7-npI" secondAttribute="bottom" constant="30" id="o67-KC-ulO"/>
<constraint firstItem="hdz-dS-6jm" firstAttribute="leading" secondItem="ICd-s2-mfF" secondAttribute="leading" constant="45" id="oyd-vQ-oDU"/>
<constraint firstItem="Et1-y7-npI" firstAttribute="leading" secondItem="ICd-s2-mfF" secondAttribute="leading" id="rEU-Va-c6X"/>
<constraint firstAttribute="bottom" secondItem="8YP-uG-vbV" secondAttribute="bottom" id="rKn-W6-URd"/>
<constraint firstItem="Fef-hi-2VL" firstAttribute="leading" secondItem="ICd-s2-mfF" secondAttribute="leading" constant="45" id="t3B-PH-1J8"/>
<constraint firstAttribute="trailing" secondItem="8YP-uG-vbV" secondAttribute="trailing" constant="20" id="tsY-yf-PE4"/>
<constraint firstItem="zFT-By-XHL" firstAttribute="leading" secondItem="ICd-s2-mfF" secondAttribute="leading" constant="10" id="vNb-RY-jSD"/>
<constraint firstItem="FiI-Ni-wy4" firstAttribute="top" secondItem="zFT-By-XHL" secondAttribute="bottom" constant="40" id="zZq-Yx-q9D"/>
</constraints>
......@@ -1084,7 +1115,11 @@
<outlet property="dfyLogoImage" destination="gdf-s4-2CF" id="eGT-J8-7vO"/>
<outlet property="dfyLogoImageHeight" destination="Ch9-8X-FNJ" id="1f2-Tl-Ias"/>
<outlet property="dfyLogoImageTopSpace" destination="4FL-Zz-Okv" id="NJf-cd-AG2"/>
<outlet property="emptyImage" destination="aYf-dv-3Ik" id="piu-FN-npo"/>
<outlet property="emptyLabel" destination="SIP-ou-T3X" id="ZRk-Xu-Bah"/>
<outlet property="emptyView" destination="8YP-uG-vbV" id="SLO-UB-1ef"/>
<outlet property="headerImage" destination="wP5-YG-vSP" id="MFN-m3-6ou"/>
<outlet property="myPresentsLabel" destination="FiI-Ni-wy4" id="ZNw-OM-zsA"/>
<outlet property="profileImage" destination="wJv-NF-rMf" id="Ues-Ru-2p2"/>
<outlet property="profileNameLabel" destination="1XZ-NB-F8P" id="C5F-WA-kOW"/>
<outlet property="questionnaireButton" destination="UNL-Oh-sPV" id="EPs-OW-Oai"/>
......
{
"images" : [
{
"filename" : "ic_empty_wallet.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_empty_wallet-1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_empty_wallet-2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -36,7 +36,11 @@ import SwiftEventBus
@IBOutlet weak var activeCodeExpirationLabel: UILabel!
@IBOutlet weak var tableView: UITableView!
@IBOutlet weak var activeCodeImage: UIImageView!
@IBOutlet weak var myPresentsLabel: UILabel!
@IBOutlet weak var emptyView: UIView!
@IBOutlet weak var emptyImage: UIImageView!
@IBOutlet weak var emptyLabel: UILabel!
public var coupons:Array<swiftApi.CouponItemModel> = swiftApi().getCouponList()
public var dfyCoupons:Array<swiftApi.ActiveDFYCouponModel> = swiftApi().getActiveDFYCoupons()
public var loyaltyBadge:swiftApi.LoyaltyBadgeModel = swiftApi().getLoyaltyBadge()
......@@ -222,6 +226,21 @@ import SwiftEventBus
activeCodeViewHeight.constant = 0
dfyLogoImageTopSpace.constant = 0
}
myPresentsLabel.text = "Τα δώρα μου"
if (coupons.count > 0) {
myPresentsLabel.isHidden = false
} else {
myPresentsLabel.isHidden = true
}
emptyImage.image = UIImage(named: "ic_empty_wallet", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil)
emptyLabel.text = "Δεν έχεις κάποιον ενεργό κωδικό ή κουπόνι! Μπες τώρα στην ενότητα COSMOTE For YOU και βρες αποκλειστικές προσφορές!"
if (totalCouponValue == 0.0 && loyaltyBadge._couponCount == 0 && dfyCoupons.count == 0 && coupons.count == 0) {
emptyView.isHidden = false
} else {
emptyView.isHidden = true
}
}
public override func viewWillAppear(_ animated: Bool) {
......