I have an object array like this:
private var _allusers = [Int:User]()
Here User is a custom class. Now, I am calling a PHP file and populating the _allusers object array the first time without any problem. However, I am running into problems IF I try to insert something at the beginning of the _allusers object array.
Generally, this is possible.
private var _intarray = [Int]()
self._intarray.insert(myObject, atIndex:0)
If I try to do the same for the object array I have then it doesn’t work.
self._allusers.insert(myObject, atIndex:0)
It gives me an error stating insert is not a function.
Can someone please help me with this? How can I insert an element at the beginning of the existing object array?
[Int:User]defines a dictionary, not an array.