grouped(by:transform:)
Creates a grouping of rows that the method selects by choosing unique values the transform closure creates with elements of a column you select by column identifier.
Declaration
func grouped<InputKey, GroupingKey>(by columnID: ColumnID<InputKey>, transform: (InputKey?) -> GroupingKey?) -> RowGrouping<GroupingKey> where GroupingKey : HashableParameters
- columnID:
A column identifier.
- transform:
A closure that transforms a column’s elements into a hashable type.
Return Value
A collection of groups.
Discussion
Create groupings that group rows by:
Telephone area codes
The first letter of a person’s last name
A date’s year or quarter
Number ranges