Dictionary
extension Dictionary
-
Creates new
Dictionary
from array ofDictionary.Element
s.Declaration
Swift
public init(elements: [Element])
Parameters
elements
[Dictionary.Element]
array. -
Creates new
Dictionary
by transforming values of passedDictionary
with given closure.Declaration
Swift
public init<OriginalKey, OriginalValue>(original: [OriginalKey : OriginalValue], transformation: (OriginalKey, OriginalValue) -> (Element)) where OriginalKey : Hashable
Parameters
original
[OriginalKey: OriginalValue]
dictionary to transform.transformation
closure mapping original
Dictionary.Element
into new one.