I have a TableView with TextFields in each cell and I want to those textfields
ignore the character tab (\\t).
When the tab key is pressed, the t
Implement this method:
Add this in your AppDelegate.m
- (NSArray *)keyCommands {
static NSArray *commands;
static dispatch_once_t once;
dispatch_once(&once, ^{
UIKeyCommand *const forward = [UIKeyCommand keyCommandWithInput:@"\t" modifierFlags:0 action:@selector(ignore)];
UIKeyCommand *const backward = [UIKeyCommand keyCommandWithInput:@"\t" modifierFlags:UIKeyModifierShift action:@selector(ignore)];
commands = @[forward, backward];
});
return commands;
}
Add this method in the ViewController.m or subclass of UITextField in which you want to handle the TAB key event
- (void)ignore {
NSLog(@"Your Action");
}
Described in: How do you set the tab order in iOS?