1

Context: I have a UIPageViewController with 4 UIViewControllers, a sort of SnapChat style.

In 3 of those 4 UIViewControllers, I have a UITableView or a UICollectionView, two controls that inherit of UIScrollView.

The problem: When I scroll (vertically) a UITableView or a UICollectionView, I cannot scroll horizontally (swipe) to the next page until the scroll is finished. Instead, when I try to swipe, the scrolling stops and then I have to do another swipe to actually change the page of the UIPageViewController.

What I expect: The user has to be able to change the page when swiping, even if the UITableView or UICollectionView is still scrolling, as SnapChat currently does.

Any tips to achieve this?

Thanks!

1 Answers1

1

I believe your issue is that your scroll view has an active gesture recognizer firing when you are scrolling, so the other gesture isn't being identified. I found this as a solution: How to have a UIScrollView scroll and have a gesture recognizer?

Community
  • 1
  • 1
sschale
  • 5,168
  • 3
  • 29
  • 36
  • Thanks. I ended up creating a subclass of UITableView and UICollectionView and adding this piece of code... `- (BOOL)gestureRecognizer:(UIPanGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UISwipeGestureRecognizer *)otherGestureRecognizer { return YES; }` ...as this answer recommends: [link](http://stackoverflow.com/a/23841224/1774983) That made the swipe of the UIPageViewController work as expected :) – Brian Sztamfater Feb 29 '16 at 19:58