Collection

extension Collection
  • Declaration

    Swift

    public func grouped<Key>(by grouping: (Element) -> Key) -> [Key : [Element]] where Key : Hashable
  • Returns nil if collection is empty

    Declaration

    Swift

    var nilIfEmpty: Self? { get }