I'm trying to download a file using Alamofire, with progress. But I get this error at the progress
line.
Cannot call value of non-function type 'NSProgress'
What's the problem? All the examples I've seen, namely the official one, do the exact same thing!
Alamofire.download(.GET, nsurl!.absoluteString, destination: { (temporaryURL, response) in
return filepath
})
.progress { (bytesRead, totalBytesRead, totalBytesExpectedToRead) in // <------ ERROR HERE
dispatch_async(dispatch_get_main_queue(), {
self.progressBar?.progress = totalBytesRead / totalBytesExpectedToRead
})
}
.response { (request, response, _, error) in
self.loadImageFromFile(filepath.absoluteString)
}
EDIT:
After @mvoelkl's suggestion, I added parenthesis to the progress function. But the result stayed the same: