Concurrency
Dive deep into Swift’s latest concurrency changes, covering async-await, actors, and more.
MainActor usage in Swift explained to dispatch to the main thread
MainActor is a new attribute introduced in Swift 5.5 as a global actor providing an executor which performs its tasks ...
Read More
Read More
Unit testing async/await Swift code
Unit tests allow you to validate code written using the latest concurrency framework and async/await. While writing tests doesn't differ ...
Read More
Read More
Detached Tasks in Swift explained with code examples
Detached tasks allow you to create a new top-level task and disconnect from the current structured concurrency context. You could ...
Read More
Read More
Task Groups in Swift explained with code examples
Task Groups in Swift allow you to combine multiple parallel tasks and wait for the result to return when all ...
Read More
Read More
Sendable and @Sendable closures explained with code examples
Sendable and @Sendable are part of the concurrency changes that arrived in Swift 5.5 and address a challenging problem of ...
Read More
Read More
AsyncSequence explained with Code Examples
AsyncSequence is part of the concurrency framework and the SE-298 proposal. Its name implies it's a type providing asynchronous, sequential, ...
Read More
Read More
AsyncThrowingStream and AsyncStream explained with code examples
AsyncThrowingStream and AsyncStream are part of the concurrency framework introduced in Swift 5.5 due to SE-314. Async streams allow you ...
Read More
Read More
Tasks in Swift explained with code examples
Tasks in Swift are part of the concurrency framework introduced at WWDC 2021. A task allows us to create a ...
Read More
Read More
Async await in Swift explained with code examples
Async await is part of the new structured concurrency changes that arrived in Swift 5.5 during WWDC 2021. Concurrency in ...
Read More
Read More
Nonisolated and isolated keywords: Understanding Actor isolation
SE-313 introduced the nonisolated and isolated keywords as part of adding actor isolation control. Actors are a new way of ...
Read More
Read More
Async let explained: call async functions in parallel
Async let is part of Swift's concurrency framework and allows instantiating a constant asynchronously. The concurrency framework introduced the concept ...
Read More
Read More
Actors in Swift: how to use and prevent data races
Swift Actors are new in Swift 5.5 and are part of the big concurrency changes at WWDC 2021. Before actors, ...
Read More
Read More