Explorar o código

[PR #1722] Update README for proper error checking in download.

Jon Shier %!s(int64=9) %!d(string=hai) anos
pai
achega
2034f4c872
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      README.md

+ 1 - 1
README.md

@@ -623,7 +623,7 @@ let destination: DownloadRequest.DownloadFileDestination = { _, _ in
 Alamofire.download(urlString, to: destination).response { response in
     print(response)
 
-	if response.result.isSuccess, let imagePath = response.destinationURL?.path {
+	if response.error == nil, let imagePath = response.destinationURL?.path {
 	    let image = UIImage(contentsOfFile: imagePath)
 	}
 }