         return scrollView.contentOffset.x.truncatingRemainder(dividingBy: scrollView.bounds.width) / scrollView.bounds.width
     }
     
-    @available(*, deprecated)
+    /// The index at which the view controller is showing.
     public var currentPageIndex: Int {
-        return leftSidePageIndex
+        let scrollToRightSide = (pagingPercent > 0.5)
+        let rightSidePageIndex = min(cachedViewControllers.endIndex, leftSidePageIndex + 1)
+        return scrollToRightSide ? rightSidePageIndex : leftSidePageIndex
     }
     
     ///  Reloads the content of the view controller.

        let offsetX = scrollView.bounds.width * CGFloat(page)
        if animated {
            stopScrolling()
            performSystemAnimation({ [weak self] in
                self?.scrollView.contentOffset = CGPoint(x: offsetX, y: 0)
                }, completion: { (finished) in
                    completion(finished)
            })
        } else {
            scrollView.contentOffset = CGPoint(x: offsetX, y: 0)
            completion(true)

            cachedViewControllers[page] = vc
        }
    }
    
    fileprivate func loadPagesIfNeeded(page: Int? = nil) {
        let loadingPage = page ?? leftSidePageIndex
