Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where does UIPageViewController cache the previous and next controllers?

When UIPageViewController calls the datasource with the viewControllerBeforeViewController and viewControllerAfterViewController methods, it is obtaining the view controller that will be displayed when the user swipes again. Is there a writable property in which it keeps this data until it needs to use it? The reason I ask is that I want the user to be able to swipe to go forward or backward, or simply tap to advance to the next slide. However, if I tap to advance from the first slide to the second (advancing using the setViewControllers method), I cannot swipe backwards; there is no back controller to go back to. This affects only the second slide. So I need to be able to set the previous controller programmatically.

Any help would be greatly appreciated.

Thanks.

like image 863
Casey Perkins Avatar asked Aug 27 '13 02:08

Casey Perkins


2 Answers

I had the similar issue and discovered, that UIPageViewController store its cached View Controller pages in the childViewControllers array.

like image 80
kelin Avatar answered Sep 28 '22 04:09

kelin


I had the similar issue and discovered, that UIPageViewController store its cached View Controller pages in the childViewControllers array.

like image 8
kelin Avatar answered Nov 09 '22 22:11

kelin