async/await in SwiftUI

Convert a SwiftUI app to use the new Swift concurrency and find out what’s going on beneath the shiny surface. By Audrey Tam.

4.6 (16) · 1 Review

Download materials
Save for later
Share
You are currently viewing page 5 of 5 of this article. Click here to view the first page.

WWDC 2021 Videos

To learn more about the fundamental concepts of Swift concurrency, watch these videos first:

  • Meet async/await in Swift: This session introduces try await, get async, unstructured task and continuations.
  • Explore structured concurrency in Swift: This session covers concurrent and sequential binding, cancellation, task groups, unstructured and detached tasks. There’s a handy Flavors of task table near the end.
  • Protect mutable state with Swift actors: This session covers data races, actor, protocol conformance in extensions with nonisolated declarations, detached tasks, Sendable, conformance and MainActor.

These sessions are SwiftUI-specific:

  • Demystify SwiftUI: Get inspired to check all your SwiftUI code for inefficiencies. Lots of cute dog and cat photos.
  • Discover concurrency in SwiftUI: This session provides valuable tips for using structured concurrency in a SwiftUI app (SpacePhoto).

These talks cover a few specific purposes:

Set aside a good chunk of uninterrupted time for these deeper dives, or watch them in 10-15 minute chunks:

Melbourne Cocoaheads

And finally, two notable contributions from my colleagues at Melbourne Cocoaheads.

I hope you enjoyed this tutorial! Swift concurrency is a huge game-changer and it’s still evolving. There’s a lot to learn, so take some time now to explore it, even if you can’t really use it for a few years.

WWDC is like Christmas…

WWDC is like Christmas...

WWDC is like Christmas…

If you have any comments or questions, feel free to join in the forum discussion below!