Browse Source

added empty state ment label

pull/1/head
ccr 6 years ago
parent
commit
fe9a546b7c
  1. 14
      GMERemittance/Module/WalletStatement/User Interface/View/WalletStatement.storyboard
  2. 3
      GMERemittance/Module/WalletStatement/User Interface/View/WalletStatementViewController.swift

14
GMERemittance/Module/WalletStatement/User Interface/View/WalletStatement.storyboard

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
@ -133,6 +133,15 @@
</tableViewCell>
</prototypes>
</tableView>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="you have no statements" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="476-rL-pZJ">
<rect key="frame" x="115" y="220" width="146.5" height="44"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="8eB-j6-8O8"/>
</constraints>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="14"/>
<color key="textColor" red="0.29019607843137252" green="0.29019607843137252" blue="0.29019607843137252" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="Otx-07-9H8">
<rect key="frame" x="16" y="5" width="343" height="35"/>
<subviews>
@ -168,8 +177,10 @@
<constraints>
<constraint firstItem="HXS-oS-mKa" firstAttribute="top" secondItem="Otx-07-9H8" secondAttribute="bottom" constant="5" id="0JU-27-atW"/>
<constraint firstItem="Otx-07-9H8" firstAttribute="top" secondItem="s4k-ts-Yz0" secondAttribute="top" constant="5" id="6VA-jn-0RI"/>
<constraint firstItem="476-rL-pZJ" firstAttribute="top" secondItem="Otx-07-9H8" secondAttribute="bottom" constant="180" id="9eM-fm-iro"/>
<constraint firstItem="HXS-oS-mKa" firstAttribute="leading" secondItem="s4k-ts-Yz0" secondAttribute="leading" constant="10" id="CTI-mG-Mbd"/>
<constraint firstItem="Otx-07-9H8" firstAttribute="leading" secondItem="s4k-ts-Yz0" secondAttribute="leading" constant="16" id="DE1-aj-aWV"/>
<constraint firstItem="476-rL-pZJ" firstAttribute="centerX" secondItem="s4k-ts-Yz0" secondAttribute="centerX" id="FH9-q2-PoE"/>
<constraint firstAttribute="trailing" secondItem="HXS-oS-mKa" secondAttribute="trailing" constant="10" id="PYf-I3-73X"/>
<constraint firstAttribute="bottom" secondItem="HXS-oS-mKa" secondAttribute="bottom" id="nfD-hR-zOx"/>
<constraint firstAttribute="trailing" secondItem="Otx-07-9H8" secondAttribute="trailing" constant="16" id="wfQ-en-q5h"/>
@ -196,6 +207,7 @@
</view>
<connections>
<outlet property="dateRangeLabelHeightConstraint" destination="Pxd-5h-5QL" id="Z4d-db-hQo"/>
<outlet property="emptyLabel" destination="476-rL-pZJ" id="uTM-dx-JG7"/>
<outlet property="fromDateLabel" destination="fEw-5s-hYk" id="YQ4-aX-wOs"/>
<outlet property="tableView" destination="HXS-oS-mKa" id="g0z-gS-MiK"/>
<outlet property="toDateLabel" destination="98a-R9-YKZ" id="3LH-lJ-hxn"/>

3
GMERemittance/Module/WalletStatement/User Interface/View/WalletStatementViewController.swift

@ -21,11 +21,11 @@ class WalletStatementViewController: UIViewController {
@IBOutlet weak var dateRangeLabelHeightConstraint: NSLayoutConstraint!
@IBOutlet weak var fromDateLabel: UILabel!
@IBOutlet weak var toDateLabel: UILabel!
@IBOutlet weak var emptyLabel: UILabel!
// MARK: Properties
var presenter: WalletStatementModuleInterface?
var from: String?
var to: String?
@ -33,6 +33,7 @@ class WalletStatementViewController: UIViewController {
var statements: [WalletStatement] = [] {
didSet {
self.emptyLabel.isHidden = !statements.isEmpty
self.tableView.reloadData()
guard let fromDate = from, let toDate = to else {
self.dateRangeLabelHeightConstraint.constant = 0

Loading…
Cancel
Save