Contents

textShouldEndEditing(_:)

Performs validation on the text field’s new value.

Declaration

func textShouldEndEditing(_ textObject: NSText) -> Bool

Parameters

  • textObject:

    The text object that requests permission to end editing.

Return Value

true if the new value is valid; otherwise, false.

Discussion

This method validates the text field’s new value using the NSCell method isEntryAcceptable:. If the new value is valid and the delegate responds to control(_:textShouldEndEditing:), this method invokes that method and returns the result. If the delegate returns false, the system beeps to indicate that the text field can’t validate the text. See NSControl for more information about the text delegate method.

See Also

Implementing Delegate Methods