loop throught index and elements swift 5 code example
Example: swift for loop index
for (index, object) in list.enumerated() {
print("Item at \(index): \(object)")
}
for (index, object) in list.enumerated() {
print("Item at \(index): \(object)")
}