swift for 循环

1、for in

for index in 0...16 {
    print(array[index])
}
 
for index in 0..<16 {
    print(array[index])
}
 
for element in iosArray {
    print(element)
}

for (index, element) in iosArray .enumerated(){
    print("element=\(element), index=\(index))
}

你可能感兴趣的:(swift for 循环)