loops for array in swift 5 code example
Example 1: loop through array swift
let names = ["a", "b", "c"]
for name in names {
print(name)
}
Example 2: swift for loop index
for (index, object) in list.enumerated() {
print("Item at \(index): \(object)")
}