@@ -15,6 +15,8 @@ import FoundationNetworking
1515#endif
1616
1717/// Error enumeration that can be returned by a `Downloader` conforming type.
18+ // deprecated 2/2021
19+ @available ( * , deprecated, message: " moved to SwiftPM, use URLSession or async-http-client instead " )
1820public enum DownloaderError : Error {
1921
2022 /// Error thrown when the downloader fails to establish a connection to the server.
@@ -28,6 +30,8 @@ public enum DownloaderError: Error {
2830}
2931
3032/// The `Downloader` protocol abstract away the download of a file with a progress report.
33+ // deprecated 2/2021
34+ @available ( * , deprecated, message: " moved to SwiftPM, use URLSession or async-http-client instead " )
3135public protocol Downloader {
3236
3337 /// The progress closure type. The first arguments contains the number of bytes downloaded, and the second argument
@@ -55,6 +59,8 @@ public protocol Downloader {
5559 )
5660}
5761
62+ // deprecated 2/2021
63+ @available ( * , deprecated, message: " moved to SwiftPM, use URLSession or async-http-client instead " )
5864extension DownloaderError : LocalizedError {
5965 public var errorDescription : String ? {
6066 switch self {
@@ -69,6 +75,8 @@ extension DownloaderError: LocalizedError {
6975}
7076
7177/// A `Downloader` conformance that uses Foundation's `URLSession`.
78+ // deprecated 2/2021
79+ @available ( * , deprecated, message: " moved to SwiftPM, use URLSession or async-http-client instead " )
7280public final class FoundationDownloader : NSObject , Downloader {
7381
7482 /// The integer identifier of a `URLSessionTask`.
@@ -134,6 +142,8 @@ public final class FoundationDownloader: NSObject, Downloader {
134142 }
135143}
136144
145+ // deprecated 2/2021
146+ @available ( * , deprecated, message: " moved to SwiftPM, use URLSession or async-http-client instead " )
137147extension FoundationDownloader : URLSessionDownloadDelegate {
138148 public func urlSession(
139149 _ session: URLSession ,
@@ -177,6 +187,8 @@ extension FoundationDownloader: URLSessionDownloadDelegate {
177187 }
178188}
179189
190+ // deprecated 2/2021
191+ @available ( * , deprecated, message: " moved to SwiftPM, use URLSession or async-http-client instead " )
180192extension FoundationDownloader {
181193
182194 /// Returns the download data structure associated with a task and fails if none is found as this should never
@@ -191,6 +203,8 @@ extension FoundationDownloader {
191203 }
192204}
193205
206+ // deprecated 2/2021
207+ @available ( * , deprecated, message: " moved to SwiftPM, use URLSession or async-http-client instead " )
194208extension FoundationDownloader . Download {
195209 func notifyProgress( bytesDownloaded: Int64 , totalBytesToDownload: Int64 ? ) {
196210 DispatchQueue . global ( ) . async {
0 commit comments