なんとかするから、なんとかなる

エンジニア関係のことを書きます

iOS How to get an index of array in for each sentence.

Introduction

This article shows how to get an index in for each sentence.

Solution

Using enumarated method. You can get the index of array

for (index, value) in someArray.enumarated() {
    // do something
}