<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITextViewDelegate/textViewShouldBeginEditing(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UITextViewDelegate(im)textViewShouldBeginEditing:"
  },
  "title" : "textViewShouldBeginEditing(_:)"
}
-->

# textViewShouldBeginEditing(_:)

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

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

## Parameters

`textView`

The text view for which editing is about to begin.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if an editing session should be initiated; otherwise, <doc://com.apple.documentation/documentation/Swift/false> to disallow editing.

## 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 <doc://com.apple.documentation/documentation/Swift/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 <doc://com.apple.documentation/documentation/Swift/true>.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)