mindsnacks / MSPageViewController

Create UIPageViewControllers using only storyboards
MIT License
89 stars 23 forks source link

Programmatically navigating pages #2

Closed ChrisBeeson closed 10 years ago

ChrisBeeson commented 10 years ago

Hi it would be handy to have

- (UIViewController *)viewControllerAtIndex:(NSInteger)index

as a public function so we could programatically navigate pages when we override the controller.

 [self setViewControllers:@[[self viewControllerAtIndex:1]]
                   direction:UIPageViewControllerNavigationDirectionForward
                    animated:NO
                  completion:nil];

Moving to a page in such a way does however play havoc with the presentation Index for the page controller and I'm not sure on a clean solution at this time.

NachoSoto commented 10 years ago

Thank you! :) I just pushed this.

NachoSoto commented 10 years ago

Added in MSPageViewController 1.0.1 :)