Let me create these 3 dictionaries:
var animal1 = ["name":"lion", "footCount":"4", "move":"run"]
var animal2 = ["name":"Fish", "footCount":"0", "move":"swim"]
var animal3 = ["name":"bird", "footCount":"2", "move":"fly"]
And then let me create this array:
var myArray= [[String : String]()]
and then let me append above dictionaries in to myArray
myArray.append(animal1)
myArray.append(animal2)
myArray.append(animal3)
I see 4 items if I run below code
print(myArray.count)
because the array is created with one empty item: var myArray= [[String : String]()]
So I need to use below code all the time:
myArray.removeFirst()
My question is: Is there another alternative array defination to append above dictionaries? Because I must execute above code all the time if I use this array defination:
var myArray= [[String : String]()]