如何循环字典数组?

时间:2016-03-29 08:17:14

标签: arrays swift loops

我的这本词典:

var proposals: [[Character: String]] = [[Character: String]]()

我如何正确循环以检索两个值?

1 个答案:

答案 0 :(得分:1)

首先遍历顶部数组以获取字典,然后遍历字典。

for subArray in proposals {
    for (key,value) in subArray {
        print("\(key) == \(value)")
    }
}