OperatorSwift
==(_:_:)
Returns a Boolean value indicating whether the corresponding components of two tuples are equal.
func == <A, B>(lhs: (A, B), rhs: (A, B)) -> Bool where A : Equatable, B : Equatable
Parameters
- lhs
A tuple of
Equatable
elements.- rhs
Another tuple of elements of the same type as
lhs
.
Overview
For two tuples to compare as equal, each corresponding pair of components must be equal. The following example compares tuples made up of 2 components:
let a = ("a", 1)
let b = ("a", 1)
print(a == b)
// Prints "true"
let c = ("a", 2)
print(a == c)
// Prints "false"