Dictionary

struct Dictionary<Key : Hashable, Value> : CollectionType, DictionaryLiteralConvertible
  • Convenience method to assign all values in source to self.

    Declaration

    Swift

    public mutating func assignValuesFrom<S: SequenceType where S.Generator.Element == (Key,Value)>(source: S)
  • Convenience creator to create a dictionary from an array of key-value tuples. This is useful for creating a dictionary from the result of performing map(_:) on a dictionary.

    Declaration

    Swift

    public init<S: SequenceType where S.Generator.Element == (Key,Value)>(_ sequence: S)
  • Creates a new dictionary by transforming only the values in self.

    Declaration

    Swift

    public func mapValues<NewValue>(transform: Value -> NewValue) -> [Key:NewValue]
  • Declaration

    Swift

    public func valuesArray() -> [Value]

    Return Value

    An array of only the values in self.