4
votes

I've got a UIPageViewController that allows for standard horizontal swiping between a basic set of ViewControllers.

Those views' vertical length is quite long, requiring a UIScrollView to allow for vertical scrolling only. So, horizontal swipes to change the page, and vertical theoretically to scroll the page content.

Unfortunately the scrollview does not seem to scroll inside the PageViewController.

I've set the scrollView contentSize which is a value larger than the container. I've enabled the delegate to be "self", and the scrollViewDidScroll method never gets called when swiping.

Is there something about the PageViewController and it's gesture recognizers that block the ScrollView's?

2
Did you find a solution? Can you share it?Zoran Đukić
I ended up going with a different view controller layout that did not require these items with issues. So unfortunately no direct solution.Miro

2 Answers

1
votes

I had the same issue. Assume, that you are using Autolayout. If so, explicitly set size like this:

CGRect screenRect = [[UIScreen mainScreen] bounds];
[self.mainScrollView setContentSize:CGSizeMake(screenRect.size.width, 568+300)];
-1
votes

This solves your problem UIGestureRecognizerDelegate:

func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWithGestureRecognizer otherGestureRecognizer: UIGestureRecognizer) -> Bool {
    return true
}