Asks the delegate if the specified text should be changed.
- iOS 2.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
The text field containing the text.
The range of characters to be replaced.
The replacement string for the specified range. During typing, this parameter normally contains only the single new character that was typed, but it may contain more characters if the user is pasting text. When the user deletes one or more characters, the replacement string is empty.
YES if the specified text range should be replaced; otherwise,
NO to keep the old text.
The text field calls this method whenever user actions cause its text to change. Use this method to validate text as it is typed by the user. For example, you could use this method to prevent the user from entering anything but numerical values.