I’ve set up a UITableView with a double-tap UITapGestureRecognizer. But attempts to double-tap a cell by the user just launches didSelectRowAtIndexPath twice. Are these two supposed to work together?
(i’m aware i could use a single tap gesture recognizer in place of the built-in behavior of didSelectRowAtIndexPath, but here’s the problem with that: the cell also has a button that I can’t press anymore when i add the single tap gesture recognizer. Also, I’ve seen examples on SO of users building double tap functionality into didSelectRowAtIndexPath, but isn’t that a bit too much of a hack?)
You can use a single-tap gesture recognizer in place of
didSelectRowAtIndexPath, even if there is a button in the cell. You just need to check if the touch location is inside theUIButton‘s view or not in order to handle both cases. Hope that Helps!