Creates a sequence of pairs built out of two underlying sequences.
- Xcode 8.0+
- Swift Standard Library
The first sequence or collection to zip.
The second sequence or collection to zip.
A sequence of tuple pairs, where the elements of each pair are corresponding elements of
Zip2Sequence instance returned by this function, the elements of the ith pair are the ith elements of each underlying sequence. The following example uses the
zip(_: function to iterate over an array of strings and a countable range at the same time:
If the two sequences passed to
zip(_: are different lengths, the resulting sequence is the same length as the shorter sequence. In this example, the resulting array is the same length as