FUIOrderPickerCollectionViewCell
public class FUIOrderPickerCollectionViewCell : FUIBaseDrawingCollectionViewCell<FUIOrderPickerFormView>, FUIContentCopyable, FUITableAndCollectionCellUpdate
FUIOrderPickerCollectionViewCell
is a UICollectionViewCell
subclass that is used in the advanced sort pattern when there are multiple sort criteria involved. The component allows users to adjust the priority of sort criteria and flexibly switch order direction.
## Usage Example:
let cell = collectionView.dequeueReusableCell(withIdentifier: FUIOrderPickerCollectionViewCell.reuseIdentifier, for: indexPath) as! FUIOrderPickerCollectionViewCell
cell.value = [
FUISortCriterion(criterion: FUIMultiLineText("Priority"),
isSelected: true,
isAscending: false,
ascendingText: FUIMultiLineText("Lowest first"),
descendingText: FUIMultiLineText("Highest first")),
FUISortCriterion(criterion: FUIMultiLineText("Name"),
isSelected: false,
isAscending: true,
ascendingText: FUIMultiLineText("Ascending"),
descendingText: FUIMultiLineText("Descending"))
]
cell.onChangeHandler = { [unowned self] change, newValue in
// change contains the info about immediate change to sort criterions
// newValue contains the latest array of sort criterions
}
return cell
// more customization options
// change the title
cell.title = FUIText("Order by", font: UIFont.preferredFioriFont(forTextStyle: .largeTitle), textColor: UIColor.preferredFioriColor(forStyle: .negativeLabel))
// change the selected icon for all sort criteria
let config = UIImage.SymbolConfiguration(font: UIFont.preferredFioriFont(forTextStyle: .body))
let icon = UIImage(systemName: "checkmark.circle", withConfiguration: config)
cell.selectedIcon = icon
// change the appearance of labels in sort criterion with font, textColor and numberOfLines in FUIMultiLineText
FUIMultiLineText("Priority", font: UIFont.preferredFioriFont(forTextStyle: .body), textColor: UIColor.purple)
// other options
cell.isAtLeastOneSelected = false
cell.isContentCopyable = false
## Theming
Supported TEXT
class paths:
fdlFUIOrderPickerFormCell_title
fdlFUIOrderPickerFormItemCell_title {}
fdlFUIOrderPickerFormItemCell_subtitle {}
Supported TEXT
properties:
font-color: Color;
font-style: UIFontTextStyle;
Supported IMAGE
class paths:
fdlFUIOrderPickerFormItemCell_leadingImageView {}
Supported IMAGE
properties:
image-name: UIImage;
font-style: UIFontTextStyle;
tint-color: UIColor;
See Theming support in FUIOrderPickerFormView
and FUIOrderPickerFormItemView
.
-
The
reuseIdentifier
forFUIOrderPickerFormCell
.Declaration
Swift
public override class var reuseIdentifier: String { get }
-
The title for FUIOrderPickerFormCell
The default text is “Sort by”, color is .primaryLabel; font-style: .headline semibold
Declaration
Swift
public var title: FUIText? { get set }
-
The icon for selected criterion
The default icon is SF symbol: .checkmark; color: .tint; font-style: .body
Declaration
Swift
public var selectedIcon: UIImage? { get set }
-
Determines whether at least one sort criterion should be selected.
The default is
true
.Declaration
Swift
public var isAtLeastOneSelected: Bool { get set }
-
Determines whether at least one sort criterion should be selected.
The default is
true
.Declaration
Swift
@available(*, deprecated, message: "Please use isAtLeastOneSelected instead") public var atLeastOneSelected: Bool { get set }
-
Implementation of the change handler. This is invoked on changes to the
value
property.Declaration
Swift
public var onChangeHandler: ((FUISortCriterion.Change, [FUISortCriterion]) -> Void)? { get set }
-
The array of sort criteria.
Declaration
Swift
public var value: [FUISortCriterion] { get set }
-
Declaration
Swift
public var isContentCopyable: Bool { get set }