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.
-
A unique identifier for each
OrderPickerItemModelinstance, generated usingUUID()Declaration
Swift
public var id: UUID -
An optional
Imagethat represents a icon of the order picker item when it was selected.Declaration
Swift
public var selectedIcon: Image? -
A
Stringrepresenting 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
customStyleDeclaration
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? -
init(id:selectedIcon: criterion: isSelected: isAscending: ascendingText: descendingText: customStyle: customListRowBackground: ) 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
selectedIconAn optional
Imagethat represents a icon of the order picker item when it was selected.criterionA
Stringrepresenting the criterion of the order picker item.isSelectedA boolean value that determines the selected state of the criterion.
isAscendingA boolean value that determines the order direction of the criterion.
ascendingTextThe text displayed when the criterion is ascending, such as “Ascending”.
descendingTextThe text displayed when the criterion is descending, such as “Descending”
customStyleAn optional
customStylecustomListRowBackgroundAn 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 moreDeclaration
Swift
public enum Change : CustomStringConvertible -
An equality operator method that compares two
OrderPickerItemModelinstances based on theirid,isSelected‘ andisAscendingproperties.Declaration
Swift
public static func == (lhs: OrderPickerItemModel, rhs: OrderPickerItemModel) -> Bool