4

When I conform to the URLSessionDownloadDelegate

The following delegate method can be used to get the progress of the download.

urlSession(_ session: URLSession, 
           downloadTask: URLSessionDownloadTask, 
           didWriteData bytesWritten: Int64, 
           totalBytesWritten: Int64, 
           totalBytesExpectedToWrite: Int64)

But is it possible to get progress when using the completionHandler method?.

downloadTask(with request: URLRequest, 
             completionHandler: @escaping (URL?, URLResponse?, Error?) -> Swift.Void) -> URLSessionDownloadTask
carbonr
  • 6,049
  • 5
  • 46
  • 73
Brandon A
  • 8,153
  • 3
  • 42
  • 77
  • I actually don't think this is possible Brandon. You may have to use the URLConnection delegate methods to achieve this. – Tom Testicool May 08 '17 at 06:37

0 Answers0