Dictionary

extension Dictionary
  • Creates new Dictionary from array of Dictionary.Elements.

    Declaration

    Swift

    public init(elements: [Element])

    Parameters

    elements

    [Dictionary.Element] array.

  • Creates new Dictionary by transforming values of passed Dictionary 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.