             return _rootViewControllersInfo.viewControllers[_rootViewControllersInfo.selectedIndex]
         }()
     }
+    fileprivate weak var _selectedViewController: UIViewController?
     
     private weak var _trailingConstraintOfLastViewController: NSLayoutConstraint?
     

        guard index >= _rootViewControllersInfo.viewControllers.startIndex && index < _rootViewControllersInfo.viewControllers.endIndex else {
            return
        }
        _rootViewControllersInfo.selectedIndex = index
        let _selectedViewController = _rootViewControllersInfo.viewControllers[index]
        
        _contentScrollView.scrollRectToVisible(_selectedViewController.view.frame, animated: true)
        
        _selectedViewController.beginAppearanceTransition(true, animated: true)
        tabNavigationBar.setNavigationItems(_selectedViewController.tabNavigationItems, animated: true)
        _selectedViewController.endAppearanceTransition()
    }
    
    func tabNavigationBarDidTouchNavigatiomBackItem(_ tabNavigationBar: TabNavigationBar) {

// MARK: - UIScrollViewDelegate.

extension TabNavigationController: UIScrollViewDelegate {
    func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
        print("begin dragging: \(scrollView.isDecelerating)")
    }
    func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
        guard _viewControllersStack.isEmpty else {
            return
        }
        _commitTransitionNavigationItemViews(at: Int(scrollView.contentOffset.x / scrollView.bounds.width))
    }
    
    func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer<CGPoint>) {
        let selectedIndex = Int(targetContentOffset[0].x / scrollView.bounds.width)
        _setSelectedViewController(at: selectedIndex, updateNavigationItems: false, animated: true)
    }
    
    func scrollViewDidScroll(_ scrollView: UIScrollView) {
