Skip to content

Glossary: Swift Basics

Task

Also written: Task.sleep

A piece of async work. `Task.sleep(for:)` waits for a time without blocking the program, and `Task { }` starts async work from non-async code.

Where the book teaches it

Related terms

async functionawait