FUIDurationPickerCollectionViewCell
@MainActor
open class FUIDurationPickerCollectionViewCell : FUIInlineValidationDrawingCollectionViewCell<FUIDurationPickerContentView>
A UICollectionViewCell subclass, which allows a user to read or enter a value, using a duration picker.
The developer should set the following properties on the cell, in their implementation of UICollectionViewDataSource cellForRow(at:) function:
keyName: The key name of the propertyvalue: The value of the property, asTimeInterval
And an onChangeHandler:
onChangeHandler: a handler closure, which is invoked on changes to the value
Optionally, the developer may provide
minuteInterval: The minute interval to be used in the picker.isEditable: Indicates if the cell’s value may be modified. Defaults totrue.
Color configuration:
Call setTintColor(_:for:) to configure tint color for disabled, normal, selected UIControlState. Setting tintColor is equivalent to call setTintColor(color, for: UIControlState.normal).
- disabled: Color to be used when control is disabled.
- normal: Color to be used when control is enabled.
- selected: Color to be used when control is selected.
The following is an example of usage in an application UICollectionViewController:
override func viewDidLoad() {
super.viewDidLoad()
self.collectionView.register(FUIDurationPickerCollectionViewCell, forCellReuseIdentifier: FUIDurationPickerCollectionViewCell.reuseIdentifier)
// ...
}
override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: FUIDurationPickerCollectionViewCell.reuseIdentifier, for: indexPath) as! FUIDurationPickerCollectionViewCell
cell.keyName = "Duration"
cell.value = myObject.eventDuration // in seconds
// MARK: implement an onChangeHandler
cell.onChangeHandler = { newValue in
myObject.eventDuration = newValue
}
return cell
}
## Theming Supported style classes
fdlFUIDurationPickerFormCell
fdlFUIDurationPickerFormCell_keyLabel
fdlFUIDurationPickerFormCell_valueLabel
fdlFUIDurationPickerFormCell_valueLabel_selected
-
The key name of the cell.
Declaration
Swift
@MainActor public var keyName: String? { get set } -
The default cell reuse identifier.
Declaration
Swift
@MainActor public override var reuseIdentifier: String? { get } -
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 }