Page View Controller pages stuck in the middle during fast tap on PageControl

I have a PageViewController with PageControl. if I tap on pageControl too fast, sometimes it happens that, two pages are being shown as half.
That is, One page is being shown as a small portion and the other page is being shown as rest of the portion.
This issue happens only when I tap on pageControl too fast.

How to resolve this issue?
Please note that, in iPhone application menu/Home screen, they also used PageViewController. But during fast tap of pageControl, they somehow slowed down the swiping of pages .
Could you post the code of the pageViewController ?

There could be a delegate func in which to insert a very short (0.2 s) pause, like this func:
Code Block
    func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) { }

But I would need to see the code to confirm.
even in iPhone home screen, if you tap on page control super fast, then it will show you the app list slowly. I think they manage it internally.
I have used that function but nothing have changed :(
Could you show how you used didFinishAnimating ?

If not working, try this other delegate func
Code Block
optional func pageViewController(_ pageViewController: UIPageViewController, willTransitionTo pendingViewControllers: [UIViewController])

put a print inside to check it is effectively called.

Don' forget to declare conformance to UIPageViewControllerDelegate.

Note: that seems to work only with the gestures, not the tap on dots.
have a look here to see how to intercept taps (and possibly delay).
https://stackoverflow.com/questions/55405731/tap-on-pagecontrol-to-scroll-to-another-view-tap-on-the-dots
or this:
https://stackoverflow.com/questions/13854222/how-can-i-change-the-page-on-clicking-the-dots-of-uipagecontrol

pageControl is defined as:
    var pageControl = UIPageControl()
And you connect an action to it.
Page View Controller pages stuck in the middle during fast tap on PageControl
 
 
Q