In the previous chapter, we talked about functions and closures and covered topics such as function types. We know that functions are first-class citizens in Swift and they can be stored and passed around like any type. It is the time to look into types in detail.
This chapter starts with explaining types, touching on the concept of types in the category theory very briefly. Then it explains value and reference types and compares them in detail. Finally, it talks about equality, identity, and type casting.
This chapter will cover the following topics with coding examples:
- Different categories of types
- Value versus reference types
- Value and reference type constants
- Mixing value and reference types
- Value ...