Stackoverflow: Correcting the text cursor in a UITextField when replacing its text (http://stackoverflow.com/questions/22886361)