WBF Academy
Async/Await Beginner 3 min read

async/await URLSession

Fetch data from the network with Swift concurrency

iOS Academy

iOS Academy

iOS Engineer

1 month ago

URLSession has native async/await support from iOS 15. Use try await URLSession.shared.data(from:) to fetch data without callbacks. The .task modifier automatically cancels the work when the view disappears.

#async #await #URLSession #networking