I have a view controller with this hierarchy:
View Controller:
This will make your scroll simultaneously with UITableView
and UIScrollView
and apply @Stephen Johnson's block
- (BOOL)gestureRecognizer:(UIPanGestureRecognizer *)gestureRecognizer
shouldRecognizeSimultaneouslyWithGestureRecognizer:(UISwipeGestureRecognizer *)otherGestureRecognizer
{
return YES;
}
If the tableview is contained within the scroll view I believe you can set up the scroll view's gesture recognizers to respond only if the table view's gesture recognizers fail. I haven't had a chance to try this, but you should be able to set up a dependency between the gestures for each of the views.
UITableView* tableView = ...;
UIScrollView* scrollView = ...;
for (UIGestureRecognizer* r in scrollView.gestureRecognizers)
{
for (UIGestureRecognizer* tableRecognizer in tableView.gestureRecognizers)
{
[r requireGestureRecognizerToFail:tableRecognizer];
}
}