OrderPickerItemModel

public struct OrderPickerItemModel : Identifiable, Hashable, Equatable, CustomStringConvertible

The OrderPickerItemModel struct is a data model that represents a Order Picker item . It conforms to the Identifiable, Hashable, Equatable and CustomStringConvertible protocols, which allow it to be used in collections and compared for equality.

  • id

    A unique identifier for each OrderPickerItemModel instance, generated using UUID()

    Declaration

    Swift

    public var id: UUID
  • An optional Image that represents a icon of the order picker item when it was selected.

    Declaration

    Swift

    public var selectedIcon: Image?
  • A String representing the criterion of the order picker item.

    Declaration

    Swift

    public var criterion: AttributedString
  • A boolean value that determines the selected state of the criterion.

    Declaration

    Swift

    public var isSelected: Bool
  • A boolean value that determines the order direction of the criterion.

    Declaration

    Swift

    public var isAscending: Bool
  • The text displayed when the criterion is ascending, such as “Ascending”.

    Declaration

    Swift

    public var ascendingText: AttributedString
  • The text displayed when the criterion is descending, such as “Descending”.

    Declaration

    Swift

    public var descendingText: AttributedString
  • An optional customStyle

    Declaration

    Swift

    public var customStyle: (any SortCriterionStyle)?
  • An optional color that determines the background color of the custom list row.

    Declaration

    Swift

    public var customListRowBackground: Color?
  • Public initializer for OrderPickerItemModel.

    Declaration

    Swift

    public init(id: UUID = UUID(), selectedIcon: Image? = nil, criterion: AttributedString, isSelected: Bool = false, isAscending: Bool = true, ascendingText: AttributedString, descendingText: AttributedString, customStyle: (any SortCriterionStyle)? = nil, customListRowBackground: Color? = nil)

    Parameters

    selectedIcon

    An optional Image that represents a icon of the order picker item when it was selected.

    criterion

    A String representing the criterion of the order picker item.

    isSelected

    A boolean value that determines the selected state of the criterion.

    isAscending

    A boolean value that determines the order direction of the criterion.

    ascendingText

    The text displayed when the criterion is ascending, such as “Ascending”.

    descendingText

    The text displayed when the criterion is descending, such as “Descending”

    customStyle

    An optional customStyle

    customListRowBackground

    An optional color that determines the background color of the custom list row.

  • Declaration

    Swift

    public var description: String { get }
  • Immediate change for a criterion

    See more

    Declaration

    Swift

    public enum Change : CustomStringConvertible
  • A method that allows the OrderPickerItemModel instances to be used in hash-based collections. It combines the id and criterion properties to generate a hash value.

    Declaration

    Swift

    public func hash(into hasher: inout Hasher)
  • An equality operator method that compares two OrderPickerItemModel instances based on their id, isSelected‘ and isAscending properties.

    Declaration

    Swift

    public static func == (lhs: OrderPickerItemModel, rhs: OrderPickerItemModel) -> Bool