Swift: Go Through Array in Reverse Order
·1 min
In Swift you would use the following for statement to go through each element in an array when you need to access the current index inside the for loop:
for index in 0..<listItems.count
How do you go through the array in reverse order? Use the reverse keyword.
for index in reverse(0..<listItems.count)