TextField

open class TextField : ControlView

Undocumented

  • Event fired whenever the text contents of this text field are updated.

    This event is not raised if a client sets this text field’s text property directly.

    Declaration

    Swift

    @EventWithSender
    <TextField, TextFieldTextChangedEventArgs> public var textChanged: EventSource<SenderEventArgs<TextField, TextFieldTextChangedEventArgs>> { get }
  • Event fired whenever the caret for this text field changes position or selection range.

    Declaration

    Swift

    @ValueChangedEventWithSender
    <TextField, Caret> public var caretChanged: EventSource<SenderEventArgs<TextField, ValueChangedEventArgs<Caret>>> { get }
  • Event fired whenever the user presses down the Enter key while acceptsEnterKey is true.

    Declaration

    Swift

    @EventWithSender
    <TextField, Void> public var enterKey: EventSource<SenderEventArgs<TextField, Void>> { get }
  • Undocumented

    Declaration

    Swift

    open var textColor: Color { get set }
  • If true, when the enter key is pressed an EnterKey event is raised for this text field.

    Declaration

    Swift

    open var acceptsEnterKey: Bool
  • Whether to allow line breaks when pressing the enter key.

    Declaration

    Swift

    open var allowLineBreaks: Bool
  • Gets or sets a value specifying whether the string contents of this TextField are editable.

    Declaration

    Swift

    open var editable: Bool { get set }
  • Gets or sets the text of this text field.

    As keyboard input is received, this value is updated accordingly.

    Declaration

    Swift

    open var text: String { get set }
  • An optional placeholder text which is printed when the text field’s contents are empty.

    Declaration

    Swift

    open var placeholderText: String? { get set }
  • Gets or sets the horizontal text alignment for both the input text and placeholder labels

    Declaration

    Swift

    open var horizontalTextAlignment: HorizontalTextAlignment { get set }
  • Gets or sets the caret position for this text field.

    Declaration

    Swift

    open var caret: Caret { get set }
  • Undocumented

    Declaration

    Swift

    open var contentInset: UIEdgeInsets { get set }
  • Gets the current active style for this text field.

    Declaration

    Swift

    public private(set) var style: VisualStyle { get }
  • Declaration

    Swift

    open override var canBecomeFirstResponder: Bool { get }
  • Undocumented

    Declaration

    Swift

    public override init()

Events

Visual Style Settings

Mouse Handlers

Keyboard

Rendering

First responder status

Layout

  • Declaration

    Swift

    open override func performLayout()
  • Selects the entire text available on this text field

    Declaration

    Swift

    public func selectAll()
  • Clears all undo/redo history for this text field.

    Declaration

    Swift

    public func clearUndo()
  • Updates the text buffer to a specified string while recording an undo for the action.

    To the text engine, this is essentially the same as selecting all text and replacing with the given string.

    Declaration

    Swift

    public func setTextWithUndo(_ empty: String)
  • Defines the keys and modifiers to listen, based on OS-settings.

    See more

    Declaration

    Swift

    enum KeyMap
  • Specifies the presentation style for a text field.

    Used to specify separate visual styles depending on the first-responding state of the text field.

    See more

    Declaration

    Swift

    struct VisualStyle