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

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift