Specialized extensions using generic type constraints
Combining Swift’s powerful generics system with the fact that any Swift type can be extended with new APIs and capabilities enables us to write targeted extensions that conditionally add new features to a type or protocol when it fits certain requirements. It all starts with the where keyword, which lets us apply generic type constraints…