empty table view background

This commit is contained in:
Chris Li 2016-09-20 14:15:27 -04:00
parent 987c633a14
commit afe93874e3
9 changed files with 57 additions and 18 deletions

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "open-book.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

@ -10,19 +10,18 @@ import UIKit
import DZNEmptyDataSet
extension CloudBooksController {
func imageForEmptyDataSet(scrollView: UIScrollView!) -> UIImage! {
return UIImage(named: "CloudColor")
}
func titleForEmptyDataSet(scrollView: UIScrollView!) -> NSAttributedString! {
let string = NSLocalizedString("There are some books in the cloud", comment: "Cloud Book Controller")
let string = NSLocalizedString("There are some books in the cloud", comment: "Library, cloud tab")
let attributes = [NSFontAttributeName: UIFont.systemFontOfSize(18), NSForegroundColorAttributeName: UIColor.darkGrayColor()]
return NSAttributedString(string: string, attributes: attributes)
}
func buttonTitleForEmptyDataSet(scrollView: UIScrollView!, forState state: UIControlState) -> NSAttributedString! {
let string = isRefreshing ? NSLocalizedString("Refreshing...", comment: "Cloud Book Controller") : NSLocalizedString("Refresh", comment: "Cloud Book Controller")
let string = isRefreshing ? NSLocalizedString("Refreshing...", comment: "Library, cloud tab") : NSLocalizedString("Refresh", comment: "Library, cloud tab")
let attributes = [NSFontAttributeName: UIFont.boldSystemFontOfSize(17), NSForegroundColorAttributeName: isRefreshing ? UIColor.grayColor() : AppColors.theme]
return NSAttributedString(string: string, attributes: attributes)
}
@ -35,33 +34,52 @@ extension CloudBooksController {
func verticalOffsetForEmptyDataSet(scrollView: UIScrollView!) -> CGFloat {
return -navigationController!.navigationBar.frame.height
}
}
extension DownloadTasksController {
func imageForEmptyDataSet(scrollView: UIScrollView!) -> UIImage! {
return UIImage(named: "DownloadColor")
}
func titleForEmptyDataSet(scrollView: UIScrollView!) -> NSAttributedString! {
let string = NSLocalizedString("No Download Tasks", comment: "")
let string = NSLocalizedString("No Download Tasks", comment: "Library, download tab")
let attributes = [NSFontAttributeName: UIFont.systemFontOfSize(18), NSForegroundColorAttributeName: UIColor.darkGrayColor()]
return NSAttributedString(string: string, attributes: attributes)
}
}
extension LocalBooksController {
func imageForEmptyDataSet(scrollView: UIScrollView!) -> UIImage! {
return UIImage(named: "FolderColor")
}
func titleForEmptyDataSet(scrollView: UIScrollView!) -> NSAttributedString! {
let string = NSLocalizedString("No Local Books on Device", comment: "Library, local tab")
let attributes = [NSFontAttributeName: UIFont.systemFontOfSize(18), NSForegroundColorAttributeName: UIColor.darkGrayColor()]
return NSAttributedString(string: string, attributes: attributes)
}
func descriptionForEmptyDataSet(scrollView: UIScrollView!) -> NSAttributedString! {
let string = NSLocalizedString("Add Book by download in app or iTunes File Sharing. New books will show up here automatically.", comment: "Library, local tab")
let paragraph = NSMutableParagraphStyle()
paragraph.lineBreakMode = .ByWordWrapping
paragraph.alignment = .Center
let attributes = [NSFontAttributeName: UIFont.systemFontOfSize(14), NSForegroundColorAttributeName: UIColor.lightGrayColor(), NSParagraphStyleAttributeName: paragraph]
return NSAttributedString(string: string, attributes: attributes)
}
func verticalOffsetForEmptyDataSet(scrollView: UIScrollView!) -> CGFloat {
return tabBarController!.navigationController!.navigationBar.frame.maxY
}
}
extension LocalBooksController {
func titleForEmptyDataSet(scrollView: UIScrollView!) -> NSAttributedString! {
let string = NSLocalizedString("No Local Books on Device", comment: "")
let attributes = [NSFontAttributeName: UIFont.systemFontOfSize(18), NSForegroundColorAttributeName: UIColor.darkGrayColor()]
return NSAttributedString(string: string, attributes: attributes)
return -tabBarController!.navigationController!.navigationBar.frame.maxY
}
}
extension BookDetailController {
func imageForEmptyDataSet(scrollView: UIScrollView!) -> UIImage! {
return UIImage(named: "BookColor")
}
func titleForEmptyDataSet(scrollView: UIScrollView!) -> NSAttributedString! {
let string = NSLocalizedString("Choose A Book", comment: "")
let string = NSLocalizedString("Tap on A Book to See Detail", comment: "")
let attributes = [NSFontAttributeName: UIFont.systemFontOfSize(18), NSForegroundColorAttributeName: UIColor.darkGrayColor()]
return NSAttributedString(string: string, attributes: attributes)
}

View File

@ -49,7 +49,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.8.912</string>
<string>1.8.919</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>

View File

@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.8.915</string>
<string>1.8.922</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionMainStoryboard</key>