diff --git a/Kiwix-iOS/Controller/Library/CloudBooksController.swift b/Kiwix-iOS/Controller/Library/CloudBooksController.swift
index 8c3144ff..ab824c58 100644
--- a/Kiwix-iOS/Controller/Library/CloudBooksController.swift
+++ b/Kiwix-iOS/Controller/Library/CloudBooksController.swift
@@ -152,7 +152,7 @@ class CloudBooksController: UITableViewController, NSFetchedResultsControllerDel
let alert = UIAlertController(title: NSLocalizedString("Only Show Preferred Language?", comment: comment),
message: NSLocalizedString(String(format: "Would you like to filter the library by %@?", string), comment: comment),
preferredStyle: .Alert)
- alert.addAction(UIAlertAction(title: LocalizedStrings.Common.yes, style: .Default) { (action) in
+ let action = UIAlertAction(title: LocalizedStrings.Common.yes, style: .Default) { (action) in
self.managedObjectContext.performBlock({
let codes = NSLocale.preferredLangCodes
Language.fetchAll(self.managedObjectContext).forEach({ (language) in
@@ -161,7 +161,9 @@ class CloudBooksController: UITableViewController, NSFetchedResultsControllerDel
})
self.refreshFetchedResultController()
})
- })
+ }
+ alert.preferredAction = action
+ alert.addAction(action)
alert.addAction(UIAlertAction(title: LocalizedStrings.Common.cancel, style: .Cancel, handler: nil))
presentViewController(alert, animated: true, completion: nil)
}
@@ -329,31 +331,3 @@ class CloudBooksController: UITableViewController, NSFetchedResultsControllerDel
tableView.endUpdates()
}
}
-
-class RefreshLibControl: UIRefreshControl {
-
- static let pullDownToRefresh = NSLocalizedString("Pull Down To Refresh", comment: "Refresh Library Control")
- static let lastRefresh = NSLocalizedString("Last Refresh: %@ ago", comment: "Refresh Library Control")
-
- override var hidden: Bool {
- didSet {
- guard hidden != oldValue && hidden == false else {return}
- updateTitle()
- }
- }
-
- private func updateTitle() {
- let string: String = {
- guard let lastRefreshTime = Preference.libraryLastRefreshTime else {return RefreshLibControl.pullDownToRefresh}
- let interval = lastRefreshTime.timeIntervalSinceNow * -1
- let formatter = NSDateComponentsFormatter()
- formatter.unitsStyle = .Abbreviated
- formatter.allowedUnits = interval < 60.0 ? [.Second] : [.Day, .Hour, .Minute]
- let string = formatter.stringFromTimeInterval(interval) ?? ""
- return String(format: RefreshLibControl.lastRefresh, string)
- }()
- let attributes = [NSForegroundColorAttributeName: UIColor.blackColor()]
- attributedTitle = NSAttributedString(string: string, attributes: attributes)
- }
-}
-
diff --git a/Kiwix-iOS/Info.plist b/Kiwix-iOS/Info.plist
index e3a9497d..791a42d1 100644
--- a/Kiwix-iOS/Info.plist
+++ b/Kiwix-iOS/Info.plist
@@ -49,7 +49,7 @@
CFBundleVersion
- 1.7.1807
+ 1.7.1809
ITSAppUsesNonExemptEncryption
LSRequiresIPhoneOS
diff --git a/Kiwix-iOS/View/RefreshLibControl.swift b/Kiwix-iOS/View/RefreshLibControl.swift
new file mode 100644
index 00000000..7d8c4670
--- /dev/null
+++ b/Kiwix-iOS/View/RefreshLibControl.swift
@@ -0,0 +1,36 @@
+//
+// RefreshLibControl.swift
+// Kiwix
+//
+// Created by Chris Li on 9/7/16.
+// Copyright © 2016 Chris. All rights reserved.
+//
+
+import UIKit
+
+class RefreshLibControl: UIRefreshControl {
+
+ static let pullDownToRefresh = NSLocalizedString("Pull Down To Refresh", comment: "Refresh Library Control")
+ static let lastRefresh = NSLocalizedString("Last Refresh: %@ ago", comment: "Refresh Library Control")
+
+ override var hidden: Bool {
+ didSet {
+ guard hidden != oldValue && hidden == false else {return}
+ updateTitle()
+ }
+ }
+
+ private func updateTitle() {
+ let string: String = {
+ guard let lastRefreshTime = Preference.libraryLastRefreshTime else {return RefreshLibControl.pullDownToRefresh}
+ let interval = lastRefreshTime.timeIntervalSinceNow * -1
+ let formatter = NSDateComponentsFormatter()
+ formatter.unitsStyle = .Abbreviated
+ formatter.allowedUnits = interval < 60.0 ? [.Second] : [.Day, .Hour, .Minute]
+ let string = formatter.stringFromTimeInterval(interval) ?? ""
+ return String(format: RefreshLibControl.lastRefresh, string)
+ }()
+ let attributes = [NSForegroundColorAttributeName: UIColor.blackColor()]
+ attributedTitle = NSAttributedString(string: string, attributes: attributes)
+ }
+}
diff --git a/Kiwix-iOSWidgets/Bookmarks/Info.plist b/Kiwix-iOSWidgets/Bookmarks/Info.plist
index 52740e84..aa40b7ec 100644
--- a/Kiwix-iOSWidgets/Bookmarks/Info.plist
+++ b/Kiwix-iOSWidgets/Bookmarks/Info.plist
@@ -21,7 +21,7 @@
CFBundleSignature
????
CFBundleVersion
- 1.7.2361
+ 1.7.2363
NSExtension
NSExtensionMainStoryboard
diff --git a/Kiwix.xcodeproj/project.pbxproj b/Kiwix.xcodeproj/project.pbxproj
index 88d406ff..e19deb2c 100644
--- a/Kiwix.xcodeproj/project.pbxproj
+++ b/Kiwix.xcodeproj/project.pbxproj
@@ -74,6 +74,7 @@
975B90FE1CEB909100D13906 /* iOSExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 975B90FD1CEB909100D13906 /* iOSExtensions.swift */; };
9763275E1D64FE0F0034F120 /* BookDetailController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9763275D1D64FE0F0034F120 /* BookDetailController.swift */; };
9763A6291CEB9E55008A2718 /* OSXExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9763A6281CEB9E55008A2718 /* OSXExtensions.swift */; };
+ 9764CBD11D806AD800072D6A /* RefreshLibControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9764CBD01D806AD800072D6A /* RefreshLibControl.swift */; };
9779C3141D4575AD0064CC8E /* NotificationCenter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 97E609F01D103DED00EBCB9D /* NotificationCenter.framework */; };
9779C3171D4575AE0064CC8E /* TodayViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9779C3161D4575AE0064CC8E /* TodayViewController.swift */; };
9779C31A1D4575AE0064CC8E /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9779C3181D4575AE0064CC8E /* MainInterface.storyboard */; };
@@ -289,6 +290,7 @@
975B90FD1CEB909100D13906 /* iOSExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = iOSExtensions.swift; path = "Kiwix-iOS/iOSExtensions.swift"; sourceTree = SOURCE_ROOT; };
9763275D1D64FE0F0034F120 /* BookDetailController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BookDetailController.swift; sourceTree = ""; };
9763A6281CEB9E55008A2718 /* OSXExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OSXExtensions.swift; path = "Kiwix-OSX/OSXExtensions.swift"; sourceTree = SOURCE_ROOT; };
+ 9764CBD01D806AD800072D6A /* RefreshLibControl.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RefreshLibControl.swift; sourceTree = ""; };
976A0C801D41619C0006A742 /* DZNEmptyDataSet.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DZNEmptyDataSet.framework; path = "../../../../Users/chrisli/Library/Developer/Xcode/DerivedData/Kiwix-ayxrfhaqnfxzendihdolvkklkmhk/Build/Products/Debug-iphoneos/DZNEmptyDataSet/DZNEmptyDataSet.framework"; sourceTree = ""; };
9779C3131D4575AD0064CC8E /* Bookmarks.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = Bookmarks.appex; sourceTree = BUILT_PRODUCTS_DIR; };
9779C3161D4575AE0064CC8E /* TodayViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodayViewController.swift; sourceTree = ""; };
@@ -601,6 +603,7 @@
97D452BD1D1723FF0033666F /* CollectionViewCells.swift */,
971A10271D022AD5007FC62C /* Logo.swift */,
971A10281D022AD5007FC62C /* LTBarButtonItem.swift */,
+ 9764CBD01D806AD800072D6A /* RefreshLibControl.swift */,
971A10291D022AD5007FC62C /* RefreshHUD.swift */,
971A102A1D022AD5007FC62C /* SearchBar.swift */,
97E60A011D10423A00EBCB9D /* ShadowViews.swift */,
@@ -1527,6 +1530,7 @@
97D681321D6F70EC00E5FA99 /* MigrationPolicy.swift in Sources */,
97D6811B1D6E2A7100E5FA99 /* DownloadTasksController.swift in Sources */,
97D681261D6F70AC00E5FA99 /* SearchOperation.swift in Sources */,
+ 9764CBD11D806AD800072D6A /* RefreshLibControl.swift in Sources */,
971A10381D022C15007FC62C /* WebViewController.swift in Sources */,
97C601DE1D7F342100362D4F /* HTMLHeading.swift in Sources */,
97D681271D6F70AC00E5FA99 /* UIOperations.swift in Sources */,