> On Aug 29, 2016, at 2:07 PM, Zhao Xin <owe...@gmail.com> wrote:
> 
> I don''t quite understand your question. In Swift, Dictionaries are structs. 
> You can always use `let dict2 = dict1`. 

I’m talking about a function that does for Dictionaries what map() does for 
Arrays: it transforms every key and value in the input Dictionary (through a 
caller-provided function), producing a new Dictionary.

You could use this to take a dictionary [String:String] that maps user IDs to 
product IDs, and produce a dictionary [User:Product].
Or you could invert a dictionary (swapping keys and values.)

—Jens
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to