Instance Method

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-Length header. If this header was not provided, the value is NSURLSessionTransferSizeUnknown.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software