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

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

    
    public func setViewControllers<T>(_ viewControllers: Array<T>, animated: Bool) where T: UIViewController, T: TabNavigationReadable {
        // FIXME:Imp the function.
    }
    
    public func setSelectedViewController(_ viewController: UIViewController, animated: Bool) {
        if let index = _rootViewControllersInfo.viewControllers.index(of: viewController) {
            setSelectedViewController(at: index, animated: animated)
        }
    }
    
    public func setSelectedViewController(at index: Array<UIViewController>.Index, animated: Bool) {
        _setSelectedViewController(at: index, updateNavigationItems: true, animated: animated)
    }
    
    public func addViewController<T>(_ viewController: T) where T: UIViewController, T: TabNavigationReadable {
