Swift 6 · Errors and concurrency

Start a task

Task starts asynchronous work from synchronous code.

Task {
    let user = try await fetchUser()
    print(user.name)
}

Official Swift 6 documentation

More errors and concurrency commands

All errors and concurrency commands · Swift 6 cheatsheet

Was this page helpful?