Swift for loop and for index element in an array iOS

Solution:

  The below code is used for looping with index and value from one array.

arr is an array with set of values
i - index
value - data at particular index


        var arr = NSMutableArray()
        for (i,value) in arr.enumerated(){
            print("index value =",i)
            print("data value =",value)

        }

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift