I have an application which has a UITabBarController and Inside one of its items I have a UITableViewController and I want to add a UITapGestureRecognizer to view of UITableViewController.
Here comes my code:
- (void)viewDidLoad
{
[super viewDidLoad];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissKeyBoard:)];
[self.view addGestureRecognizer:tap];
}
- (void)dismissKeyBoard:(id)sender
{
[self.view endEditing:NO];
}
But dismissKeyBoard is never called! What should I do? and why it is not called?