I'm having an issue with UITableView's
didSelectRowAtIndexPath
.
My table is setup so that when I select row it initializes a new view controller and pushes it.
The first time I tap any row in the table, the method does not get called. Once I select another row, it begins to work as normal.
I have verified this by setting a breakpoint on didSelectRowAtIndexPath
. When adding an NSLog
to the method I see that when I select the second row that finally pushes the new view controller, I see two log statements appear in the console at the same time.
Any suggestions?
SWIFT 3
If you are working with Swift 3 in a class which isn't a
UITableViewController
and you are usingUITableViewDelegate
, then you may need to use the method title:This worked for me, although I have just migrated my project to Swift 3. It's fairly new so this may be fixed later.
didSelectRowAt function was not called in my app in first or second tap... I was trying to solve the problem could not find any solution. But suddenly ı was recognise, I was using view.animation color change... Delegate method was not called while animation persist
SWIFT 3
None of the other answers worked in my case, what fixed it for me was:
tableView.delaysContentTouches = false
UITableViewCellSelectionStyleNone was set for the cell displaying that problem (ios9).
I have ended up calling
first thing in
which is not the same, but is good enough. makes me wonder what kind of table breakage ios10 brings.
Check If you have set any Gesture recognisers in your class. Removing gesture worked for me.
If you have set any UITapGestureRecognizer in your class, you can add this line in your didSelectRowAtIndexPath:
This worked for me.