title: How to tracking index of pageViewController when swipe too fast or swipe to left and right continuously very fast
body: <p>I have a Page View Controller in side my View Controller, which is infinite loop scroll pageViewController.</p>
  
  <p>normaly, I can tracking index of current View Controller (ContentViewController in my code) with property <code>indexController</code> for each view controller in pageViewController.</p>
  
  <pre><code>class ContentViewController: UIViewController {
  
      var indexController = 0
  
      override func viewDidLoad() {
          super.viewDidLoad()
      }
  }
  
  </code></pre>
  
  <p>and i tracking index via 2 function with 2 property <code>nextIndex</code> and <code>currentIndex</code></p>
  
  <pre><code>func pageViewController(_ pageViewController: UIPageViewController, willTransitionTo pendingViewControllers: [UIViewController]) {
          if let vc = pendingViewControllers[0] as? ContentViewController {
              nextIndex = vc.indexController
          }
      }
  
  </code></pre>
  
  <pre><code>func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) {
          let prevIndex = currentIndex
          if completed {
              currentIndex = nextIndex
          }
          else {
              nextIndex = currentIndex
          }
  
      }
  </code></pre>
  
  <p>but when i scroll to left so fast or swipe left and right continuously very fast, 2 function above does not call correctly, and currentIndex not update correctly.</p>
  
  <p>what can i do? Can i prevent swipe too fast? somebody help me to solve this problem, please!</p>