How to get the text of a textfield after every tap on a keyboard (Swift iOS) -


i have textfield opens keyboard, need somehow letter user types after every tap of keyboard, live update.

i think best way of doing using kind of function check text of textfield, i'm not sure.

any appreciated. thanks!

first set delegate of textfield, use following code

func textfield(textfield: uitextfield,     shouldchangecharactersinrange range: nsrange,     replacementstring string: string) -> bool {  let newstring = (textfield.text nsstring).stringbyreplacingcharactersinrange(range, withstring: string) } 

Comments