FUITitleFormCell
@MainActor
open class FUITitleFormCell : FUIInlineValidationUIControlTintTableViewCell, FUIFormCell, UITextFieldDelegate, FUIStateReadOnly
The reusable UI component implemented as an UITableViewCell to allow user to enter a value, using a UITextField.

The developer should set the following properties on the cell, in their implementation of UITableViewDataSource cellForRow(at:) function:
value: The value of the property, asString
And an onChangeHandler:
onChangeHandler: a handler closure, which is invoked on changes to the value
Optionally, the developer may provide:
isEditable: Indicates if the cell’s value may be modified. Defaults totrue.
Color settings:
Setting tintColor for valueTextField for a state using setTintColor(_:for:) api. Currently disabled and normal are supported.
cell.setTintColor(UIColor.red, for: .normal)
Remark
Thefont-color attribute will be overridden by tint-color-disabled attribute when cell is switched to disabled state. DO NOT set textColor for valueTextField when cell is in disabled state!
The following is an example of usage in an application UITableViewController:
override func viewDidLoad() {
super.viewDidLoad()
self.tableView.register(FUITitleFormCell.self, forCellReuseIdentifier: FUITitleFormCell.reuseIdentifier)
// ...
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: FUITitleFormCell.reuseIdentifier, for: indexPath) as! FUITitleFormCell
cell.value = myObject.title
cell.isEditable = true
// MARK: implement onChangeHandler
cell.onChangeHandler = { newValue in
myObject.title = newValue
}
return cell
}
## Theming
Supported TableViewCell class paths:
fdlFUITitleFormCell {}
Supported TableViewCell attributes:
background-color (Color)
background-color-disabled (Color)
background-color-readonly (Color)
Supported TextField class paths:
fdlFUITitleFormCell_valueTextField
Supported TextField properties:
font-color: Color;
font-color-disabled: Color;
font-color-readonly: Color;
placeholder-color: Color;
font-style: UIFontTextStyle;
font-style-disabled: UIFontTextStyle;
font-style-readonly: UIFontTextStyle;
-
Declaration
Swift
public typealias TintState = UIControl.State -
The default cell reuse identifier.
Declaration
Swift
@MainActor open class var reuseIdentifier: String { get } -
The value type for the FUITitleFormCell is String
Declaration
Swift
public typealias ValueType = String -
The value for FUITitleFormCell is the text of the Title.
Declaration
Swift
@IBInspectable @MainActor public var value: String { get set } -
Implementation of change handler. Is invoked on changes to the
valueproperty.Declaration
Swift
@MainActor public var onChangeHandler: ((String) -> Void)? -
Indicates if this title is editable or not. The default is true.
Declaration
Swift
@MainActor public var isEditable: Bool { get set } -
isEnabledandisEditableare in sync.Declaration
Swift
@MainActor override public var isEnabled: Bool { get set } -
The UITextField to hold the title string.
Declaration
Swift
@IBOutlet @MainActor public private(set) weak var valueTextField: FUITextField! { get } -
This is the maximum length of the title text, if maxTitleTextLength is greater than 0. If the text length reaches this limit, the user cannot enter more text. Note: If the user pastes a string and the length plus the current text length is greater than the limit, the insert is rejected. Partial strings are not accepted in the text field. The default value for maxTitleTextLength is 0, which means no limit.
Declaration
Swift
@MainActor public var maxTitleTextLength: Int -
The type of the keyboard being used when the cell is in input mode.
Declaration
Swift
@MainActor public var keyboardType: UIKeyboardType { get set } -
If
isTrackingLiveChanges == true, thendidChangeValuefunction ofonChangeHandler, will be invoked for every letter entered.Otherwise,
onChangeHandlerwill be invoked only after user taps “Done” key, or the field resigns first responder.Declaration
Swift
@MainActor public var isTrackingLiveChanges: Bool { get set } -
The placeholder text for the title text field.
Declaration
Swift
@IBInspectable @MainActor public var placeholderText: String? { get set } -
Indicates if the cell is read-only or not.
The default is
false.Declaration
Swift
@MainActor open var isReadOnly: Bool { get set } -
Declaration
Swift
@MainActor open override func systemLayoutSizeFitting(_ targetSize: CGSize, withHorizontalFittingPriority horizontalFittingPriority: UILayoutPriority, verticalFittingPriority: UILayoutPriority) -> CGSize -
Declaration
Swift
@MainActor open override func layoutSubviews()