Cancels all outstanding tasks and then invalidates the session.
On This Page
Once invalidated, references to the delegate and callback objects are broken. After invalidation, session objects cannot be reused.
To allow outstanding tasks to run until completion, call finishTasksAndInvalidate() instead.
Invalidates the session, allowing any outstanding tasks to finish.
func flush(completionHandler: () -> Void)
Flushes cookies and credentials to disk, clears transient caches, and ensures that future requests occur on a new TCP connection.
func getTasksWithCompletionHandler(([URLSessionDataTask], [URLSessionUploadTask], [URLSessionDownloadTask]) -> Void)
Asynchronously calls a completion callback with all data, upload, and download tasks in a session.
func getAllTasks(completionHandler: ([URLSessionTask]) -> Void)
Asynchronously calls a completion callback with all tasks in a session
func reset(completionHandler: () -> Void)
Empties all cookies, caches and credential stores, removes disk files, flushes in-progress downloads to disk, and ensures that future requests occur on a new socket.
var sessionDescription: String?
An app-defined descriptive label for the session.
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.