Sorter

public class Sorter<K, V> where K : Reflectable, K : Comparable, K : Decodable, K : Encodable, K : Hashable, K : Identifiable, V : Reflectable, V : ReflectionDecodable, V : Comparable, V : CustomStringConvertible, V : Decodable, V : Encodable

describes a Sorter with a Direction (ascending, descending), the property as a KeyPath to the later sorted variable of a class

  • specifies the direction of sorting, ascending (.asc) or descending (.desc)

    See more

    Declaration

    Swift

    public enum Direction
  • The init initializes the Sorter with the Direction of sorting and the Property that is used to sort the data.

    Declaration

    Swift

    public init(direction: Direction = .asc, property: WritableKeyPath<K, V>)