Created
September 26, 2023 16:50
-
-
Save willie-hung/b9eea4560b331521d250b21162b07308 to your computer and use it in GitHub Desktop.
iOS Interview Prep 7- Async/Await
This file contains 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
do { | |
// 1. Call the method | |
let images = try await fetchImages() | |
// 2. Fetch images method returns | |
// 3. Call the resize method | |
let resizedImages = try await resizeImages(images) | |
// 4. Resize method returns | |
print("Fetched \(images.count) images.") | |
} catch { | |
print("Fetching images failed with error \(error)") | |
} | |
// 5. The calling method exits |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment