You can use zip(), which creates a sequence of pairs from the two given sequences:

Source: swift – Iterate over two arrays simultaneously – Stack Overflow