diff --git a/Kiwix-iOS/AppDelegate.swift b/Kiwix-iOS/AppDelegate.swift index 2eecab69..6365a16b 100644 --- a/Kiwix-iOS/AppDelegate.swift +++ b/Kiwix-iOS/AppDelegate.swift @@ -59,7 +59,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool { - guard url.scheme!.caseInsensitiveCompare("kiwix") == .OrderedSame else {return false} + guard url.isKiwixURL else {return false} let operation = ArticleLoadOperation(url: url) GlobalQueue.shared.add(load: operation) return true diff --git a/Kiwix-iOS/Controller/Alerts.swift b/Kiwix-iOS/Controller/Alerts.swift index fad2053d..385f957c 100644 --- a/Kiwix-iOS/Controller/Alerts.swift +++ b/Kiwix-iOS/Controller/Alerts.swift @@ -135,3 +135,12 @@ class ShowHelpPageOperation: Operation { } } +class CannotFinishHandoffAlert: AlertOperation { + init(context: UIViewController) { + super.init(presentAlertFrom: context) + title = NSLocalizedString("Cannot Finish Handoff", comment: "Cannot Finish Handoff Alert") + message = NSLocalizedString("The book required to complete the Handoff is not on the device. Please download the book and try again.", comment: "Cannot Finish Handoff Alert") + addActionWithTitle(LocalizedStrings.ok) + } +} + diff --git a/Kiwix-iOS/Controller/Main/MainController.swift b/Kiwix-iOS/Controller/Main/MainController.swift index 68aa61de..9027f306 100644 --- a/Kiwix-iOS/Controller/Main/MainController.swift +++ b/Kiwix-iOS/Controller/Main/MainController.swift @@ -112,7 +112,8 @@ class MainController: UIViewController { let operation = ArticleLoadOperation(url: url) GlobalQueue.shared.add(load: operation) } else { - // TODO: - Alert cannot complete hand off + let operation = CannotFinishHandoffAlert(context: self) + GlobalQueue.shared.addOperation(operation) } } diff --git a/Kiwix-iOS/Info.plist b/Kiwix-iOS/Info.plist index 67786b06..d5db7ce2 100644 --- a/Kiwix-iOS/Info.plist +++ b/Kiwix-iOS/Info.plist @@ -49,7 +49,7 @@ CFBundleVersion - 1.8.998 + 1.8.1009 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/Kiwix-iOSWidgets/Bookmarks/Info.plist b/Kiwix-iOSWidgets/Bookmarks/Info.plist index 32cfe4c9..9e91e237 100644 --- a/Kiwix-iOSWidgets/Bookmarks/Info.plist +++ b/Kiwix-iOSWidgets/Bookmarks/Info.plist @@ -21,7 +21,7 @@ CFBundleSignature ???? CFBundleVersion - 1.8.1002 + 1.8.1013 NSExtension NSExtensionMainStoryboard diff --git a/Kiwix.xcworkspace/xcuserdata/chrisli.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Kiwix.xcworkspace/xcuserdata/chrisli.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index dbfe494b..71c1f447 100644 --- a/Kiwix.xcworkspace/xcuserdata/chrisli.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/Kiwix.xcworkspace/xcuserdata/chrisli.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -19,5 +19,21 @@ landmarkType = "5"> + + + + diff --git a/Kiwix/Operations/ArticleOperation.swift b/Kiwix/Operations/ArticleOperation.swift index 2c091408..6be5d843 100644 --- a/Kiwix/Operations/ArticleOperation.swift +++ b/Kiwix/Operations/ArticleOperation.swift @@ -77,10 +77,12 @@ class ArticleLoadOperation: Operation { NSOperationQueue.mainQueue().addOperationWithBlock { controller.hideSearch(animated: self.animated) controller.presentingViewController?.dismissViewControllerAnimated(self.animated, completion: nil) - // hide toc + if controller.traitCollection.horizontalSizeClass == .Compact {controller.hideTableOfContentsController()} + + if controller.webView.request?.URL != url { + controller.webView.loadRequest(request) + } - guard controller.webView.request?.URL != url else {return} - controller.webView.loadRequest(request) self.finish() } } diff --git a/Kiwix/Operations/ScanLocalBookOperation.swift b/Kiwix/Operations/ScanLocalBookOperation.swift index 0caacb29..a9025a3b 100644 --- a/Kiwix/Operations/ScanLocalBookOperation.swift +++ b/Kiwix/Operations/ScanLocalBookOperation.swift @@ -89,6 +89,7 @@ class ScanLocalBookOperation: Operation { book.isLocal = true book.hasIndex = reader.hasIndex() book.hasPic = !reader.fileURL.absoluteString!.containsString("nopic") + if let downloadTask = book.downloadTask {context.deleteObject(downloadTask)} } for (id, book) in localBooks {