I'm looking for a reliable way to keep track of UIPageViewController current index.
The problem is well known; Although viewControllers are being presented properly, it hard to keep track of the current index.
I thought it will be good to refresh this topic across SO community since it remains unsolved for some reason
I've browsed through many threads here, but most answers are outdated or marked as unreliable(The result depends on if user did a full swipe or just half swiped etc)
I've visited this thread, but it doesn't provide any explicitly correct answer.
I've tried:
1) Keeping track of viewController's view tag - link - always returns 0
2) Looking at index variable in both UIPageViewController methods, viewControllerBeforeViewController
and viewControllerAfterViewControlle
its results is unpredictable, sometimes it skips over one index etc.
Have anybody come up with a good way, reliable way to keep track of UIPageCiewController index to make use of it(for example print current index)?
I'd appreciate both obj-c and swift implementation, but swift is the one I'm looking for.