Swift Equatable and Hashable
Swift provides a protocol that you can conform to to let the world know that your objects or structs can be compared and found equal or not: Equatable. There’s also a protocol that allows you to use your objects as keys in a dictionary: Hashable. In an app I’m working on I’m making some of the models (structs) conform to these procotols so that I can make diffing and such when refreshing the UI.
Read more...