UploadOperation
public protocol UploadOperation : NetworkOperation
A network operation that knows how to execute an upload to pCloud.
-
The result from executing the upload. Exists only when
state
isNetworkOperationState.completed
.Declaration
Swift
var response: Upload.Response? { get }
-
The number of bytes currently uploaded.
Declaration
Swift
var numberOfBytesSent: Int64 { get }
-
The total number of bytes to upload.
Declaration
Swift
var totalNumberOfBytesToSend: Int64 { get }
-
Adds a block to be called on a specific queue when
numberOfBytesSent
changes.Declaration
Swift
@discardableResult func addProgressBlock(with queue: DispatchQueue?, _ block: @escaping (Int64, Int64) -> Void) -> Self
Parameters
queue
A queue to call
block
on. Ifnil
, the queue on whichblock
will be called is undefined.block
A block called with the number of bytes currently uploaded and the total number of bytes to upload as first and second input arguments respectivly. Referenced strongly by the operation.
-
Adds a block to be called on a specific queue when the operation receives its response.
Declaration
Swift
@discardableResult func addCompletionBlock(with queue: DispatchQueue?, _ block: @escaping (Upload.Response) -> Void) -> Self
Parameters
queue
A queue to call
block
on. Ifnil
, the queue on whichblock
will be called is undefined.block
Called as soon as the operation receives its response. Referenced strongly by the operation.