The documentation for the return value of presentationIndexForPageViewController: says:
Returns the index of the selected item to be reflected in the page indicator.
However, this is vague. Will it call this method and expect the proper index as the user scrolls through the page view controller?
Furthermore, there are no guarantees as to when pageViewController:viewControllerBeforeViewController: and pageViewController:viewControllerAfterViewController:. The documentation just mentions:
[An] object [provides] view controllers to the page view controller on an as-needed basis, in response to navigation gestures.
In fact, I have seen caching happening under certain circumstances. For example, it looks like a view controller will only get deallocated if you navigate two pages forward from it. Otherwise it wants to keep it in cache in case the user goes backwards in the page view controller.
Does this then mean that I need a consistent way to know which page is currently being displayed by registering as the UIPageViewControllerDelegate
and then constantly updating this value?