2

I have a situation - a UIPageViewController that has scrolling direction vertical. All of its pages are the same height as itself. And then inside each page I have a UIScrollView that also has scrolling in vertical direction. The point of such an architecture is because i have news with some text between which i want to be able to switch with paging effect, but the news text can be bigger than the screen.

Now i got it all working good with one tiny issue. When you scroll the scrollView to the bottom it bounces (if you turn bouncing on) or just stops (if you turn bouncing off). And only after you lift your finger (stop the touches) you are able to switch to the next page in UIPageViewController.

What i would like to see is when you scroll to the bottom of the UIScrollView it automatically starts scrolling the UIPageViewController without you having to lift up your finger. I expected that to be the natural behaviour. But its not in ios6 only in 7.

https://www.dropbox.com/s/noua5jo5trv5kn1/iOS%20Simulator%20Screen%20shot%20Sep%2029%2C%202013%207.08.03%20PM.png https://www.dropbox.com/s/m0965bff5h4eq21/iOS%20Simulator%20Screen%20shot%20Sep%2029%2C%202013%207.08.11%20PM.png

Pavel Gurov
  • 5,587
  • 3
  • 26
  • 23

1 Answers1

0

implement UIScrollViewDelegate imside your UIViewConroller something like

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
   if (scrollView.contentOffset.y == scrollView.contentSize.height) {
      if (self.nextPageNeededHandler) {
         self.nextPageNeedeHandler();
      }
   }
}

and block in your .h file

@property (nonatomic, copy) void (^nextPageNeedeHandler)(void);

set property like

...

__weak MyPageViewController *self_ = self;
nextPageVC.nextPageNeedeHandler = ^{
[self_ goNextPage];
};

...

iiFreeman
  • 5,165
  • 2
  • 29
  • 42
  • This would give me a chance to immediately switch to the next page after scrolling a little out of the content size. What i need is to be able to drag to the next page, just like the regular UIPageViewController behaviour. – Pavel Gurov Sep 29 '13 at 16:19