Dictionary

extension Dictionary
  • Creates a new dictionary whose keys are the groupings returned by the given closure and whose values are arrays of the elements that returned each key.

    Declaration

    Swift

    public init<C: Cursor>(grouping values: C, by keyForValue: (C.Element) throws -> Key)
    throws where Value == [C.Element]