How to copy a “Dictionary” in Swift?
A ‘Dictionary’ is actually a Struct in swift, which is a value type. So copying it is as easy as: let myDictionary = … let copyOfMyDictionary = myDictionary To copy an object (which is a reference type) has a couple of different answers. If the object adopts the NSCopying protocol, then you can just do: … Read more