I need to mutate a NSDictionary
in swift.
Hence I need to copy the elements of that NSDictionary
to a swift Dictionary
.
Something like the Objective-C equivalent of
[[NSMutableDictionary alloc] initWithDictionary:(nonnull NSDictionary *)];
I need to mutate a NSDictionary
in swift.
Hence I need to copy the elements of that NSDictionary
to a swift Dictionary
.
Something like the Objective-C equivalent of
[[NSMutableDictionary alloc] initWithDictionary:(nonnull NSDictionary *)];
A Dictionary is a struct
in swift, which is a value type.
let firstDictionary = ....
let copyOfirstDictionary = firstDictionary// This will copy the contents from first dictionary to another.