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
Like this:
var d = [String: [Int]]() d["k"] = [Int]() if var items = d["k"] { items.append(1) d["k"] = items }
You have to:
var
The if var line does the first three steps all in one.
if var