SequenceType

protocol SequenceType
  • Groups a sequence by applying a closure to each element

    Parameter

    Parameter closure: The closure to apply to each element

    Returns

    Dictionary grouping the original input but the closure return value

    Declaration

    Swift

    public func group<U : Hashable>(@noescape closure: Generator.Element-> U) -> [U:[Generator.Element]]

    Parameters

    closure

    The closure to apply to each element

    Return Value

    Dictionary grouping the original input but the closure return value