Data structures are containers that hold data used in our programs. The efficiency of these data structures affects our software as a whole. Therefore, it is crucial that we understand the structures available for us to use and that we choose the correct ones for our various tasks.
This is the first part of a two-part series on data structures in Swift. In this tutorial, we’re going to talk about generics and the built-in Swift collection types. In the second part, we’ll take a look at some of the most popular data structures and how they can be implemented in Swift.
Table of contents:
- Why do we need generics?
- Generic Types
- Swift Collection Types