How to iterate over an array in Swift while getting both the index and element?
Hi everyone! I just started learning Swift and ran into this problem. I need to iterate over an array of strings, but on each iteration I need not only the element itself, but also its index (position) in the array.
Here's an example of what I'm trying to do. I have an array of names:
```swift
let names = ["Anna", "Boris", "Victor", "Galina"]
```
I want to display something like:
"1. Anna"
"2. Boris"
and so on.
Currently I'm doing this:
```swift
for i in 0..