ADownloadable
public protocol ADownloadable : AConfigurable, _Requestable
Represents a Downloadable
for Alamofire.
Create custom Downloadable
protocol HTTPBinDownloadService: ADownloadable {
var path: String? = "bytes/\(4 * 1024 * 1024)"
var destination: DownloadFileDestination?
init(destination: @escaping DownloadFileDestination) {
self.destination = destination
}
}
-
destination
Default implementationThe download file destination
Default Implementation
nil
Declaration
Swift
var destination: DownloadFileDestination? { get }
-
validationBlock
Default implementationThe Alamofire data request validation.
Default Implementation
Validation.default.downloadValidation
Declaration
Swift
var validationBlock: DownloadRequest.Validation? { get }
-
request
Extension methodCreates a
DownloadRequest
to retrieve the contents of a URL based on the specifiedRequestable
If
startRequestsImmediately
istrue
, the request will haveresume()
called before being returned.Declaration
Swift
public var request: DownloadRequest { get }
Return Value
The created
DownloadRequest
.