- Define and use Generics
- Identify Generics in the networking layer
- Lab time
Generic code = flexible & reusable functions and types that can work with any type, based on defined requirements.
Generics are one of the most powrful features of Swift and a lot of the standard library is built with generic code.
We've been using generic code since long time ago, think about arrays. 🤔
@frozen struct Array<Element>The Array type is generic – it doesn’t declare any specific data type.
You can create your own generics. Follow this replit to learn how and then complete the challenges.
Start with the README.md file.
Why implement Generics when we already know about Inheritance?
Think about this question and when you are ready, share your answer in the chat.
