嘿我试着基本上能够将新索引放在字典中的第一个或最后一个。
到目前为止我能够模拟的东西 代码:
// no success
var updatedList = [String: AnyObject]()
updatedList.updateValue(child as AnyObject, forKey: "0")
or
updatedList[child]
to simply get child in array, I'm trying to figure out how to put it last or first in the dictionary
答案 0 :(得分:2)
您无法使用Dictionary
执行此操作,因为它没有排序条件,只有您可以为密钥添加元素,这种方式只能在Array