Instance Method

textShouldBeginEditing(_:)

Requests permission to begin editing a text object.

Declaration

func textShouldBeginEditing(_ textObject: NSText) -> Bool

Parameters

textObject

The object to begin editing.

Return Value

true if editing should be allowed to occur, false otherwise.

Discussion

If the receiver isn’t editable, returns false immediately. If it is editable and its delegate responds to control(_:textShouldBeginEditing:), this invokes that method and returns the result. Otherwise it simply returns true to allow editing to occur. See the NSControl class specification for more information on the text delegate method.

See Also

NSText Delegate Method Implementations

func textDidBeginEditing(Notification)

Posts a notification that the text is about to begin editing to the default notification center.

func textDidChange(Notification)

Posts a notification that the text has changed and forwards this message to the receiver’s cell if it responds.

func textShouldEndEditing(NSText) -> Bool

Performs validation on the receiver’s new value.

func textDidEndEditing(Notification)

Handles an end of editing.