I have a UIPageViewController with several pages. Each page is the same view controller, but the page number is kept track of and the correct page of a PDF is shown. The problem is that each PDF page needs to be loaded and drawn before the curl effect works (you slide your finger across the screen and nothing happens until loaded). Any ideas on how to speed this up or preload the next page? Thanks for your help.
I have a UIPageViewController with several pages. Each page is the same view controller,
Share
I have a similar problem in the app I am using now. My solution was to keep a reference to the loaded previous and next controllers as properties of my root view controller, and then just load the view from there. I don’t use PageViewController because the client insisted it had to look like FlipBoard…so I also cache the resulting GLTexture. It should work similarly though, just store the next and previous page when the current one loads, and pass that controller in your “loadNextPage” or whatever method.
EDIT: Here is a sample (that I’ve simplified) from my project
First Load (NH is a prefix for my program, so you will need to substitute your own classes):
Subsequent loads (page flip):
Initialize Pages:
This way, you will always have the neighbor pages ready. Then instead of instantiating them in the method that retrieves the next or previous page in UIPageViewController, simply pass self.nextController, or self.prevController.