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
OrderPickerItemModel
instance, generated usingUUID()
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?
-
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
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 moreDeclaration
Swift
public enum Change : CustomStringConvertible
-
An equality operator method that compares two
OrderPickerItemModel
instances based on theirid
,isSelected
‘ andisAscending
properties.Declaration
Swift
public static func == (lhs: OrderPickerItemModel, rhs: OrderPickerItemModel) -> Bool