.package(url: "https://github.com/mesqueeb/MapSugar", from: "0.2.0")
Swift helpers to easier map things like .mapKeys, .mapKeysAndValues, .mapValuesUsingKeys
.mapKeys
letnewDictionary=["a":1,"b":2].mapKeys{ $0.uppercased()}print(newDictionary) // ["A": 1, "B": 2].mapValuesUsingKeys
letnewDictionary=["a":1,"b":2].mapValuesUsingKeys{ value, key inreturn"\(key)\(value)"}print(newDictionary) // ["a": "a1", "b": "b2"].mapKeysAndValues
letnewDictionary=["a":"x","b":"y"].mapKeysAndValues{ key, value inreturn(key.uppercased(), value.uppercased())}print(newDictionary) // ["A": "X", "B": "Y"]See the documentation for more info.