So I made a download request using Alamofire and this request and return image, voice, video and I was able to see the file in through the destinationURL
but my question is how do I convert the request result to data I can use, like if I got image back how can add it to ImageView and so now, also I have one concern this function get called every time I open the page even if the file was download in the document, is not that going to take a lost of memory? and affect performance??
let destination = DownloadRequest.suggestedDownloadDestination(for: .documentDirectory)
Alamofire.download(
"url",
method: .get,
parameters: nil,
encoding: JSONEncoding.default,
headers:nil ,
to: destination).downloadProgress(closure: { (progress) in
//progress closure
}).response(completionHandler: { (DefaultDownloadResponse) in
//here you able to access the DefaultDownloadResponse
//result closure
print("*****DefaultDownloadResponse***** \(DefaultDownloadResponse.response) and \(DefaultDownloadResponse.resumeData) and \(DefaultDownloadResponse.destinationURL)")
})