Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
protocol KindaEquatable {
func ~==(lhs: Self, rhs: Self) -> Bool
}
infix operator ~!= { associativity left precedence 140 }
func ~!=<T where T: KindaEquatable>(lhs: T, rhs: T) -> Bool {
return !(lhs ~== rhs)
}
// MARK: - String
extension String: KindaEquatable {}
infix operator ~== { associativity left precedence 140 }
func ~==(lhs: String, rhs: String) -> Bool {
return lhs.lowercaseString == rhs.lowercaseString
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.