Detecting a change to text in UITextfield

前端 未结 7 2008
轮回少年
轮回少年 2021-02-07 02:15

I would like to be able to detect if some text is changed in a UITextField so that I can then enable a UIButton to save the changes.

7条回答
  •  日久生厌
    2021-02-07 02:46

    You can add a class member like this NSString *changeTemp,then

    changetemp = textfield;
    
    if( change temp != textfild ){
        changetemp=textfild;
        NSLog(@" text is changed"
    } else { 
        NSLog(@" text isn't changed"):
    }
    

提交回复
热议问题