urlSession(_:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:)
Periodically informs the delegate about the download’s progress.
Declaration
optional func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64)Parameters
- session:
The session containing the download task.
- downloadTask:
The download task.
- bytesWritten:
The number of bytes transferred since the last time this delegate method was called.
- totalBytesWritten:
The total number of bytes transferred so far.
- totalBytesExpectedToWrite:
The expected length of the file, as provided by the
Content-Lengthheader. If this header was not provided, the value is Nsurlsessiontransfersizeunknown.