Suppose I have a large array of photoIds which I can use in the Photos APP requestPhoto API to fetch a photo. How can I implement the UIPageViewController
to accommodate a large array as such. Wouldn't creating a view controller for each of these photos on swiping left/right cause a degradation of performance of the App. Could anyone suggest a better approach to this? I've looked everywhere but couldn't find anything. I suppose another way to frame this question would be 'How can I implement the UIPageViewController
with a dynamic set of data instead of a static number?
For anyone else struggling with the same issue. I found this video very helpful. https://www.youtube.com/watch?v=ItdPXinQOp8?
According to this, I made an array with lazy var that pushes all the view controllers in the array. The view controller is only loaded when it is needed so that prevents any performance degradation. So it doesn't matter if you have n number of view controllers.