FUIRangeSliderFormCell

The reusable UI component implemented as a UITableViewCell, 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 UITableViewDataSource cellForRow(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 is true.
  • lowerValue: The minimum value the user can select.
  • upperValue: The maximum value the user can select.
  • isRangeSelection: Determine the slider whether show one thumb or two thumbs. Default is true.
  • subtitle: the hint text.
  • interval: the minimum value of the slider as it changes. The default is 1.
  • isContinuous: whether value change events are generated any time. The default is true.

The following is an example of usage in an application UITableViewController:

override func viewDidLoad() {
    super.viewDidLoad()
    self.tableView.register(FUIRangeSliderFormCell.self, forCellReuseIdentifier: FUIRangeSliderFormCell.reuseIdentifier)
}

override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCell(withIdentifier: FUIRangeSliderFormCell.reuseIdentifier, for: indexPath) as! FUIRangeSliderFormCell

    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

    open var title: String? { get set }
  • Undocumented

    Declaration

    Swift

    open var subtitle: String? { get set }
  • Determine whether the view is editable. The default is true.

    Declaration

    Swift

    open var isEditable: Bool { get set }
  • The fixed minimum value.

    Declaration

    Swift

    open var minimumValue: Double { get set }
  • The fixed maximum value.

    Declaration

    Swift

    open var maximumValue: Double { get set }
  • The minimum value that the user has selected.

    Declaration

    Swift

    open var lowerValue: Double { get set }
  • The maximum value that the user has selected.

    Declaration

    Swift

    open var upperValue: Double { get set }
  • Determine whether the slider displays one thumb or two thumbs. The default is true (two thumbs).

    Declaration

    Swift

    open var isRangeSelection: Bool { get set }
  • Set the minimum value of the slider as it changes. The default is 1.

    Declaration

    Swift

    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

    open var isContinuous: Bool { get set }
  • Implementation of the change handle. It is invoked when the slider is slid along the track.

    Declaration

    Swift

    open var onChangeHandler: ((_ lower: Double, _ upper: Double) -> Void)? { get set }
  • Declaration

    Swift

    open override func prepareForReuse()
  • Undocumented

    Declaration

    Swift

    open override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?)