File tree Expand file tree Collapse file tree 1 file changed +0
-13
lines changed Expand file tree Collapse file tree 1 file changed +0
-13
lines changed Original file line number Diff line number Diff line change @@ -10,19 +10,6 @@ import Foundation
1010@available ( iOS, obsoleted: 15.0 , message: " Use the built-in API instead " )
1111@available ( macOS, obsoleted: 12.0 , message: " Use the built-in API instead " )
1212extension URLSession {
13- func data( fromUrl url: URL ) async throws -> ( Data , URLResponse ) {
14- try await withCheckedThrowingContinuation { continuation in
15- let task = self . dataTask ( with: url) { data, response, error in
16- guard let data = data, let response = response else {
17- let error = error ?? URLError ( . badServerResponse)
18- return continuation. resume ( throwing: error)
19- }
20- continuation. resume ( returning: ( data, response) )
21- }
22- task. resume ( )
23- }
24- }
25-
2613 func data( for request: URLRequest ) async throws -> ( Data , URLResponse ) {
2714 var dataTask : URLSessionDataTask ?
2815
You can’t perform that action at this time.
0 commit comments