Skip to content

Instantly share code, notes, and snippets.

@tokizuoh
Created May 5, 2024 08:29
Show Gist options
  • Save tokizuoh/eb371247977752f95fdfb84c433de781 to your computer and use it in GitHub Desktop.
Save tokizuoh/eb371247977752f95fdfb84c433de781 to your computer and use it in GitHub Desktop.
// 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