I have a simple Dictionary which is defined like:
var dict : NSDictionary = [ 1 : \"abc\", 2 : \"cde\"]
Now I want to add an element into t
I know this might be coming very late, but it may prove useful to someone. So for appending key value pairs to dictionaries in swift, you can use updateValue(value: , forKey: ) method as follows :
var dict = [ 1 : "abc", 2 : "cde"] dict.updateValue("efg", forKey: 3) print(dict)