Swift: Tuple comparison

We can compare two tuple values if they have the same number of values and belong to same type. Tuples are used to group multiple values in a single notation. Tuples are compared from left to right, one value at a time until there is a mismatch.If the values are not equal, the entire tuple becomes unequal. If all the values are matched, then the tuples are equal. Swift standard library includes tuple comparison operators for fewer than seven elements.


Leave a Reply