File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,21 @@ import Foundation
1212@available ( iOS 13 . 0 . 0 , * )
1313public extension NetworkService {
1414
15+ /**
16+ Fetches a resource asynchronously from remote location. Execution of the requests starts immediately.
17+
18+ **Example**:
19+ ```swift
20+ let networkService: NetworkService = //
21+ let resource: Resource<String> = //
22+
23+ let (result, response) = try await networkService.request(resource)
24+ ```
25+
26+ - parameter resource: The resource you want to fetch.
27+
28+ - returns: a touple containing the parsed result and the HTTP response
29+ */
1530 @discardableResult
1631 func request< Result> ( _ resource: Resource < Result > ) async throws -> ( Result , HTTPURLResponse ) {
1732 return try await withCheckedThrowingContinuation ( { coninuation in
You can’t perform that action at this time.
0 commit comments