Manos Chorianopoulos

add empty label at SharingHistoryVC

......@@ -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>
......
......@@ -12,6 +12,7 @@ class AnalysisHeaderViewCell: UITableViewCell {
// attributes
@IBOutlet weak var itemImage: UIImageView!
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var emptyLabel: UILabel!
// lifecycle
override func awakeFromNib() {
......@@ -27,8 +28,13 @@ class AnalysisHeaderViewCell: UITableViewCell {
}
extension AnalysisHeaderViewCell {
func configureCell(item: AnalysisItem) {
func configureCell(isEmpty: Bool) {
if (isEmpty == true) {
emptyLabel.isHidden = false
} else {
emptyLabel.isHidden = true
}
// TODO: TO BE IMPLEMENTED
}
}
......
......@@ -599,14 +599,14 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="xmN-ke-oBj">
<rect key="frame" x="124" y="31" width="166" height="166"/>
<rect key="frame" x="124" y="31" width="166" height="137"/>
<constraints>
<constraint firstAttribute="height" constant="166" id="OG9-xL-K4U"/>
<constraint firstAttribute="width" constant="166" id="Xgj-YV-J4n"/>
</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="LKw-8l-mRY">
<rect key="frame" x="169" y="248" width="76" height="22"/>
<rect key="frame" x="169" y="218" width="76" height="22"/>
<constraints>
<constraint firstAttribute="height" constant="22" id="T1B-pX-6hx"/>
</constraints>
......@@ -614,15 +614,26 @@
<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="nTp-Dz-QAc">
<rect key="frame" x="20" y="270" 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 firstItem="nTp-Dz-QAc" firstAttribute="top" relation="greaterThanOrEqual" secondItem="LKw-8l-mRY" secondAttribute="bottom" constant="30" id="8ah-BK-pt1"/>
<constraint firstAttribute="bottom" secondItem="nTp-Dz-QAc" secondAttribute="bottom" constant="10" id="9qo-FO-iU2"/>
<constraint firstItem="xmN-ke-oBj" firstAttribute="centerX" secondItem="RtV-Li-Dnj" secondAttribute="centerX" id="LvL-o4-MTE"/>
<constraint firstAttribute="bottom" secondItem="LKw-8l-mRY" secondAttribute="bottom" constant="10" id="jlt-UV-Eud"/>
<constraint firstItem="nTp-Dz-QAc" firstAttribute="leading" secondItem="RtV-Li-Dnj" secondAttribute="leading" constant="20" id="fMS-F0-UAU"/>
<constraint firstItem="LKw-8l-mRY" firstAttribute="top" secondItem="xmN-ke-oBj" secondAttribute="bottom" constant="50" id="sJz-1y-yRN"/>
<constraint firstAttribute="trailing" secondItem="nTp-Dz-QAc" secondAttribute="trailing" constant="20" id="tH3-uE-4sM"/>
<constraint firstItem="xmN-ke-oBj" firstAttribute="top" secondItem="RtV-Li-Dnj" secondAttribute="topMargin" constant="20" id="v4Z-tl-gBX"/>
<constraint firstItem="LKw-8l-mRY" firstAttribute="centerX" secondItem="RtV-Li-Dnj" secondAttribute="centerX" id="yJq-7A-H3r"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="emptyLabel" destination="nTp-Dz-QAc" id="euw-Th-h7g"/>
<outlet property="itemImage" destination="xmN-ke-oBj" id="zRs-Ks-2Re"/>
<outlet property="titleLabel" destination="LKw-8l-mRY" id="2Nl-uC-2aJ"/>
</connections>
......
......@@ -87,7 +87,7 @@ class SharingHistoryViewController: AnalysisChildViewController {
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if (indexPath.section == 0) {
return hasMessage ? 380.0 : 280
return hasMessage ? 380.0 : (items.count > 0 ? 280 : 380)
}
return 140.0
......@@ -101,7 +101,9 @@ class SharingHistoryViewController: AnalysisChildViewController {
return tableView.dequeueReusableCell(withIdentifier: "AnalysisHeaderMessageViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisHeaderMessageViewCell
}
return tableView.dequeueReusableCell(withIdentifier: "AnalysisHeaderViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisHeaderViewCell
let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisHeaderViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisHeaderViewCell
cell.configureCell(isEmpty: items.count == 0)
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisItemViewCell", for: indexPath) as! SwiftWarplyFramework.AnalysisItemViewCell
......