added "text" as a property

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-02-26 17:50:47 -06:00
parent 00a0a6542d
commit 9e91f38c52
2 changed files with 14 additions and 0 deletions

View File

@ -180,6 +180,12 @@ open class EntryFieldBase: Control, Changeable {
}
}
/// Override this to conveniently get/set the textfield(s).
open var text: String? {
get { nil }
set { fatalError("You MUST override EntryField's 'text' variable in your subclass.") }
}
open var tooltipModel: Tooltip.TooltipModel? { didSet { setNeedsUpdate() } }
open var transparentBackground: Bool = false { didSet { setNeedsUpdate() } }

View File

@ -78,6 +78,14 @@ open class InputField: EntryFieldBase, UITextFieldDelegate {
/// Representing the type of input.
open var fieldType: FieldType = .text { didSet { setNeedsUpdate() } }
/// The text of this textField.
open override var text: String? {
get { textField.text }
set {
textField.text = newValue
}
}
var _showError: Bool = false
/// Whether not to show the error.
open override var showError: Bool {