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 through the task of refactoring your code and extracting frameworks from it that you can easily share.