mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-23 08:09:41 +01:00
Add async version of InitialFeedDownloader.download.
This commit is contained in:
parent
f99e6b425c
commit
69fd496576
@ -12,6 +12,15 @@ import Web
|
||||
|
||||
struct InitialFeedDownloader {
|
||||
|
||||
static func download(_ url: URL) async -> ParsedFeed? {
|
||||
|
||||
await withCheckedContinuation { continuation in
|
||||
self.download(url) { parsedFeed in
|
||||
continuation.resume(returning: parsedFeed)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static func download(_ url: URL,_ completion: @escaping (_ parsedFeed: ParsedFeed?) -> Void) {
|
||||
|
||||
downloadUsingCache(url) { (data, response, error) in
|
||||
|
Loading…
Reference in New Issue
Block a user