FUIValuePickerCollectionViewCell
@MainActor
open class FUIValuePickerCollectionViewCell : FUIBaseDrawingCollectionViewCell<FUIValuePickerContentView>
A UICollectionViewCell subclass that allows a user to read or enter a value using a picker view.
And an onChangeHandler:
onChangeHandler: a handler closure that is invoked on changes to the value
Example of usage in an application, UICollectionViewController:
override func viewDidLoad() {
super.viewDidLoad()
self.collectionView.register(FUIValuePickerCollectionViewCell.self, forCellWithReuseIdentifier: FUIValuePickerCollectionViewCell.reuseIdentifier)
// ...
}
override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: FUIValuePickerCollectionViewCell.reuseIdentifier, for: indexPath) as! FUIValuePickerCollectionViewCell
cell.title.text = "Value Picker Title"
cell.valueOptions = ["1", "2", "3"]
cell.value = 0
cell.isTrackingLiveChanges = true
// MARK: implement onChangeHandler
cell.onChangeHandler = { [unowned cell] newValue in
cell.value = newValue
}
return cell
}
Theming
Supported TEXT class paths:
fdlFUIValuePickerCollectionViewCell_title
fdlFUIValuePickerCollectionViewCell_valueText {}
Supported TEXT properties:
font-color: Color;
font-style: UIFontTextStyle;
Supported TINTABLE class paths:
fdlFUIValuePickerCollectionViewCell_valueText {}
Supported TINTABLE properties:
font-color { -selected }: Color;
font-style { -selected }: UIFontTextStyle;
-
The array of valid options.
Declaration
Swift
@MainActor public var valueOptions: [String] { get set } -
Indicates if the value of the cell may be modified.
The default value is
true.Declaration
Swift
@MainActor public var isEditable: Bool { get set } -
Indicates whether the cell is a mandatory field.
The default value is
false.Declaration
Swift
@MainActor open var isRequired: Bool { get set } -
Indicates that the cell is a mandatory field.
The default value is
*.Declaration
Swift
@MainActor public var mandatoryIndicator: FUIText { get set }