🌱 Embrace Swift Generics

Source

Video helped me with generics a tiny bit (still not sure I can spot and use them from scratch on my own).

The examples at the beginning showing code smells for when to use them was helpful.

Polymorphism allows one piece of code to have many behaviors.

some

  • holds a fixed concrete type
  • guarantees type relationships

any

  • holds an arbitrary concrete type
  • erases type relations

Write some by default

A protocol separates ideas from implementation details.

And its follow up video that goes into more details https://developer.apple.com/wwdc22/110353

Made by Brandon . If you find this project useful you can donate.