Search code examples
iosiphoneuitableviewuigesturerecognizerswipe

I need to detect a swipe gesture on my tableView that is within a page control, how can I do this?


Pretty straight forward, I just can't get it to work. What can I do to swipe to delete on my tableView that is within a page control?

Please help!


Solution

  • Edited to remove my original answer regarding the proper UITableViewDataSource methods.

    This sounds like a potentially complicated user interface (i.e. if users are expecting swipes to turn a page but if they mis-touch and hit the table view cell just right, they'll get the "delete" button). I'd suggest re-thinking what you are doing.

    In any event, to get to the finish line on your app might be to subclass UIPageControl, detect when swipes are happening in the content region and pass that swipe message along to the table view. I suspect you can't just do userInteractionEnabled = NO; on the page control's content view.

    F.Y.I.: you should also probably delete the identical & duplicate question you posted a number of hours before the question I'm attempting to answer ( How can I capture a sideways swipe gesture for a tableView that is inside of a pageControl? )