Swift Concurrency for Beginners: Getting Started with Async/Await
Wait for this!
Ever since Swift 5.5 we have had access to fun concurrency features in Swift.
I think there is a crucial part of this, and it’s Swift’s async/await
syntax. This article is intended to provide a beginner friendly introduction to this syntax and explain how it might be used in a practical way.
Before we start
Difficulty: Beginner | Easy | Normal | Challenging
This article has been developed using Xcode 14.2, and Swift 5.7.2
Prerequisites:
- You will be expected to be aware of how to make a Single View Application
- Some familiarity with GCD and concurrency would be useful for the reader
Keywords and Terminology:
Asynchronous: Work that can be run out of order, and usually have a callback when completed.
async/await: An alternative to completion handlers, a coroutine model that allows execution to be suspended and resumed.
The background
I’ve already written a simple example article about async/await. I think it’s time to go further into this topic and think about how…