marinofaggiana 5 years ago
parent
commit
15c2d5761a
1 changed files with 7 additions and 6 deletions
  1. 7 6
      iOSClient/Networking/NCCommunication.swift

+ 7 - 6
iOSClient/Networking/NCCommunication.swift

@@ -161,12 +161,13 @@ class NCCommunication: NSObject {
         
         AF.download(url, method: .get, parameters: nil, encoding: URLEncoding.default, headers: headers, interceptor: nil, to: destination).downloadProgress { progress in
             //self.postProgress(progress: progress)
-        } .responseData { response in
-            /*
-                if let data = response.result.value {
-                    //                        let image = UIImage(data: data)
-                }
-            */
+        }.responseData { response in
+            switch response.result {
+            case.failure(let error):
+                completionHandler(account, error)
+            case .success( _):
+                completionHandler(account, nil)
+            }
         }
     }