Asynchronous Swift (iOS/macOS): The Complete Guide
Asynchronous Swift (iOS/macOS): The Complete Guide
Summary:
The book "Asynchronous Swift (iOS/macOS): The Complete Guide" is a comprehensive practical guide to modern approaches to parallel and concurrent programming in the Apple ecosystem. In the era of complex mobile and desktop applications, the ability to competently manage asynchronous tasks has become a mandatory skill for every Swift developer.
What is this book about?
The book covers all key aspects of asynchronous programming in Swift:
- Basics of async/await — starting with syntax and ending with a deep understanding of task suspension and resumption mechanisms.
- Task and TaskGroup — creating, managing, and canceling asynchronous tasks, working with priorities and structured concurrency.
- Data synchronization — Actor, Sendable, @MainActor, protecting shared state from data races.
- Combine framework — reactive programming, Publishers, Subscribers, operators, integration with async/await.
- Grand Central Dispatch (GCD) — queues, groups, dispatch barriers, working with legacy code.
- Network requests and URLSession — asynchronous work with REST API, image downloading, error handling.
- UI and asynchrony — updating the interface from background threads, SwiftUI async/await, working with ProgressView.
Who is this book for?
The book is intended for:
- Beginner and intermediate iOS/macOS developers who want to master modern approaches to asynchrony;
- Developers familiar with GCD and Closures who want to transition to async/await;
- Programmers facing performance issues and data races;
- Those who want to write clean, maintainable, and safe concurrent code.
What will you learn?
- Why structured concurrency is the new standard in Swift.
- How to avoid deadlocks, race conditions, and memory leaks.
- How to effectively combine async/await with Combine and GCD.
- How to create your own asynchronous sequences (AsyncSequence).
- How to test asynchronous code using XCTest and async/await.
- How to work with background tasks, files, and Core Data in a multithreaded mode.
Each chapter contains practical examples ready for use in real projects. The code is written for the latest version of Swift 5.9+ and Xcode 15+. The book is suitable both for self-study and as a reference guide.
Dive into the world of asynchronous Swift and make your applications faster, more responsive, and more reliable!
Recommendations
Algorithms and Data Structures in TypeScript
Async Kotlin: The Complete Guide
Functional Programming in TypeScript
DevOps for Kotlin Developers
C++ Network Programming. Volume 1: Mastering Complexity with ACE and Patterns
Hands-on Kotlin Coroutines for Android: A Practical Guide to Kotlin Coroutines for Android