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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.