UIPageViewController - Fast Swipe = Index out of sync

Hi


I'm implementing the UIPageViewController for my TvOS app, and we are having big surprises when we swipe fast pages !
If we select a particular page, sometimes the index is wrong (index out of sync)...
Also, when you swipe very fast right to left, at the end of the swipe, it happens that the page view controller is going backward ! Switching pages backward automatically without swipping left to right ! Of course, same problem for the inverse direction.
There is definitely a problem with the index.


A project example ? The UIKitCatalog has the same problem. Possible to reproduce on real device only, not simulator.

I could swipe fast with 4 items and to reproduce the bug. If you don't reproduce it, you don't swipe fast enough.
You can also double the number of Items (4 to 8) to make it easier to reproduce.


// DataItem+ImageName.swift

        default:
            if (number > 4) {
                return "\(group.rawValue) \(number - 4) Large.jpg"
            } else {
                return "\(group.rawValue) \(number) Large.jpg"
            }
        }


Double the count :


// DataItem+SampleData.swift
              case .Lola:
                    itemCount = 8


You will see that swiping fast creates a weird behavior, but it also messing up the index.
At the moment you want to create a new view controller... If you set the index given by the page view controller to that page, the index can be wrong sometimes.


I'm triggering the play button event when we click, or play a specific page... And the page view controller is giving me the wrong view controller when I print :

[self.viewControllers firstObject]


The firstObject is supposed to be the view controller on the top of the stack right ? It's supposed to be the visible one right ?
On the web I saw different approaches to get the visible / current view controller

- get fistObject of viewControllers

- get lastObject of viewControllers

- Tracking manually the index using the callback didFinishAnimating callback.


Anyway... Any thoughts about this problem ? Please... What is the clean and safe way to get the current page view controller ?
Thanks

My App suffers from this too.

I've decided to ignore it for now, and wait for a fix in tvOS.

This is hard to ignore... If you want to display a specific view controller depending on the current page selected... You might basically display a wrong view controller for the next step.
This is a critical bug...

UIPageViewController - Fast Swipe = Index out of sync
 
 
Q