Skip to content
This repository has been archived by the owner on Oct 17, 2021. It is now read-only.

SessionDelegate

mattt edited this page Sep 18, 2020 · 4 revisions

SessionDelegate

Class which implements the various URLSessionDelegate methods to connect various Alamofire features.

open class SessionDelegate:​ NSObject

Inheritance

NSObject, URLSessionDataDelegate, URLSessionDelegate, URLSessionDownloadDelegate, URLSessionTaskDelegate

Initializers

init(fileManager:​)

Creates an instance from the given FileManager.

public init(fileManager:​ FileManager = .default)

Parameters

  • fileManager:​ FileManager to use for underlying file management, such as moving downloaded files. .default by default.

Methods

urlSession(_:​didBecomeInvalidWithError:​)

open func urlSession(_ session:​ URLSession, didBecomeInvalidWithError error:​ Error?)

urlSession(_:​task:​didReceive:​completionHandler:​)

open func urlSession(_ session:​ URLSession, task:​ URLSessionTask, didReceive challenge:​ URLAuthenticationChallenge, completionHandler:@escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void)

urlSession(_:​task:​didSendBodyData:​totalBytesSent:​totalBytesExpectedToSend:​)

open func urlSession(_ session:​ URLSession, task:​ URLSessionTask, didSendBodyData bytesSent:​ Int64, totalBytesSent:​ Int64, totalBytesExpectedToSend:​ Int64)

urlSession(_:​task:​needNewBodyStream:​)

open func urlSession(_ session:​ URLSession, task:​ URLSessionTask, needNewBodyStream completionHandler:@escaping (InputStream?) -> Void)

urlSession(_:​task:​willPerformHTTPRedirection:​newRequest:​completionHandler:​)

open func urlSession(_ session:​ URLSession, task:​ URLSessionTask, willPerformHTTPRedirection response:​ HTTPURLResponse, newRequest request:​ URLRequest, completionHandler:@escaping (URLRequest?) -> Void)

urlSession(_:​task:​didFinishCollecting:​)

open func urlSession(_ session:​ URLSession, task:​ URLSessionTask, didFinishCollecting metrics:​ URLSessionTaskMetrics)

urlSession(_:​task:​didCompleteWithError:​)

open func urlSession(_ session:​ URLSession, task:​ URLSessionTask, didCompleteWithError error:​ Error?)

urlSession(_:​taskIsWaitingForConnectivity:​)

@available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) open func urlSession(_ session:​ URLSession, taskIsWaitingForConnectivity task:​ URLSessionTask)

urlSession(_:​dataTask:​didReceive:​)

open func urlSession(_ session:​ URLSession, dataTask:​ URLSessionDataTask, didReceive data:​ Data)

urlSession(_:​dataTask:​willCacheResponse:​completionHandler:​)

open func urlSession(_ session:​ URLSession, dataTask:​ URLSessionDataTask, willCacheResponse proposedResponse:​ CachedURLResponse, completionHandler:@escaping (CachedURLResponse?) -> Void)

urlSession(_:​downloadTask:​didResumeAtOffset:​expectedTotalBytes:​)

open func urlSession(_ session:​ URLSession, downloadTask:​ URLSessionDownloadTask, didResumeAtOffset fileOffset:​ Int64, expectedTotalBytes:​ Int64)

urlSession(_:​downloadTask:​didWriteData:​totalBytesWritten:​totalBytesExpectedToWrite:​)

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

urlSession(_:​downloadTask:​didFinishDownloadingTo:​)

open func urlSession(_ session:​ URLSession, downloadTask:​ URLSessionDownloadTask, didFinishDownloadingTo location:​ URL)
Types
Protocols
Global Typealiases
Clone this wiki locally