OrderedDictionary: insert object at the beginning?

Is there a way to insert object at the beginning to the OrderedDictionary, other than:

// We want to inser asset at the position 0:
orderedDict.reverse()
orderedDict[identifier] = asset
orderedDict.reverse()

I could put this question broader: is it possible to insert at the specific index?

The function updateValue has an index parameter.

orderedDict.updateValue(asset, forKey: identifier, insertingAt: newIndex)
4 Likes