Let\'s assume I have a dictionary that accepts a string as the key and an array as value:
var d = [String: [Int]]() d[\"k\"] = [Int]()
Now I wo
Because Dictionary and Array are both struct types, you can't modify the Array in place, but instead have to extract and restore it:
if var items = d["k"] { items.append(1) d["k"] = items } else { d["k"] = [1] }