func appendAnotherDic( left: inout Dictionary, right: Dictionary) {
for (k, v) in right {
left.updateValue(v, forKey: k)
}
}
var dic1 = ["first": "1", "second": "2"]
let dic2 = ["third": "3", "forth": "4"]
appendAnotherDic(left: &dic1, right: dic2)
print(dic1)
网友评论