Protocol

URLSessionTaskDelegate

The NSURLSessionTaskDelegate protocol defines the task-specific delegate methods that you should implement when working with any type of URLSession task.

Overview

If you are using download tasks, also implement the methods in the URLSessionDownloadDelegate protocol.

If you are using data or upload tasks, also implement the methods in the URLSessionDataDelegate protocol.

Symbols

Delegate Methods

func urlSession(URLSession, task: URLSessionTask, didSendBodyData: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64)

Periodically informs the delegate of the progress of sending body content to the server.

func urlSession(URLSession, task: URLSessionTask, needNewBodyStream: (InputStream?) -> Void)

Tells the delegate when a task requires a new request body stream to send to the remote server.

func urlSession(URLSession, task: URLSessionTask, didFinishCollecting: URLSessionTaskMetrics)

Tells the delegate that the session finished collecting metrics for the task.

func urlSession(URLSession, task: URLSessionTask, didCompleteWithError: Error?)

Tells the delegate that the task finished transferring data.

Relationships