Test device version: iPad iOS 15.2、 iPhone iOS15.3。
set UITextFiled.selectedTextRange in -(void)textFieldDidBeginEditing: method.
When the selected text range is too long, the text will not be highlighted, but will actually be selected.
Text is highlighted when tapped, or be replaced when typing.