     
     // MARK: PageboyViewControllerDelegate
     
+    private var isScrollingAnimated: Bool = false
+    
     open func pageboyViewController(_ pageboyViewController: PageboyViewController,
                                       willScrollToPageAtIndex index: Int,
                                       direction: PageboyViewController.NavigationDirection,

    /// Called after any layout changes.
    private func reloadBarWithCurrentPosition() {
        guard let currentPosition = self.currentPosition else { return }
        
        let position = self.navigationOrientation == .horizontal ? currentPosition.x : currentPosition.y
        updateBar(withPosition: position, direction: .neutral)

                                      didScrollToPageAtIndex index: Int,
                                      direction: PageboyViewController.NavigationDirection,
                                      animated: Bool) {
        isScrollingAnimated = false
        self.updateBar(withPosition: CGFloat(index),
                       direction: direction)
    }
