This gist vends a new protocol called SelectiveEquatable
which contains a single method, isEqual(to:by:)
. This method allows you to check the equality
of two values by selectively picking which properties you would like to compare.
SelectiveEquatable is also available as a Swift Package!
To see my thought process of how and why I created this, check out my blog post: Selective Equality Checking in Swift.