Photo by Chris Ried / Unsplash

Enumerated

Swift Feb 20, 2022

.enumerated() ile index numaları ile birlikte kullanılabilmektedir.

// Enumerated

let shoppingList = ["milk", "bread", "eggs"]

for (index, value) in shoppingList.enumerated() {
    print("\(index) : \(value)")
}

//0 : milk
//1 : bread
//2 : eggs

Tags

Furkan Ozoglu

iOS Developer & Geomatics Engineer