Here’s my code:
UITapGestureRecognizer *gestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(resignTextView)];
[self.tableview addGestureRecognizer:gestureRecognizer];
-(void)resignTextView
{
[textView resignFirstResponder];
}
I added tableview with UITapGetureRecognizer. I do not know why it is not working?
please add
where
numberOfTapsRequiredis an int and than try. (be default it is 1, you can try it with 2 to check)and since you are using UITableView I am not sure what type of hierarchy you are dealing with… you can have a look at this answer to understand how this works..
UITapGestureRecognizer breaks UITableView didSelectRowAtIndexPath