How to add a second UIPageViewController

青春壹個敷衍的年華 提交于 2020-01-06 08:29:15

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!