首页 > 代码库 > UITextField监听事件

UITextField监听事件

UITextField监听事件

by 伍雪颖


- (void)awakeFromNib {
    [_textField addTarget:self action:@selector(textFieldEditChanged:) forControlEvents:UIControlEventEditingChanged];
}

- (void)textFieldEditChanged:(UITextField *)textField {
    if (_blockValueChanged) {
        _blockValueChanged(textField,[textField text]);
    }
}