Ibrahim Yildirim
Ibrahim Yildirim

Reputation: 2771

DidSelectRowAtIndexPath not responding with Search Display Controller

I'have a small problem with my search display controller which i can't seem to solve.

I have a search controller that shows data in a table when i start editing the searchbar. It works fine. While in editing mode i have no problem chosen the items that appears on the list. The method DidSelectRowAtIndexPath gets fired every time i select a row (while in editing mode - and the keyboard is shown)

But when i start scrolling, and the keyboard disappears, the result list is still show (full screen) but the method DidSelectRowAtIndexPath doesn't get called when i click on a TableViewCell.

I have set all the required delegates for the search display controller to the Files Owner.

Anyone that have some suggestions for what is wrong?

Upvotes: 1

Views: 223

Answers (1)

Ibrahim Yildirim
Ibrahim Yildirim

Reputation: 2771

I found the error on my implementation.

I had a tap GestureRecognizer on the same view. The tap recognizer calls a method that closes the keyboard when the user taps the screen.

Apparently when the UISearchbar is not the firstResponder every click made in the table was registered in the taprecognizer instead of the didSelectRowForIndexPath.

Upvotes: 1

Related Questions