     ///   - page: A index defining an content of the content view controller.
     ///   - animated: true if the scrolling should be animated, false if it should be immediate.
     public func scroll(to page: Int, animated: Bool) {
-        let pagingState = PagingState(beginIndex: leftSidePageIndex, endIndex: page)
+        delegate?.contentViewController(viewController: self, willBeginPagingAt: leftSidePageIndex, animated: animated)
         
         loadPagesIfNeeded(page: page)
         leftSidePageIndex = page
         
-        delegate?.contentViewController(viewController: self, willHide: pagingState.beginIndex, animated: animated)
-        delegate?.contentViewController(viewController: self, willShow: pagingState.endIndex, animated: animated)
+        delegate?.contentViewController(viewController: self, willFinishPagingAt: leftSidePageIndex, animated: animated)
         scroll(to: page, animated: animated) { [weak self] (finished) in
             guard let _self = self, finished else { return }
-            _self.delegate?.contentViewController(viewController: _self, didHide: pagingState.beginIndex, animated: animated)
-            _self.delegate?.contentViewController(viewController: _self, didShow: pagingState.endIndex, animated: animated)
+            _self.delegate?.contentViewController(viewController: _self, didFinishPagingAt: _self.leftSidePageIndex, animated: animated)
         }
     }
     

    public func contentViewController(viewController: PagingContentViewController, didManualScrollOn index: Int, percent: CGFloat) {}
    public func contentViewController(viewController: PagingContentViewController, didEndManualScrollOn index: Int) {}

    public func contentViewController(viewController: PagingContentViewController, willShow index: Int, animated: Bool) {}
    public func contentViewController(viewController: PagingContentViewController, didShow index: Int, animated: Bool) {}
    public func contentViewController(viewController: PagingContentViewController, willHide index: Int, animated: Bool) {}
    public func contentViewController(viewController: PagingContentViewController, didHide index: Int, animated: Bool) {}
}

/// The data source provides the paging content view controller object with the information it needs to construct and modify the contents.

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