美文网首页
监听UITextField 文本变化,退格等

监听UITextField 文本变化,退格等

作者: no1ever | 来源:发表于2021-06-09 12:01 被阅读0次
    #pragma mark - UITextFieldDelegate
    - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
       
        NSMutableString *text = [NSMutableString stringWithString:textField.text];
        [text replaceCharactersInRange:range withString:string];
        NSLog(@"shouldChangeCharactersInRange: %@", text);
        
        return YES;
    }
    

    相关文章

      网友评论

          本文标题:监听UITextField 文本变化,退格等

          本文链接:https://www.haomeiwen.com/subject/raheeltx.html