I was wondering what is the best way to detect a double tap on a UITableViewCell?At the moment I added a UITapGestureRecognizer for the double tap gesture and added it to the UITableView. I found that it never got called because the default method didSelectRowAtIndexPath method always had priority so I added a UITapGestureRecognizer for a single tap. I found this still didn't work because the default didSelectRowAtIndexPath method still had priority over my gesture recognizer. In the end I set singleTap.cancelsTouchesInView and singleTap.delaysTouchesBegan to YES. This did the trick and I now have both single and double tap gestures on my UITableView (I then use UITableView's indexPathForRowAtPoint method to detect which row has been tapped).Is this right? Is there a better way? All I'm after is for a single tap on a cell to retain it's default action of segueing to another view but when double tapped a the segue doesn't happen and a custom method is called.Thanks for any help/advise you can provide. :)
--
You received this message because you are subscribed to the Google Groups "Australian Cocoaheads" group.
To post to this group, send email to cocoah...@googlegroups.com.
To unsubscribe from this group, send email to cocoaheadsau...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cocoaheadsau?hl=en.
I was wondering what is the best way to detect a double tap on a UITableViewCell?At the moment I added a UITapGestureRecognizer for the double tap gesture and added it to the UITableView. I found that it never got called because the default method didSelectRowAtIndexPath method always had priority so I added a UITapGestureRecognizer for a single tap. I found this still didn't work because the default didSelectRowAtIndexPath method still had priority over my gesture recognizer. In the end I set singleTap.cancelsTouchesInView and singleTap.delaysTouchesBegan to YES. This did the trick and I now have both single and double tap gestures on my UITableView (I then use UITableView's indexPathForRowAtPoint method to detect which row has been tapped).Is this right? Is there a better way? All I'm after is for a single tap on a cell to retain it's default action of segueing to another view but when double tapped a the segue doesn't happen and a custom method is called.Thanks for any help/advise you can provide. :)
--
You received this message because you are subscribed to the Google Groups "Australian Cocoaheads" group.
To view this discussion on the web visit https://groups.google.com/d/msg/cocoaheadsau/-/xhfLqWLGgn0J.
I was wondering what is the best way to detect a double tap on a UITableViewCell?At the moment I added a UITapGestureRecognizer for the double tap gesture and added it to the UITableView. I found that it never got called because the default method didSelectRowAtIndexPath method always had priority so I added a UITapGestureRecognizer for a single tap. I found this still didn't work because the default didSelectRowAtIndexPath method still had priority over my gesture recognizer. In the end I set singleTap.cancelsTouchesInView and singleTap.delaysTouchesBegan to YES. This did the trick and I now have both single and double tap gestures on my UITableView (I then use UITableView's indexPathForRowAtPoint method to detect which row has been tapped).Is this right? Is there a better way? All I'm after is for a single tap on a cell to retain it's default action of segueing to another view but when double tapped a the segue doesn't happen and a custom method is called.Thanks for any help/advise you can provide. :)