support swift 6 concurrency URLSession method

This commit is contained in:
zunda committed 2024-07-15 07:19:26 +09:00
1 parent 803ca5a172
commit 5caa54337a
1 file changed
+12 -1
@@ -44,7 +44,7 @@ private enum HTTPTypeConversionError: Error {
#endif
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS)
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS) || compiler(>=6)
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
extension URLSession {
@@ -113,7 +113,14 @@ extension URLSession {
}
return (location, response)
}
}
#endif
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS)
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
extension URLSession {
/// Returns a byte stream that conforms to AsyncSequence protocol.
///
/// - Parameter request: The `HTTPRequest` for which to load data.
@@ -131,6 +138,10 @@ extension URLSession {
}
}
#endif
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS) || compiler(>=6)
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
extension URLSession {
/// Convenience method to load data using an `HTTPRequest`; creates and resumes a `URLSessionDataTask` internally.