1

I have an iOS app using a UIPageViewController to display screens of info. I've got a UIScrollView that is displaying the current page your viewing as well as buttons to the previous two pages and next two pages.

So if you can follow my ASCII art, imagine you're looking at page 6, it's like:

[Page 4]  [Page 5]  [Page 6]  [Page 7]  [Page 8]
|                                              |
|                 PAGE 6 CONTENT               |
|                                              |

With some trickery, I've managed to get everything working so you can swipe the content and the UIScrollView shifts the page buttons, and also so you can tap on the page buttons and it moves the page content. The view controllers that appear as the page content when you swipe are implemented using the UIPageViewControllerDataSource methods, while the controller that appears if you tap one of the buttons appears by calling the [_pager setViewControllers:viewController direction:direction animated:YES completion:NULL] method.

My problem is that if you're on page 6, then tap the button to go to page 4, when you then swipe forwards to go the next page, it takes you back to page 6, not page 5! The - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController is not getting called again.

Is there any way to force the UIPageViewController to 'forget' what it thinks the next page is?

Mick Byrne
  • 14,394
  • 16
  • 76
  • 91
  • 1
    possible duplicate of [UIPageViewController, how do I correctly jump to a specific page without messing up the order specified by the data source?](http://stackoverflow.com/questions/13633059/uipageviewcontroller-how-do-i-correctly-jump-to-a-specific-page-without-messing) – jrturton Jan 14 '14 at 11:45

0 Answers0