textShouldEndEditing(_:)
Requests permission to end editing.
Declaration
func textShouldEndEditing(_ textObject: NSText) -> BoolParameters
- textObject:
The text object requesting permission to end editing.
Return Value
true if the text object should proceed to finish editing and resign first responder status. If the delegate returns false, the text object selects all of its text and remains the first responder.
Discussion
The NSMatrix method returns false if the text field contains invalid contents; otherwise it returns the value passed back from control(_:textShouldEndEditing:).
This method is invoked to let the NSTextField respond to impending loss of first-responder status. This method’s default behavior checks the text field for validity; providing that the field contents are deemed valid, and providing that the delegate responds, control(_:textShouldEndEditing:) is sent to the receiver’s delegate (passing the receiver and textObject as parameters).