

The idea behind this article is to give you all the tools so that you can start adopting async/await in your projects, baby steps at a time. Before we dive into concurrency - with structured concurrency - next week, I want to show you how you can convert closure-based and delegate-based code into async/await code. We are just one step away from actual concurrency. We contrasted how it compares to callbacks, and we showed examples that hopefully convinced you async/await is really neat. Last week, we had a long discussion on async/await. I decided to make the previous article shorter in an attempt to not overload the articles with information, and to hopefully make it easier to understand these API with smaller articles. I was debating whether this article should be its own or if its contents should be appended to Introducing async/await in Swift. If you aren’t, feel free to read the first part of this article series: Understanding async/await in Swift. To better benefit from this article, you should be familiar with async/await. Modern Swift Concurrency Summary, Cheatsheet, and Thanks.Sharing Data Across Tasks with the property wrapper in the new Swift Concurrency Model.Understanding Actors in the New Concurrency Model in Swift.Unstructured Concurrency With Detached Tasks in Swift.Introduction to Unstructured Concurrency in Swift.Structured Concurrency With Task Groups in Swift.Structured Concurrency in Swift: Using async let.Converting closure-based code into async/await in Swift.Modern Concurrency in Swift: Introduction.The article, code samples, and provided sample project have been updated for Xcode 13 beta 3. This article was originally written creating examples using Xcode 13 beta 1.

This article is part of my Modern Concurrency in Swift article series.
