title: iOS automatically add hyphen in text field
body: <p>I'm learning iOS development and am having a hard time figuring out the various events for the controls. For a test I have a UITextField where the user is meant to input a string in the format: XXXX-XXXX-XXXX-XXXX</p>
  <p>I want to be able to check how long the text in the field is after each entry and see if it needs to have a hyphen appended to it. I've set up my IBAction function for this but when I assign it to the &quot;Value Changed&quot; event it does nothing, it works fine when I set it on the &quot;Editing Did End&quot; but that will only call when the user exits the control.</p>
  <p>Just to add, the &quot;Editing Changed&quot; event causes it to crash too. I assume this is a stack overflow or something where the setting of the text calls the event handler again.</p>
  <p>So in short, is there any way to set an event handler for each time the user enters a character in the UITextField?</p>