I have a UITableView with some UITableViewCells that contain labels with suggestions for text to be inserted into a UITextView. I want that when the user taps on some uitableviewcell with text suggestion, this text will enter the uitextview, but I also want that the user will be able to edit the uitextview by himself.
All was working fine until I wanted to add the ability to tap on the background after start editing the textview, with this resulting in hiding the keyboard (resignFirstResponder). But when I implemented backgroundTap, the calls to didSelectRowAtIndexPath ceased to happen.
How can I solve this, so that when the user taps on some uitableviewcell, the call will be to didSelectRowAtIndexPath instead of to backgroundTap?
My implementation of backgroundTap is:
-(void)backgroundTap:(UITapGestureRecognizer *)tapGR{
//...some code here...
}
In the viewWillAppear I added the line:
[self.view addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(backgroundTap:)]];
Thanks.