Manager
Responsible for creating and managing Request
objects, as well as their underlying NSURLSession
.
-
Creates a request for downloading from the specified URL request.If
startRequestsImmediately
istrue
, the request will haveresume()
called before being returned.Declaration
Swift
public func download(URLRequest: URLRequestConvertible, destination: (NSURL, NSHTTPURLResponse) -> (NSURL)) -> Request
Parameters
URLRequest
The URL request
destination
The closure used to determine the destination of the downloaded file.
Return Value
The created download request.
-
Creates a request for downloading from the resume data produced from a previous request cancellation.If
startRequestsImmediately
istrue
, the request will haveresume()
called before being returned.Declaration
Swift
public func download(resumeData: NSData, destination: Request.DownloadFileDestination) -> Request
Parameters
resumeData
The resume data. This is an opaque data blob produced by
NSURLSessionDownloadTask
when a task is cancelled. SeeNSURLSession -downloadTaskWithResumeData:
for additional information.destination
The closure used to determine the destination of the downloaded file.
Return Value
The created download request.