问题
I'm creating a project using UIPageViewController for the page turning effect. I'm using storyboard, which I think is great, to setup the UIPageViewController. How do I add a second UIPageViewController and hook it up? I have posted some screenshots to show what I've done so far.
回答1:
I think what you are looking to do is to implement the page view controller data source delegates:
- (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)viewController
- (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController
These two functions return the next and previous view controllers when they are requested from the page view controller.
If you make a new "Page-Based Application" project, you can follow how this done in the ModelController which is the data source for the example pageViewController.
来源:https://stackoverflow.com/questions/8171654/how-to-add-a-second-uipageviewcontroller