DataTask
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public struct DataTask<Value> : Sendable where Value : Sendable
Value used to await
a DataResponse
and associated values.
-
response
AsynchronousDataResponse
produced by theDataRequest
and its response handler.Declaration
Swift
public var response: DataResponse<Value, AFError> { get async }
-
result
Asynchronous -
value
AsynchronousValue
returned by theresponse
.Declaration
Swift
public var value: Value { get async throws }
-
Cancel the underlying
DataRequest
andTask
.Declaration
Swift
public func cancel()
-
Resume the underlying
DataRequest
.Declaration
Swift
public func resume()
-
Suspend the underlying
DataRequest
.Declaration
Swift
public func suspend()