That's not the case here as I neither subclass NSObject nor overload the optional == operator.
proof:
swift
class Month: Hashable {
let name: String
internal init(name: String) {
self.name = name
}
static func == (lhs: Month, rhs: Month) - Bool {
print("Month overloaded")
return false
}
func hash(into hasher: inout Hasher) {
hasher.combine(name)
}
}
let a: AnyHashable = Month(name: "ab")
let b: AnyHashable = Month(name: "ab")
a == b // prints: `Month overloaded`
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: