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
Swift 3+
Example to assign new values to Dictionary. You need to declare it as NSMutableDictionary:
var myDictionary: NSMutableDictionary = [:] let newValue = 1 myDictionary["newKey"] = newValue print(myDictionary)