public func ==(lhs: Date, rhs: Date) -> Bool {
return lhs === rhs || lhs.compare(rhs) == .orderedSame
}
After upgrading to Swift 3 I now get this error... "Binary operator ===
cannot be applied to two Date
operands"
Any suggestions on how to correct this?
In Swift 3 Date
is a structure (value type), there is no identities and thus cannot be ===
'ed.
In fact, the Date
type already provides a built-in ==
so you don't need to implement it yourself.