Contents

control(_:textShouldEndEditing:)

Invoked when the insertion point tries to leave a cell of the control that has been edited.

Declaration

@MainActor optional func control(_ control: NSControl, textShouldEndEditing fieldEditor: NSText) -> Bool

Parameters

  • control:

    The control for which editing is about to end.

  • fieldEditor:

    The field editor of the control. You can use this parameter to get the edited text.

Return Value

true if the insertion point should be allowed to end the editing session; otherwise, false.

Discussion

This message is sent only by controls that allow editing of text (such as a text field or a form field). This message is sent by the control directly to its delegate object.

See Also

Responding to Text Editing