4

How do I check if an UNDO button was pressed on an iPhone or iPad? If the user presses UNDO button, I wish to return NO for this method of searchBar delegate.

"- (BOOL)searchBar:(UISearchBar *)searchBar shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text"

One thing I tried is, I check that when I press an UNDO button, [text isEqualToString:@""] returns YES. But when I press the DELETE button on the keyboard, I guess my text would be @"" for DELETE button as well.

Is there a way to programmatically figure out which keyboard button has the user pressed?

tech_human
  • 6,592
  • 16
  • 65
  • 107
  • http://stackoverflow.com/questions/22845277/nsbigmutablestring-substringwithrange-range-0-10-out-of-bounds-string-l Check this link – Kiran P Nair Oct 04 '16 at 13:33

0 Answers0