Chapter 5. Generics

Topics in This Chapter

Image 5.1 Why Generics?

Image 5.2 Generic Functions

Image 5.3 Generic Types

Image Exercises

Generic programming involves defining algorithms in such a way that they are type agnostic, with the actual types involved specified later, when the algorithm is used. By programming using generics, you can create generic templates for functions ...

Get Swift for the Really Impatient now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.