Hi all,
I'm tearing my hair out trying to get my own custom horizontal swipe gestures to work on a UITableViewCell.
Normally, the swipe gesture invokes the delete button method but I have switched that off because I want a swipe to mean a different method.
I have set up the swipe gesture and it can work, but the UIScrollView (which UITableView inherits) is intercepting the touch events. I have subclassed both the table view itself and the table view cell but the cell only receives touch events (using touchesBegan and touchesMoved methods) when the table view has its scrollEnabled property set to NO. However, this obviously means that then the table view does not scroll.
I know that UIScrollView (which UITableView inherits) does some nasty things to the responder chain, but there must be a way of tracking gestures and still allowing scrolling to be enabled. It must be possible because the application Tweetie uses its own fully functioning custom swipe gestures on table view cells.
So the problem I have is that I've got the choice of either my swipe gestures working on cells but no table view scrolling OR table view scrolling but no swipe gestures!!! I need both, which is obviously possible, but I'm not sure what to do to get it working.
The same behaviour happens whether I implement the swipe code in the custom table view subclass or in the custom table view cell subclass. I think the delaysContentScrolling property has part of what I'm looking for but it appears not to do what it says on the tin.
UIScrollView itself has two methods that sound promising (the touchesBegan:withEvent:inContentView and touchesCancelled: ) but again I can't find a combination that gives me what I want.
If anyone knows how to implement custom swiping gestures in a UITableViewCell, I'd much appreciate any help as to where I may be going wrong.
Many thanks,
John
I'm tearing my hair out trying to get my own custom horizontal swipe gestures to work on a UITableViewCell.
Normally, the swipe gesture invokes the delete button method but I have switched that off because I want a swipe to mean a different method.
I have set up the swipe gesture and it can work, but the UIScrollView (which UITableView inherits) is intercepting the touch events. I have subclassed both the table view itself and the table view cell but the cell only receives touch events (using touchesBegan and touchesMoved methods) when the table view has its scrollEnabled property set to NO. However, this obviously means that then the table view does not scroll.
I know that UIScrollView (which UITableView inherits) does some nasty things to the responder chain, but there must be a way of tracking gestures and still allowing scrolling to be enabled. It must be possible because the application Tweetie uses its own fully functioning custom swipe gestures on table view cells.
So the problem I have is that I've got the choice of either my swipe gestures working on cells but no table view scrolling OR table view scrolling but no swipe gestures!!! I need both, which is obviously possible, but I'm not sure what to do to get it working.
The same behaviour happens whether I implement the swipe code in the custom table view subclass or in the custom table view cell subclass. I think the delaysContentScrolling property has part of what I'm looking for but it appears not to do what it says on the tin.
UIScrollView itself has two methods that sound promising (the touchesBegan:withEvent:inContentView and touchesCancelled: ) but again I can't find a combination that gives me what I want.
If anyone knows how to implement custom swiping gestures in a UITableViewCell, I'd much appreciate any help as to where I may be going wrong.
Many thanks,
John