📜  将字典转换为数组 swift 代码示例

📅  最后修改于: 2022-03-11 15:01:01.506000             🧑  作者: Mango

代码示例1
let dic = ["1":"a", "2":"b", "3":"c"]

let arrayOfKeys = Array(dic.keys.map{ $0 })
print(arrayOfKeys) // [1, 2, 3]
let arrayOfValues = Array(dic.values.map{ $0 })
print(arrayOfValues) // [a, b, c]