I\'m using shouldChangeCharactersInRange as a way of using on-the-fly type search.
However I\'m having a problem, shouldChangeCharactersInRange get
stringByReplacingCharactersInRange
return a new string, so how about:
func textField(textField: UITextField!, shouldChangeCharactersInRange range: NSRange, replacementString string: String!) -> Bool {
if let text = textField.text as NSString? {
let txtAfterUpdate = text.replacingCharacters(in: range, with: string)
self.callMyMethod(txtAfterUpdate)
}
return true
}