I have three arrays I am trying to run through and I want to use the values from all three arrays in one function. This might sound confusing but here is what I have:
Here is a solution using zip with 3 arrays (test they are indeed the same length):
zip
for (name, (age, gender)) in zip(names, zip(ages, genders)) { makeUser(name, userAge: age, userGender: gender) }
But maybe the cleanest of them all is just old fashioned C-style:
for i in 0..