Reputation: 41
Listen to the text box, enter the contents of the case, there is content input within the 2S does not deal with, after the 2S no content input, exit the edit request interface
Upvotes: 2
Views: 57
Reputation: 50109
not writing your code here -- but giveng you a detailed instruction of how to use a NSTimer ;) [note that this is just one way but IMHO it is the easiest/most intuitive]
set yourself as delegate of textfield
wait for didBegin notification and set the timer for cancel Editing to 2s there!
if endEditing is called while timer is active, cancel it
if shouldChangeCharacters is called while timer is active, cancel it
if timer wasn't cancelled and fires. tell the textfield to endEditing
Upvotes: 2