Syntax

Swift Async / Await Syntax

In Swift, async / await: waits for async work — let data = try await load()

Quick Answer

Syntax
let data = try await load()
SwiftSyntax

Async / Await

Code example
let data = try await load()

Waits for async work.

Learn More

How to async / await in Swift

  1. Open your Swift file or editor.
  2. Copy the example, then replace its sample names and values for your code.

Swift Async / Await Syntax

Use let data = try await load().

Related Syntax References

Frequently asked questions

What is the Swift syntax for async / await?

Use this pattern: let data = try await load()

Can I copy this Swift code example?

Yes. Use Copy code and adapt the example to your program.

Is this Swift syntax different on Mac or Windows?

No. The language syntax is the same across operating systems.

Official source · How we verify