Empty background for lang filter

This commit is contained in:
Chris Li 2017-02-03 15:22:40 -05:00
parent a67f37bffd
commit 0136e66d94
2 changed files with 12 additions and 2 deletions

View File

@ -83,7 +83,7 @@ class LibraryLanguageController: UITableViewController, NSFetchedResultsControll
// MARK: - Table view data source
override func numberOfSections(in tableView: UITableView) -> Int {
return 2
return (showLanguages.count + hideLanguages.count) > 0 ? 2 : 0
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
@ -155,4 +155,12 @@ class LibraryLanguageController: UITableViewController, NSFetchedResultsControll
return 30
}
}
// MARK: - DZNEmptyDataSet
func title(forEmptyDataSet scrollView: UIScrollView!) -> NSAttributedString! {
return NSAttributedString(string: "No language available",
attributes: [NSFontAttributeName: UIFont.boldSystemFont(ofSize: 18),
NSForegroundColorAttributeName: UIColor.darkGray])
}
}

View File

@ -217,7 +217,7 @@
</objects>
<point key="canvasLocation" x="-1074" y="65"/>
</scene>
<!--Library Language Controller-->
<!--Empty Data Set Delegate-->
<scene sceneID="jB1-ec-I5Q">
<objects>
<tableViewController storyboardIdentifier="LanguageFilterController" id="YXq-FN-ov8" customClass="LibraryLanguageController" customModule="Kiwix" customModuleProvider="target" sceneMemberID="viewController">
@ -254,6 +254,8 @@
<connections>
<outlet property="dataSource" destination="YXq-FN-ov8" id="hRN-3s-A7O"/>
<outlet property="delegate" destination="YXq-FN-ov8" id="D0R-dF-zb9"/>
<outlet property="emptyDataSetDelegate" destination="YXq-FN-ov8" id="Jk1-z1-TXX"/>
<outlet property="emptyDataSetSource" destination="YXq-FN-ov8" id="Vez-cy-zWa"/>
</connections>
</tableView>
<navigationItem key="navigationItem" id="GNP-b4-wXb">