UITapGestureRecognizer breaks UITableView didSelectRowAtIndexPath

I have written my own function to scroll text fields up when the keyboard shows up. In order to dismiss the keyboard by tapping away from the text field, I’ve created a UITapGestureRecognizer that takes care of resigning first responder on the text field when tapping away.

Now I’ve also created an autocomplete for the textfield that creates a UITableView just below the text field and populates it with items as the user enters text.

However, when selecting one of the entries in the auto completed table, didSelectRowAtIndexPath does not get called. Instead, it seems that the tap gesture recognizer is getting called and just resigns first responder.

I’m guessing there’s some way to tell the tap gesture recognizer to keep passing the tap message on down to the UITableView, but I can’t figure out what it is. Any help would be very appreciated.

21 Answers
21

Leave a Comment