Alamofire Docs

Alamofire Reference Manager Extension Reference

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 is true, the request will have resume() 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 is true, the request will have resume() 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. See NSURLSession -downloadTaskWithResumeData: for additional information.

    destination

    The closure used to determine the destination of the downloaded file.

    Return Value

    The created download request.