Автор: Marin Todorov
Издательство: Razeware LLC
Год: 2021 (v1.0.1)
Страниц: 263
Язык: английский
Формат: pdf (true), epub
Размер: 49.8 MB
Master Swift’s new concurrency model! For years, writing powerful and safe concurrent apps with Swift could easily turn into a daunting task, full of race conditions and unexplained crashes hidden in a massive nesting of callback closures. In Swift 5.5, Apple introduced a new concurrency model featuring the async/await syntax, to let you write asynchronous code that reads like synchronous code. But like any new feature, here be dragons! So how will you achieve the much-desired mastery of Modern Swift Concurrency?
The new concurrency model provides everything you need to write safe and performant programs in Swift, including:
• A new, native syntax for running asynchronous operations in a structured way.
• A bundle of standard APIs to design asynchronous and concurrent code.
• Low-level changes in the libdispatch framework, which make all the high-level changes integrate directly into the operating system.
• A new level of compiler support for creating safe, concurrent code.
Swift 5.5 introduces the new language syntax and APIs to support these features. In your apps, besides using a recent Swift version, you also need to target certain platform versions:
• If you’re using Xcode 13.2 or newer, it will bundle the new concurrency runtime with your app so you can target iOS 13 and macOS 10.15 (for native apps).
• In case you’re on Xcode 13 but earlier version than 13.2, you’ll be able to target only iOS 15 or macOS 12 (or newer).
In the first chapter of the book, you’ll review the new concurrency support in Swift and see how it fares compared to the existing APIs. Later, in the practical part of the chapter, you’ll work on a real-life project by trying out the async/await syntax and adding some cool asynchronous error-handling.
Modern Concurrency in Swift is here for the rescue, showcasing everything you need to know about async/await, tasks, actors, and everything in between!
Скачать Modern Concurrency in Swift (1st Edition)