footer view; seperater line inset

This commit is contained in:
nixzhu
2015-09-30 14:46:25 +08:00
committed by nixzhu
parent 4da07a1aa3
commit 96cbb7e673
2 changed files with 8 additions and 0 deletions
@@ -15,10 +15,16 @@ class FeedsViewController: UIViewController {
let feedCellID = "FeedCell"
lazy var noFeedsFooterView: InfoView = InfoView(NSLocalizedString("No Feeds.", comment: ""))
var feeds = [DiscoveredFeed]() {
didSet {
dispatch_async(dispatch_get_main_queue()) { [weak self] in
self?.feedsTableView.reloadData()
if let strongSelf = self {
strongSelf.feedsTableView.tableFooterView = strongSelf.feeds.isEmpty ? strongSelf.noFeedsFooterView : UIView()
}
}
}
}
@@ -44,6 +50,7 @@ class FeedsViewController: UIViewController {
feedsTableView.backgroundColor = UIColor.whiteColor()
feedsTableView.registerNib(UINib(nibName: feedCellID, bundle: nil), forCellReuseIdentifier: feedCellID)
feedsTableView.tableFooterView = UIView()
discoverFeedsWithSortStyle(.Time, pageIndex: 1, perPage: 100, failureHandler: { reason, errorMessage in
defaultFailureHandler(reason, errorMessage: errorMessage)
+1
View File
@@ -90,6 +90,7 @@
<constraint firstItem="uir-A9-aaJ" firstAttribute="centerY" secondItem="d97-mK-bJE" secondAttribute="centerY" id="vTi-1C-OoG"/>
</constraints>
</tableViewCellContentView>
<inset key="separatorInset" minX="60" minY="0.0" maxX="0.0" maxY="0.0"/>
<connections>
<outlet property="avatarImageView" destination="GRs-kP-Ugk" id="Rch-2A-tIe"/>
<outlet property="distanceLabel" destination="uir-A9-aaJ" id="asK-JQ-ew5"/>