---
title: "textViewShouldBeginEditing(_:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitextviewdelegate/textviewshouldbeginediting(_:)"
---

# textViewShouldBeginEditing(_:)

Asks the delegate whether to begin editing in the specified text view.

## Declaration

```swift
optional func textViewShouldBeginEditing(_ textView: UITextView) -> Bool
```

## Parameters

- `textView`: The text view for which editing is about to begin.

## Return Value

Return Value true if an editing session should be initiated; otherwise, false to disallow editing.

## Discussion

Discussion When the user performs an action that would normally initiate an editing session, the text view calls this method first to see if editing should actually proceed. In most circumstances, you would simply return true from this method to allow editing to proceed. Implementation of this method by the delegate is optional. If it is not present, editing proceeds as if this method had returned true.

## See Also

### Responding to editing notifications

- [textViewDidBeginEditing(_:)](uikit/uitextviewdelegate/textviewdidbeginediting(_:).md)
- [textViewShouldEndEditing(_:)](uikit/uitextviewdelegate/textviewshouldendediting(_:).md)
- [textViewDidEndEditing(_:)](uikit/uitextviewdelegate/textviewdidendediting(_:).md)
