Created
January 30, 2022 10:37
-
-
Save SebastianBoldt/b87b741a7312b689668148fb3932f116 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
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