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) { 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. // 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) NSTimer.scheduledTimerWithTimeInterval(60.0, target: self, selector: #selector(AppDelegate.recordActiveSession), userInfo: nil, repeats: false)
ZimMultiReader.shared.startScan()
removeAllDynamicShortcutItems() removeAllDynamicShortcutItems()
} }

View File

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

View File

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

View File

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

View File

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

View File

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