Last active
January 31, 2022 07:41
-
-
Save SebastianBoldt/0d72054246ca87588f7d316909b915a3 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
let loadDataTask = Task(priority: .medium) { () -> Data | |
let url = URL(string: "https://hws.dev/headlines.json")! | |
let (data, _) = try await URLSession.shared.data(from: url) | |
return data | |
} | |
let data = try await loadDataTask.value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment