This commit is contained in:
Chris Li 2016-09-13 09:34:25 -04:00
parent d5066c2c8f
commit 0198551225
6 changed files with 10 additions and 8 deletions

View File

@ -71,6 +71,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func applicationDidBecomeActive(application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
NSTimer.scheduledTimerWithTimeInterval(60.0, target: self, selector: #selector(AppDelegate.recordActiveSession), userInfo: nil, repeats: false)
ZimMultiReader.shared.startScan()
removeAllDynamicShortcutItems()
}

View File

@ -24,11 +24,11 @@ extension MainController: UIWebViewDelegate, SFSafariViewControllerDelegate,
}
func webViewDidStartLoad(webView: UIWebView) {
// URLResponseCache.shared.start()
URLResponseCache.shared.start()
}
func webViewDidFinishLoad(webView: UIWebView) {
// URLResponseCache.shared.stop()
URLResponseCache.shared.stop()
// Create article object
guard let url = webView.request?.URL,
@ -36,6 +36,9 @@ extension MainController: UIWebViewDelegate, SFSafariViewControllerDelegate,
article.title = JSInjection.getTitle(from: webView)
article.thumbImageURL = URLResponseCache.shared.firstImage()?.absoluteString
self.article = article
// UI Updates
configureNavigationButtonTint()
}
func webView(webView: UIWebView, didFailLoadWithError error: NSError) {

View File

@ -49,7 +49,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.8.338</string>
<string>1.8.341</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.341</string>
<string>1.8.344</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionMainStoryboard</key>

View File

@ -50,7 +50,7 @@ class ScanLocalBookOperation: Operation {
}
override func operationDidFinish(errors: [ErrorType]) {
print("Scan finshed, lasted for \(-time.timeIntervalSinceNow)")
print("Scan finshed, lasted for \(-time.timeIntervalSinceNow) seconds.")
}
private func updateReaders() {

View File

@ -21,8 +21,6 @@ class ZimMultiReader: NSObject, DirectoryMonitorDelegate {
override init() {
super.init()
startScan()
monitor.delegate = self
monitor.startMonitoring()
}
@ -44,7 +42,7 @@ class ZimMultiReader: NSObject, DirectoryMonitorDelegate {
})
})
operation.queuePriority = .VeryHigh
if readers.count == 0 { operation.qualityOfService = .UserInitiated }
if readers.count == 0 { operation.qualityOfService = .UserInteractive }
GlobalQueue.shared.add(scan: operation)
}