init(request:delegate:)
Returns an initialized URL download for a URL request and begins to download the data for the request.
Declaration
init(request: URLRequest, delegate: (any NSURLDownloadDelegate)?)Parameters
- request:
The URL request to download. The
requestobject is deep-copied as part of the initialization process. Changes made torequestafter this method returns do not affect the request that is used for the loading process. - delegate:
The delegate for the download. This object will receive delegate messages as the download progresses. Delegate messages will be sent on the thread which calls this method. For the download to work correctly the calling thread’s run loop must be operating in the default run loop mode.
The
NSURLDownloadclass maintains a strong reference to this delegate object.
Return Value
An initialized NSURLDownload object for request.