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

# textShouldBeginEditing(_:)

Requests permission to begin editing a text object.

## Declaration

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

## Parameters

- `textObject`: The object to begin editing.

## Return Value

Return Value true if editing can begin; otherwise, false.

## Discussion

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

## See Also

### Implementing Delegate Methods

- [textDidBeginEditing(_:)](appkit/nstextfield/textdidbeginediting(_:).md)
- [textDidChange(_:)](appkit/nstextfield/textdidchange(_:).md)
- [textShouldEndEditing(_:)](appkit/nstextfield/textshouldendediting(_:).md)
- [textDidEndEditing(_:)](appkit/nstextfield/textdidendediting(_:).md)
