FUIRangeSliderCollectionViewCell
@MainActor
open class FUIRangeSliderCollectionViewCell : FUIInlineValidationDrawingCollectionViewCell<FUIRangeSliderContentView>
The reusable UI component implemented as a UICollectionViewCell, allowing a user to select range values from the slider, which can be controlled using a single thumb or double thumbs.
The developer should set the following properties on the cell in their implementation of the UICollectionViewDataSource cellForItem(at:) function:
title: The key name of the property.minimumValue: The minimum value of the slider.maximumValue: The maximum value of the slider.- “
And an onChangeHandler:
onChangeHandler: a handler closure, which is invoked on changes to the value.
Optionally, the developer may provide
isEditable: Indicates whether the cell’s value can be modified. The default istrue.lowerValue: The minimum value the user can select.upperValue: The maximum value the user can select.isRangeSelection: Determines whether the slider should show one thumb or two thumbs. The default istrue.subtitle: the hint text.interval: the minimum value of the slider as it changes. The default is1.isContinuous: whether value change events are generated any time. The default istrue.
The following is an example of usage in an application, UIViewController:
override func viewDidLoad() {
super.viewDidLoad()
self.collectionView.register(FUIRangeSliderCollectionViewCell.self, forCellReuseIdentifier: FUIRangeSliderCollectionViewCell.reuseIdentifier)
}
override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: FUIRangeSliderCollectionViewCell.reuseIdentifier, for: indexPath) as? FUIRangeSliderCollectionViewCell else {
return UICollectionViewCell()
}
cell.title = "Range Label"
cell.maximumValue = 50
cell.minimumValue = 10
cell.subtitle = "Hint Text"
cell.isEditable = true
cell.upperValue = 40
cell.lowerValue = 20
cell.isRangeSelection = true
// MARK: implement onChangeHandler
cell.onChangeHandler = { (lower, upper) in
// ...
}
return cell
}
## Theming
nuiClass:
fdlFUIRangeSliderFormCell {}
Supported keyView:
fdlFUIRangeSliderFormCell_keyText {
font-color { -highlighted | -disabled } (Color)
font-style { -highlighted | -disabled } (UIFont.TextStyle)
}
Supported slider:
fdlFUIRangeSliderFormCell_slider {
track-tint-color { -disabled } (Color);
track-selection-color { -disabled } (Color);
thumb-tint-color { -disabled } (Color);
}
Supported textfields:
fdlFUIRangeSliderFormCell_textFields {
font-color { -disabled } (Color)
font-style { -disabled } (UIFont.TextStyle)
border-color { -highlighted | -readonly } (Color)
}
Supported hintText:
fdlFUIRangeSliderFormCell_hintText {
font-color { -disabled } (Color)
font-style { -disabled } (UIFont.TextStyle)
}
-
Undocumented
Declaration
Swift
@MainActor open var title: String? { get set } -
Undocumented
Declaration
Swift
@MainActor open var subtitle: String? { get set } -
Determine whether the view is editable. The default is
true.Declaration
Swift
@MainActor open var isEditable: Bool { get set } -
The fixed minimum value.
Declaration
Swift
@MainActor open var minimumValue: Double { get set } -
The fixed maximum value.
Declaration
Swift
@MainActor open var maximumValue: Double { get set } -
The minimum value that the user has selected.
Declaration
Swift
@MainActor open var lowerValue: Double { get set } -
The maximum value that the user has selected.
Declaration
Swift
@MainActor open var upperValue: Double { get set } -
Determine whether the slider displays one thumb or two thumbs. The default is
true(two thumbs).Declaration
Swift
@MainActor open var isRangeSelection: Bool { get set } -
Set the minimum value of the slider as it changes. The default is
1.Declaration
Swift
@MainActor open var interval: Double { get set } -
If set, value change events are generated any time the value changes due to dragging. The default is
true.Declaration
Swift
@MainActor open var isContinuous: Bool { get set } -
Implementation of the change handle. This is invoked when the slider is slid along the track.
Declaration
Swift
@MainActor open var onChangeHandler: ((_ lower: Double, _ upper: Double) -> Void)? { get set }
-
Declaration
Swift
@MainActor open override func prepareForReuse() -
Declaration
Swift
@MainActor open override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?)