AuthenticationChallengeResponsable
public protocol AuthenticationChallengeResponsable: class
Protocol indicates that an authentication challenge could be handled.
-
Called when an session level authentication challenge is received. This method provide a chance to handle and response to the authentication challenge before downloading could start.
Note
This method is a forward from
URLSessionDelegate.urlSession(:didReceiveChallenge:completionHandler:)
. Please refer to the document of it inURLSessionDelegate
.Declaration
Swift
func downloader(_ downloader: ImageDownloader, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void)
Parameters
downloader
The downloader which receives this challenge.
challenge
An object that contains the request for authentication.
completionHandler
A handler that your delegate method must call.
-
Called when an session level authentication challenge is received. This method provide a chance to handle and response to the authentication challenge before downloading could start.
Note
This method is a forward from
URLSessionTaskDelegate.urlSession(:task:didReceiveChallenge:completionHandler:)
. Please refer to the document of it inURLSessionTaskDelegate
.Declaration
Swift
func downloader(_ downloader: ImageDownloader, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void)
Parameters
downloader
The downloader which receives this challenge.
task
The task whose request requires authentication.
challenge
An object that contains the request for authentication.
completionHandler
A handler that your delegate method must call.