What functional programming-ish function (map, reduce, zip) can I use to replace the functionality of this for
loop? (array have different objects but same number of elements)
@IBOutlet var imageViews: [UIImageView]!
photoURLs = ["http://...photo1...", "http://...photo2...", "http://...photo3..."]
for (index, photo) in photoURLs.enumerated() {
imageViews[index].setImageFromString(string: photo.urlString)
}
UPDATE: Most of the comments / answers are appropriate for the first version of this question that I asked. Now, I modified it with my concrete case.
Regarding duplicate question: This question does not address combining two arrays, it refers to copying values from one array to another, exact same indexes, but also putting them through a custom method.