Created
May 5, 2024 08:29
-
-
Save tokizuoh/eb371247977752f95fdfb84c433de781 to your computer and use it in GitHub Desktop.
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
// ref: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/concurrency/#Defining-and-Calling-Asynchronous-Functions | |
func generateSlideshow(forGallery gallery: String) async { | |
let photos = await listPhotos(inGallery: gallery) | |
for photo in photos { | |
// ... render a few seconds of video for this photo ... | |
await Task.yield() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment