Asks the delegate whether the specified text should be replaced in the text view.
- iOS 2.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
The text view containing the changes.
The current selection range. If the length of the range is 0,
rangereflects the current insertion point. If the user presses the Delete key, the length of the range is 1 and an empty string object replaces that single character.
The text to insert.
true if the old text should be replaced by the new text;
false if the replacement operation should be aborted.
The text view calls this method whenever the user types a new character or deletes an existing character. Implementation of this method is optional. You can use this method to replace text before it is committed to the text view storage. For example, a spell checker might use this method to replace a misspelled word with the correct spelling.