Returns a Boolean value indicating whether two arguments match by value equality.
- Xcode 8.0+
- Swift Standard Library
A value to compare.
Another value to compare.
The pattern-matching operator (
~=) is used internally in
case statements for pattern matching. When you match against an
Equatable value in a
case statement, this operator is called behind the scenes.
In this example, the
case 3 expression uses this pattern-matching operator to test whether
weekday is equal to the value