Generics - Conclusion
Conclusion
In this lesson, you’ve learned:
- How generics are used in Swift: You can write your own generic functions and types.
- How you can apply constraints to generics to narrow their scope: You can constrain a generic function or type to types that conform to specific protocols or inherit from a specific class.
To further explore generics, see Expert Swift, Chapter 4: Generics.