📅  最后修改于: 2022-03-11 15:04:45.159000             🧑  作者: Mango
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
if (textField.text.length == 1 && [string isEqualToString:@""]) {//When detect backspace when have one character.
textField.text = @"myText";
}
return YES;
}