Protocol

UITextViewDelegate

The UITextViewDelegate protocol defines a set of optional methods you can use to receive editing-related messages for UITextView objects. All of the methods in this protocol are optional. You can use them in situations where you might want to adjust the text being edited (such as in the case of a spell checker program) or modify the intended insertion point.

Declaration

@protocol UITextViewDelegate

Topics

Responding to Editing Notifications

textViewShouldBeginEditing:

Asks the delegate if editing should begin in the specified text view.

textViewDidBeginEditing:

Tells the delegate that editing of the specified text view has begun.

textViewShouldEndEditing:

Asks the delegate if editing should stop in the specified text view.

textViewDidEndEditing:

Tells the delegate that editing of the specified text view has ended.

Responding to Text Changes

textView:shouldChangeTextInRange:replacementText:

Asks the delegate whether the specified text should be replaced in the text view.

textViewDidChange:

Tells the delegate that the text or attributes in the specified text view were changed by the user.

Responding to Selection Changes

textViewDidChangeSelection:

Tells the delegate that the text selection changed in the specified text view.

Interacting with Text Data

textView:shouldInteractWithTextAttachment:inRange:interaction:

Asks the delegate if the specified text view should allow the specified type of user interaction with the provided text attachment in the given range of text.

textView:shouldInteractWithTextAttachment:inRange:

Asks the delegate if the specified text view should allow user interaction with the provided text attachment in the given range of text.

Deprecated
textView:shouldInteractWithURL:inRange:interaction:

Asks the delegate if the specified text view should allow the specified type of user interaction with the given URL in the given range of text.

textView:shouldInteractWithURL:inRange:

Asks the delegate if the specified text view should allow user interaction with the given URL in the given range of text.

Deprecated

Constants

UITextItemInteraction

Constants that indicate the type of interaction the user expects to have with a URL or text attachment.

Relationships

See Also

Responding to Text View Changes

delegate

The receiver’s delegate.