Concurrency in Swift: A Complete Guide to async/await, Actors, and Task
Concurrency in Swift: A Complete Guide to async/await, Actors, and Task
Summary:
The book «Concurrency in Swift (iOS/macOS)» is a comprehensive guide to modern approaches for writing safe and performant multithreaded code for Apple platforms. In the era of multi-core processors, the ability to skillfully manage parallel tasks is becoming a mandatory skill for every developer.
Who is this book for?
- iOS/macOS developers familiar with the basics of Swift but wanting to master async/await and Actors;
- Programmers transitioning from legacy approaches (GCD, OperationQueue) to Structured Concurrency;
- Team leads and architects striving to write thread-safe code without data races and deadlocks;
- Anyone who wants to understand how the modern concurrency model in Swift 5.5+ works.
What will you learn?
- The basics of Structured Concurrency: how async/await replaces closures and callbacks;
- Working with Task and TaskGroup: creation, cancellation, priorities, and error handling;
- Actors: state isolation, reentrancy, and preventing data races;
- Sendable and @Sendable: how the compiler helps avoid unsafe data access;
- Practical examples: loading images, working with Core Data, network requests, and UI updates;
- Migration from GCD to async/await: a step-by-step guide with real-world scenarios;
- Advanced topics: global actors, MainActor, async sequences, and streams.
Each chapter contains not only theory but also ready-to-use code examples. You will learn to design application architecture where concurrency is not a source of bugs but serves as a tool for creating a responsive interface.
The book is written by a practicing iOS developer with 8 years of experience and has been reviewed by Apple experts. The material is relevant for Swift 5.9+ and Xcode 15+.
After reading, you will be able to confidently use async/await in production projects, design thread-safe data models using Actors, and avoid common multithreaded programming mistakes.