Created
March 19, 2025 07:18
-
-
Save gaeng2y/fa93bf2df6fb78c1bd95b7a7db48aba6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func fetchThumbnails(for ids: [String]) async throws -> [String: UIImage] { | |
| var thumbnails: [String: UIImage] = [:] | |
| for id in ids { | |
| try Task.checkCancellation() | |
| thumbnails[id] = try await fetchOneThumbnail(withID: id) | |
| } | |
| return thumbnails | |
| } | |
| func fetchThumbnails(for ids: [String]) async throws -> [String: UIImage] { | |
| var thumbnails: [String: UIImage] = [:] | |
| for id in ids { | |
| if Task.isCancelled { break } | |
| thumbnails[id] = try await fetchOneThumbnail(withID: id) | |
| } | |
| return thumbnails | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment