Skip to content

Instantly share code, notes, and snippets.

@gaeng2y
Created March 19, 2025 07:20
Show Gist options
  • Select an option

  • Save gaeng2y/9fcb93b3cf429a44a86d513b0ee5dd6c to your computer and use it in GitHub Desktop.

Select an option

Save gaeng2y/9fcb93b3cf429a44a86d513b0ee5dd6c to your computer and use it in GitHub Desktop.
func fetchThumbnails(for ids: [String]) async throws -> [String: UIImage] {
var thumbnails: [String: UIImage] = [:]
for id in ids {
thumbnails[id] = try await fetchOneThumbnail(withID: id)
}
return thumbnails
}
func fetchOneThumbnail(withID id: String) async throws -> UIImage {
// ...
async let (data, _) = URLSession.shared.data(for: imageReq)
async let (metadata, _) = URLSession.shared.data(for: metadataReq)
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment