CallTask
public final class CallTask<Method> : Cancellable where Method : PCloudAPIMethod
extension CallTask: CustomStringConvertible
Executes a network call to the pCloud API.
-
Undocumented
Declaration
Swift
public typealias Parser = Method.Parser -
Undocumented
Declaration
Swift
public typealias CompletionBlock = (Result<Method.Value, CallError<Method.Error>>) -> Void -
trueifcancel()has been invoked on this instance,falseotherwise.Declaration
Swift
public var isCancelled: Bool { get } -
Initializes a non-running task with a network operation and a parser.
Declaration
Swift
public init(operation: CallOperation, responseParser: @escaping Parser)Parameters
operationAn operation in a suspended state that would execute the network call.
responseParserA block parsing an object from a response dictionary.
-
Adds a completion block to this instance to be called when the task completes either successfully or with a failure.
Declaration
Swift
@discardableResult public func addCompletionBlock(_ block: @escaping CompletionBlock) -> CallTaskParameters
blockA block called on the main thread with the result of the task.
Return Value
This task.
-
Starts the task if it is not already running.
Declaration
Swift
@discardableResult public func start() -> CallTaskReturn Value
This task.
-
Interrupts and invalidates the task. An invalidated task cannot run again.
Declaration
Swift
public func cancel() -
Declaration
Swift
public var description: String { get }
View on GitHub
CallTask Class Reference