In my project I have to use UITapGestureRecognizer in viewDidLoad, but if i use it, then the didSelectRowAtIndexpath method doesn't work.
I have also done so that "The Tap" method is called in a method and that method is called in viewDidLoad but still same problem occurs didSelectRowAtIndexpath method doesn't work.
Please tell me how to use that method in viewDidLoad so that both will work at the same time without any problems.
-(void)searchTap
{
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]
initWithTarget:self
action:@selector(dismissKeyboard)];
[self.view addGestureRecognizer:tap];
}
- (void) dismissKeyboard
{
[mySearchBar resignFirstResponder];
}
I want to call this method on viewDidLoad. but when i do [self searchTap];
the didSelectRowAtIndexpath method stops working.