     
     // 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)

        self.insetChildViewControllerIfNeeded(self.viewControllers?[index])
        
        if animated {
            isScrollingAnimated = true
            UIView.animate(withDuration: 0.3, animations: {
                self.activeTabmanBar?.updatePosition(CGFloat(index), direction: direction)
                self.activeTabmanBar?.layoutIfNeeded()
