---
title: "textShouldBeginEditing(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsmatrix/textshouldbeginediting(_:)"
---

# textShouldBeginEditing(_:)

Requests permission to begin editing text.

## Declaration

```swift
func textShouldBeginEditing(_ textObject: NSText) -> Bool
```

## Parameters

- `textObject`: The text object requesting permission to begin editing.

## Return Value

Return Value true if the text object should proceed to make changes. If the delegate returns false, the text object abandons the editing operation.

## Discussion

Discussion The default behavior of this method is to return the value obtained from control(_:textShouldBeginEditing:), unless the delegate doesn’t respond to that method, in which case it returns true, thereby allowing text editing to proceed. This method is invoked to let the NSTextField respond to impending changes to its text. This method’s default behavior is to send control(_:textShouldBeginEditing:) to the receiver’s delegate (passing the receiver and textObject as parameters).

## See Also

### Related Documentation

- [delegate](appkit/nsmatrix/delegate.md)

### Editing Text in Cells

- [selectText(_:)](appkit/nsmatrix/selecttext(_:).md)
- [selectText(atRow:column:)](appkit/nsmatrix/selecttext(atrow:column:).md)
- [textDidBeginEditing(_:)](appkit/nsmatrix/textdidbeginediting(_:).md)
- [textDidChange(_:)](appkit/nsmatrix/textdidchange(_:).md)
- [textShouldEndEditing(_:)](appkit/nsmatrix/textshouldendediting(_:).md)
- [textDidEndEditing(_:)](appkit/nsmatrix/textdidendediting(_:).md)
