swift中TextFieldDelegate没有:
- (void)textFieldDidChange:(UITextField *)textField
需要自己来监听
textField.addTarget(self, action: #selector(self.textFieldDidChange(_:)), for: UIControlEvents.editingChanged)
@objc func textFieldDidChange(_ textfield : UITextField) {
// JJLog(textfield.text)
}
网友评论