     private func _setViewControllersWithoutUpdatingNavigationItems(_ viewControllers: [UIViewController]) {
         
     }
+    
+    fileprivate func _setSelectedViewController(at index: Array<UIViewController>.Index, updateNavigationItems: Bool, animated: Bool) {
+        guard index >= _rootViewControllersInfo.viewControllers.startIndex && index < _rootViewControllersInfo.viewControllers.endIndex else {
+            return
+        }
+        
+        let viewController = _rootViewControllersInfo.viewControllers[index]
+        guard viewController !== _selectedViewController else {
+            return
+        }
+        
+        if let selectedViewController = _selectedViewController {
+            selectedViewController.beginAppearanceTransition(false, animated: animated)
+            selectedViewController.endAppearanceTransition()
+        }
+        _selectedViewController = viewController
+        _selectedViewController!.beginAppearanceTransition(true, animated: animated)
+        if updateNavigationItems {
+            tabNavigationBar.setNavigationItems(_selectedViewController!.tabNavigationItems, animated: true)
+        }
+        _selectedViewController!.endAppearanceTransition()
+        _rootViewControllersInfo.selectedIndex = index
+    }
 }
 
 extension TabNavigationController {

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

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