ATS enabled

This commit is contained in:
Chris Li 2017-02-10 15:33:53 -05:00
parent c33b000477
commit 8522bc9b9c
2 changed files with 2 additions and 1 deletions

View File

@ -57,7 +57,7 @@
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<false/>
<key>NSExceptionDomains</key>
<dict>
<key>kiwix.org</key>

View File

@ -126,6 +126,7 @@ class Network: NSObject, URLSessionDelegate, URLSessionTaskDelegate, URLSessionD
// MARK: - URLSessionTaskDelegate
func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) {
if let error = error {print("Download error: \(error.localizedDescription)")}
guard let bookID = task.taskDescription else {return}
progresses[bookID] = nil
if progresses.count == 0 { timer?.invalidate() }