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
10
10
@available ( iOS, obsoleted: 15.0 , message: " Use the built-in API instead " )
11
11
@available ( macOS, obsoleted: 12.0 , message: " Use the built-in API instead " )
12
12
extension 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
-
26
13
func data( for request: URLRequest ) async throws -> ( Data , URLResponse ) {
27
14
var dataTask : URLSessionDataTask ?
28
15
You can’t perform that action at this time.
0 commit comments