views:

1553

answers:

2

Hi, I'm implementing swipe gestures in my customtableviewcell control and so I hvae to implement touchesBegan event. I'm able to implement the swipes, but unfortunately, because the touchesBegan gets handled in the customcell, i'm not getting a didSelectRowAtIndexPath message on the tablecontroller. If the touchesBegan method is disabled, it works.

How should this be handled? I want the touch event to bubble up the responder chain after the touchesBegan is processed. How can I do this?

Thanks.

+3  A: 

I"m sure you can see that this is happening because you are overriding a method that was previously defined on a super class. and by doing so means that the events are not being called.

have you tried calling [super touchesBegan]? that way all upstream stuff is handled. and you can override the swipe gesture.

or another option is to call the delegate when the touch is detected in your own touches method.

something like (you will probably have implementations of the other touch events as well)

-(void) touchesBegan
{
 //logic to detect tap only.
 [tablecell.delegate didSelectRowAtIndexPath:(some way to determin touched row)]
}
Bluephlame
[super touchesBegan] is likely the right way to do it.
Kailoa Kadano
Thanks, that worked.
Mugunth Kumar
no problem, which method did you use? also would appreciate the answer points
Bluephlame
A: 

Thanks, I was stuck in this.. Seriously you guys are miracles for me this time..

Sanniv