RequestOperation

public class RequestOperation<R> : AOperation<R> where R : Requestable

An NSOperation that executes the Requestable asynchronously.

  • Intializes an request operation.

    Declaration

    Swift

    public init(
        requestable: R,
        request: @escaping () -> DataRequest,
        downloadProgressHandler: ((Progress) -> Void)? = nil,
        completionHandler: ((DataResponse<R.Response>) -> Void)?
    )

    Parameters

    requestable
    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>