DownloadOperation

public class DownloadOperation<R> : AOperation<R> where R : Downloadable

An NSOperation that executes the Downloadable asynchronously.

  • Intializes an download operation.

    Declaration

    Swift

    public init(
        downloadable: R,
        request: @escaping (() -> DownloadRequest),
        downloadProgressHandler: ((Progress) -> Void)? = nil,
        completionHandler: ((DownloadResponse<R.Response>) -> Void)?
    )

    Parameters

    downloadable
    request

    The request closure.

    completionHandler

    The async completion handler called when the request is completed

  • Creates a copy of self

    Declaration

    Swift

    open override func copy() -> AOperation<R>