Skip to content
Justice Tech School

async and await

async functions suspend and await waits for them. Task starts asynchronous work.

Example
func load() async -> Int { 42 }
Task {
    let v = await load()
    print(v)
}

Exercise

Wait for async.

 load()

Quiz Test

What does async mean?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.