Sequence

public extension Sequence
  • Returns an array containing the results of mapping the elements to the specified KeyPath.

    Declaration

    Swift

    func map<T>(_ keyPath: KeyPath<Element, T>) -> [T]
  • Returns an array containing the non-nil results of mapping the elements of this sequence to the specified KeyPath.

    Declaration

    Swift

    func compactMap<T>(_ keyPath: KeyPath<Element, T?>) -> [T]