Swift Protocol Implements Equatable
1) Allow two Cacheables of the same type to be compare protocol Cacheable: Equatable { //….// func identifier() -> String } func ==<T : Cacheable>(lhs: T, rhs: T) -> Bool { return lhs.identifier() == rhs.identifier() } Pros This is the simplest solution. Cons You can only compare two Cacheable objects of the same type. This … Read more