Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/106.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios UIPageViewController:显示和缓存PDF页面_Ios_Performance_Pdf_Uiview_Uipageviewcontroller - Fatal编程技术网

Ios UIPageViewController:显示和缓存PDF页面

Ios UIPageViewController:显示和缓存PDF页面,ios,performance,pdf,uiview,uipageviewcontroller,Ios,Performance,Pdf,Uiview,Uipageviewcontroller,我正在使用苹果的“基于页面的应用程序”Xcode模板和 我通过drawRect将每个PDF页面呈现到它自己的PDFPageView中,然后将其作为子视图添加到每个页面的DataViewController中 这是可行的,但由于页面渲染需要一些时间,因此会延迟页面翻转动画,因此我想知道如何预渲染和缓存页面 到目前为止,我将在页面呈现后将DataViewController放入可变字典。随后为该索引调用viewControllerAtIndex的速度确实更快,但如果我继续浏览较长(52页,11MB)

我正在使用苹果的“基于页面的应用程序”Xcode模板和

我通过drawRect将每个PDF页面呈现到它自己的PDFPageView中,然后将其作为子视图添加到每个页面的DataViewController中

这是可行的,但由于页面渲染需要一些时间,因此会延迟页面翻转动画,因此我想知道如何预渲染和缓存页面

到目前为止,我将在页面呈现后将DataViewController放入可变字典。随后为该索引调用viewControllerAtIndex的速度确实更快,但如果我继续浏览较长(52页,11MB)PDF文件中的页面,直到最后一页,然后再往回浏览,10页之后事情会再次变慢,尽管字典中已经存在DataViewController

这是正确的方法,还是应该缓存渲染的PDFPageView

当我想提前预渲染时,我应该使用dispatch_async进行渲染,并将预渲染的PDFPageView或DataViewController放入字典中吗


还是我应该使用完全不同的方法?谢谢

或者在UIImage中渲染并存储,如中所述?我还没有开始考虑缩放,但我想使用UIImages(?)进行缩放会更加困难