Manos Chorianopoulos

add empty view at HistoryViewController

......@@ -7,7 +7,7 @@
<key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>0</integer>
</dict>
</dict>
</dict>
......
......@@ -7,7 +7,7 @@
<key>SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>1</integer>
</dict>
</dict>
</dict>
......
......@@ -13,6 +13,7 @@ class AnalysisHeaderMessageViewCell: UITableViewCell {
@IBOutlet weak var itemImage: UIImageView!
@IBOutlet weak var messageLabel: UILabel!
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var emptyLabel: UILabel!
public var loyaltyBadge:swiftApi.LoyaltyBadgeModel = swiftApi().getLoyaltyBadge()
......@@ -63,8 +64,13 @@ class AnalysisHeaderMessageViewCell: UITableViewCell {
}
extension AnalysisHeaderMessageViewCell {
func configureCell(item: AnalysisItem) {
func configureCell(isEmpty: Bool) {
if (isEmpty == true) {
emptyLabel.isHidden = false
} else {
emptyLabel.isHidden = true
}
// TODO: TO BE IMPLEMENTED
}
}
......
......@@ -89,7 +89,7 @@ class HistoryViewController: AnalysisChildViewController {
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if (indexPath.section == 0) {
return hasMessage ? 380.0 : 280
return hasMessage ? (items.count > 0 ? 380.0 : 480.0) : 280
}
return 140.0
......@@ -100,7 +100,9 @@ class HistoryViewController: AnalysisChildViewController {
// header
if (indexPath.section == 0) {
if (hasMessage) {
return tableView.dequeueReusableCell(withIdentifier: "AnalysisHeaderMessageViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisHeaderMessageViewCell
let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisHeaderMessageViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisHeaderMessageViewCell
cell.configureCell(isEmpty: items.count == 0)
return cell
}
return tableView.dequeueReusableCell(withIdentifier: "AnalysisHeaderViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisHeaderViewCell
......
......@@ -2239,7 +2239,7 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Μέχρι τώρα έχεις κερδίσει 20,00€ σε προσφορές από 3 κουπόνια!" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Yth-0S-P60">
<rect key="frame" x="50" y="237" width="314" height="60"/>
<rect key="frame" x="50" y="220" width="314" height="60"/>
<constraints>
<constraint firstAttribute="height" constant="60" id="Ams-n8-yUP"/>
</constraints>
......@@ -2248,14 +2248,14 @@
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="QY9-ar-jbw">
<rect key="frame" x="124" y="31" width="166" height="166"/>
<rect key="frame" x="124" y="31" width="166" height="149"/>
<constraints>
<constraint firstAttribute="width" constant="166" id="ZuH-X9-Nie"/>
<constraint firstAttribute="height" constant="166" id="dUQ-Ou-Apu"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Αναλυτικά:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nzx-D5-LHo">
<rect key="frame" x="169" y="339" width="76" height="20"/>
<rect key="frame" x="169" y="320" width="76" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="K9D-vL-Saj"/>
</constraints>
......@@ -2263,18 +2263,29 @@
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<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="AYW-hj-qMf">
<rect key="frame" x="20" y="370" width="374" height="0.0"/>
<fontDescription key="fontDescription" name="PFSquareSansPro-Medium" family="PF Square Sans Pro" pointSize="17"/>
<color key="textColor" red="0.5450980392" green="0.59215686270000001" blue="0.63921568630000003" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstAttribute="trailingMargin" secondItem="Yth-0S-P60" secondAttribute="trailing" constant="30" id="6SE-2z-kcV"/>
<constraint firstItem="QY9-ar-jbw" firstAttribute="top" secondItem="Kcf-Zv-eMe" secondAttribute="topMargin" constant="20" id="7r7-Q0-rq4"/>
<constraint firstItem="nzx-D5-LHo" firstAttribute="centerX" secondItem="Kcf-Zv-eMe" secondAttribute="centerX" id="9MU-dy-Lh7"/>
<constraint firstItem="AYW-hj-qMf" firstAttribute="leading" secondItem="Kcf-Zv-eMe" secondAttribute="leading" constant="20" id="E5C-gs-Xj8"/>
<constraint firstItem="AYW-hj-qMf" firstAttribute="top" relation="greaterThanOrEqual" secondItem="nzx-D5-LHo" secondAttribute="bottom" constant="30" id="Hfg-5j-zgZ"/>
<constraint firstAttribute="bottom" secondItem="AYW-hj-qMf" secondAttribute="bottom" constant="10" id="Nky-gl-3bT"/>
<constraint firstItem="Yth-0S-P60" firstAttribute="top" secondItem="QY9-ar-jbw" secondAttribute="bottom" constant="40" id="f7j-JG-hqO"/>
<constraint firstItem="Yth-0S-P60" firstAttribute="leading" secondItem="Kcf-Zv-eMe" secondAttribute="leadingMargin" constant="30" id="qsD-vg-jYM"/>
<constraint firstAttribute="bottomMargin" secondItem="nzx-D5-LHo" secondAttribute="bottom" constant="10" id="tgQ-Ov-G72"/>
<constraint firstItem="nzx-D5-LHo" firstAttribute="top" secondItem="Yth-0S-P60" secondAttribute="bottom" constant="40" id="sii-nx-rxY"/>
<constraint firstAttribute="trailing" secondItem="AYW-hj-qMf" secondAttribute="trailing" constant="20" id="wO2-z6-BhQ"/>
<constraint firstItem="QY9-ar-jbw" firstAttribute="centerX" secondItem="Kcf-Zv-eMe" secondAttribute="centerX" id="xiH-Cs-G6E"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="emptyLabel" destination="AYW-hj-qMf" id="28Y-xJ-JlC"/>
<outlet property="itemImage" destination="QY9-ar-jbw" id="UHu-bz-9Uk"/>
<outlet property="messageLabel" destination="Yth-0S-P60" id="tVN-jB-FvL"/>
<outlet property="titleLabel" destination="nzx-D5-LHo" id="cU7-6c-HiO"/>
......