mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-28 06:25:04 -04:00
commit
This commit is contained in:
parent
bd17336c8f
commit
f0f4f42442
@ -44,12 +44,12 @@ class BookDetailController: UITableViewController, DZNEmptyDataSetSource, DZNEmp
|
||||
override func viewWillAppear(animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
configureViews()
|
||||
book?.addObserver(self, forKeyPath: "isLocal", options: .New, context: context)
|
||||
book?.addObserver(self, forKeyPath: "stateRaw", options: .New, context: context)
|
||||
}
|
||||
|
||||
override func viewWillDisappear(animated: Bool) {
|
||||
super.viewWillDisappear(animated)
|
||||
book?.removeObserver(self, forKeyPath: "isLocal", context: context)
|
||||
book?.removeObserver(self, forKeyPath: "stateRaw", context: context)
|
||||
}
|
||||
|
||||
override func observeValueForKeyPath(keyPath: String?, ofObject object: AnyObject?, change: [String : AnyObject]?, context: UnsafeMutablePointer<Void>) {
|
||||
@ -95,8 +95,12 @@ class BookDetailController: UITableViewController, DZNEmptyDataSetSource, DZNEmp
|
||||
}
|
||||
|
||||
switch book.state {
|
||||
case .Cloud:
|
||||
cellTitles[1] = book.spaceState == .NotEnough ? [LocalizedStrings.spaceNotEnough] : [LocalizedStrings.download]
|
||||
case .Cloud, .Retained:
|
||||
if let _ = book.meta4URL {
|
||||
cellTitles[1] = book.spaceState == .NotEnough ? [LocalizedStrings.spaceNotEnough] : [LocalizedStrings.download]
|
||||
} else {
|
||||
cellTitles[1] = [LocalizedStrings.addUsingiTunesFileSharing]
|
||||
}
|
||||
case .Downloading:
|
||||
cellTitles[1] = [LocalizedStrings.downloading]
|
||||
case .Local:
|
||||
@ -257,6 +261,7 @@ class BookDetailController: UITableViewController, DZNEmptyDataSetSource, DZNEmp
|
||||
static let downloading = NSLocalizedString("Downloading", comment: comment)
|
||||
static let spaceNotEnough = NSLocalizedString("Space Not Enough", comment: comment)
|
||||
static let remove = NSLocalizedString("Remove", comment: comment)
|
||||
static let addUsingiTunesFileSharing = NSLocalizedString("Add using iTunes File Sharing", comment: comment)
|
||||
// static let pause = NSLocalizedString("Pause", comment: comment)
|
||||
// static let resume = NSLocalizedString("Resume", comment: comment)
|
||||
// static let cancel = NSLocalizedString("Cancel", comment: comment)
|
||||
|
@ -71,7 +71,7 @@ class LocalBooksController: UITableViewController, NSFetchedResultsControllerDel
|
||||
|
||||
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
|
||||
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath)
|
||||
self.configureCell(cell, atIndexPath: indexPath)
|
||||
configureCell(cell, atIndexPath: indexPath)
|
||||
return cell
|
||||
}
|
||||
|
||||
@ -105,7 +105,8 @@ class LocalBooksController: UITableViewController, NSFetchedResultsControllerDel
|
||||
// MARK: - Table View Delegate
|
||||
|
||||
override func tableView(tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
|
||||
return 20.0
|
||||
guard let stateRaw = fetchedResultController.sections?[section].name else {return 0.0}
|
||||
return (section == 0 && stateRaw == "2") ? 0.0 : 20.0
|
||||
}
|
||||
|
||||
override func tableView(tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) {
|
||||
|
@ -49,7 +49,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.8.1089</string>
|
||||
<string>1.8.1094</string>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<false/>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
|
@ -21,7 +21,7 @@
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.8.1093</string>
|
||||
<string>1.8.1098</string>
|
||||
<key>NSExtension</key>
|
||||
<dict>
|
||||
<key>NSExtensionMainStoryboard</key>
|
||||
|
Loading…
x
Reference in New Issue
Block a user