Andreza's answer is correct, but if you need to know the position of an element within a loop you need to use the enumerated
method in your array.
var nomes = ["Douglas", "Marilia", "Roberto", "Carol", "Lucas", "Iasmim", "João", "Zeca"]
nomes.append("Franklyn")
print(nomes)
for (index, constante) in nomes.enumerated() {
print("Constante \(constante) at posição \(index)")
}
Constant Douglas at position 0
Constant Marilia at position 1
Constant Robert at position 2
Constant Carol at position 3
Constant Lucas at position 4
Constant Iasmin at position 5
Constant John at position 6
Constant Zeca at position 7
Constant Franklyn at position 8