FUIOrderPickerFormCell
public class FUIOrderPickerFormCell : FUIBaseDrawingTableViewCell<FUIOrderPickerFormView>, FUIContentCopyable
FUIOrderPickerFormCell
is a UITableViewCell
subclass, which is used in the advanced sort pattern when there are multiple sort criteria involved. The component allows users to adjust priority of sort criteria and switch order direction flexibly.
## Usage Example:
let cell = tableView.dequeueReusableCell(withIdentifier: FUIOrderPickerFormCell.reuseIdentifier, for: indexPath) as! FUIOrderPickerFormCell
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 criterions
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.atLeastOneSelected = 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 for
FUIOrderPickerFormCell
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 }
-
Whether At least one sort criterion should be selected The default is true
Declaration
Swift
public var atLeastOneSelected: Bool { get set }
-
Implementation of change handler. Is invoked on changes to the
value
property.Declaration
Swift
public var onChangeHandler: ((FUISortCriterion.Change, [FUISortCriterion]) -> Void)? { get set }
-
The array of sort criterions
Declaration
Swift
public var value: [FUISortCriterion] { get set }
-
Declaration
Swift
public var isContentCopyable: Bool { get set }