open class FUIKeyValueFormCell : FUINoteFormCell, FUIPropertyFormCell

A customized UITableViewCell, which contains a UILabel and a UITextView. It takes text as input.


The developer should set the following properties on the cell, in their implementation of UITableViewDataSource cellForRow(at:) function:

  • keyName: The key name of the property.
  • placeholderText: The placeholder of the property.
  • value: The value of the property, as String.

And an onChangeHandler:

  • onChangeHandler: a handler closure, which is invoked on changes to the value.

Optionally, the developer may set

  • isAutoFitting: Indicate if the cell height will adjust based on its content text. Default value is false.
  • isTrackingLiveChanges: Indicate how onChangeHandler is invoked. If true, onChangeHandler will be invoked every time a letter is entered or deleted; if false, onChangeHandler will only be invoked when cell resigns first reponder.
  • ‘isEditable’: If the cell is editable or not. Default value is true. Date detector works only if this property is set to false.

Color setting:

Setting text color of filter buttons for a state using setTintColor(_:for:) api. Currently .disabled and .normal are supported.

cell.setTintColor(UIColor.red, for: .normal)

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


The app’s UITableViewController must subclass FUIFormTableViewController
override func viewDidLoad() {
self.tableView.register(FUIKeyValueFormCell, forCellReuseIdentifier: FUIKeyValueFormCell.reuseIdentifier)
// ...

override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

let cell = tableView.dequeueReusableCell(withIdentifier: FUIKeyValueFormCell.reuseIdentifier, for: indexPath) as! FUIKeyValueFormCell
cell.keyName = "Note"
cell.placeholderText = "Description"
cell.value = myObject.descriptionText1
cell.isAutoFitting = true
cell.isTrackingLiveChanges = true
cell.isEditable = false
cell.onChangeHandler = { newValue in
self.myObject.descriptionText1 = newValue
return cell


Supported style classes

  • The UILabel holds the key name string.



    open var keyLabel: UILabel!
  • The key name of the cell.



    open var keyName: String? { get set }