DiffCollectionFilter

public struct DiffCollectionFilter<T> where T : Hashable

Generic struct that contains configuration for a one Bin/Section

Note

Elements of the collection should conform to Hashable It is very important to chose hash fucntion or value correctly since CollectionBin<Backstorage> will use it to identify the elements
  • Name or unique id of the sections

    Declaration

    Swift

    public let name: String
  • Rules for elements that should be in the section

    Declaration

    Swift

    public var filter: CollectionFilter<T>
  • Sorting rules for the section

    Declaration

    Swift

    public var sort: CollectionSort<T>?
  • Main constructor

    Note

    If sorting is nil, then a new element is added to the end of the CollectionBin<Backstorage>

    Declaration

    Swift

    public init(name: String,
                filter: @escaping CollectionFilter<T>,
                sort: CollectionSort<T>? = nil )

    Parameters

    name

    Unique ID of the section

    filter

    Rules for elements that should be in the section

    sort

    Sorting rules for the section