In this chapter, and the last, we were introduced to many different Swift constructs: classes, structs, enums, closures, protocols, and tuples. Yet, rarely will we be dealing with these on their own; we will likely have many instances of these constructs, and we need a way to collect multiple instances in useful data structures. We will examine three collection data structures provided by Swift: arrays, sets, and Dictionaries (often called hash tables in other languages):
In the next few recipes, we'll look at how to use them to store and access elements, and examine their relative characteristics.