Skip to content

Instantly share code, notes, and snippets.

@SebastianBoldt
Created January 30, 2022 10:37
Show Gist options
  • Save SebastianBoldt/b87b741a7312b689668148fb3932f116 to your computer and use it in GitHub Desktop.
Save SebastianBoldt/b87b741a7312b689668148fb3932f116 to your computer and use it in GitHub Desktop.
func printData() async throws {
var iterator = getAsyncIterator()
if let item = try await iterator.next() {
print("The first item is \(item)")
}
while let item = try await iterator.next() {
print("\(item)")
}
}
try? await printData()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment