DownloadOperation
public protocol DownloadOperation : NetworkOperation
A network operation that knows how to execute a download.
-
The result from executing the download. Exists only when
stateisNetworkOperationState.completed.Declaration
Swift
var response: Download.Response? { get } -
The number of bytes currently downloaded.
Declaration
Swift
var numberOfBytesReceived: Int64 { get } -
The total number of bytes to download.
Declaration
Swift
var totalNumberOfBytesToReceive: Int64 { get } -
Adds a block to be called on a specific queue when
numberOfBytesReceivedchanges.Declaration
Swift
@discardableResult func addProgressBlock(with queue: DispatchQueue?, _ block: @escaping (Int64, Int64) -> Void) -> SelfParameters
queueA queue to call
blockon. Ifnil, the queue on whichblockwill be called is undefined.blockA 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 (Download.Response) -> Void) -> SelfParameters
queueA queue to call
blockon. Ifnil, the queue on whichblockwill be called is undefined.blockCalled as soon as the operation receives its response. Referenced strongly by the operation.
View on GitHub
DownloadOperation Protocol Reference