实时输出TextField中内容

要想实时输出TextField中内容,要找到textField内容发现改变就会调用的函数,即

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
    return YES;
}

输出实时的内容需要我们组合下,代码如下:

[textField.text stringByReplacingCharactersInRange:range withString:string];
此文章为个人笔记,方便自己以及有需要的朋友查看,转载请注明出处!
原文地址:https://www.cnblogs.com/shpyoucan/p/5497835.html