Summary
In this chapter, we have reviewed three main paradigms to handle concurrent tasks in Swift: using callbacks and closures; using futures and promises; using reactive programming. The aim of this chapter has mainly been to provide readers with solid foundations to understand why callbacks are a low-level mechanism not entirely suitable to write complex programs, to understand what futures and promises really are under the hood, and to appreciate the beauty of reactive programming. We have also provided a necessarily short introduction to a few frameworks that will make using futures and promises of reactive streams with Swift a breeze.
In the next chapter, we are going to focus on Swift Package Manager, which can be a great companion ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access