Returns a new dictionary containing the keys of this dictionary with the values transformed by the given closure.
SDK
- Xcode 10.0+
Framework
- Swift Standard Library
Declaration
Parameters
transform
A closure that transforms a value.
transform
accepts each value of the dictionary as its parameter and returns a transformed value of the same or of a different type.
Return Value
A dictionary containing the keys and transformed values of this dictionary.
Discussion
Complexity: O(n), where n is the length of the dictionary.