UITextField加密密文输入被清空的解决方案

UITextField加密密文输入被清空的解决方案:

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{

        textField.text = [textField.text stringByReplacingCharactersInRange:range withString:string];

        return NO;

}

你可能感兴趣的:(UITextField加密密文输入被清空的解决方案)