4

I'm trying to put a UITableView inside a UIScrollView. The scroll view is a horizontal paging setup to switch between a few pages/views.
One of those views has a table with editable cells. The problem arises when I try to swipe horizontally on the table to edit them. The scroll view captures the swipe first and pages over. I know the tableview is collecting touches because I can scroll vertically on it no problem.

As soon as I disable scrolling on the scrollview I can swipe to edit the cells in the table.

Is there anyway to get it so I can swipe on the table to edit cells but then still scroll on the view if I don't swipe on the table, or a header of the table that isn't editable?

Thanks

rmaddy
  • 314,917
  • 42
  • 532
  • 579
ndomin
  • 428
  • 4
  • 11

1 Answers1

0

You should subclass the UIScrollView and implement below method - (BOOL)touchesShouldBegin:(NSSet *)touches withEvent:(UIEvent *)event inContentView:(UIView *)view

This will make the UIScrollView to pass on touches to content view which is UITableview.

slysid
  • 5,236
  • 7
  • 36
  • 59