UITextField text change event

后端 未结 21 1013
南方客
南方客 2020-11-22 06:49

How can I detect any text changes in a textField? The delegate method shouldChangeCharactersInRange works for something, but it did not fulfill my need exactly.

21条回答
  •  孤街浪徒
    2020-11-22 07:32

    Here in swift version for same.

    textField.addTarget(self, action: "textFieldDidChange:", forControlEvents: UIControlEvents.EditingChanged)
    
    func textFieldDidChange(textField: UITextField) {
    
    }
    

    Thanks

提交回复
热议问题