     /// The UIScrollView used to pan the application pages.
     @IBInspectable
     open let scrollView = UIScrollView()
+    
+    /// Previous scroll view content offset.
+    fileprivate var previousContentOffset: CGFloat = 0
     
     /// An Array of UIViewControllers.
     open var viewControllers: [UIViewController] {

        guard 1 < n else {
            return
        }
        
        let count = viewPoolCount < n ? viewPoolCount : n
        
        if 0 == selectedIndex {
            for i in 1..<n {

    
    fileprivate func layoutViewControllers() {
        let n = viewControllers.count
        scrollView.contentSize = CGSize(width: scrollView.width * CGFloat(n), height: scrollView.height)
        
        guard 1 < n else {
            layoutViewController(at: 0, position: 0)
            return
        }
        
        let m = viewPoolCount < n ? viewPoolCount : n
        
        if 0 == selectedIndex {
            for i in 0..<m {
                layoutViewController(at: i, position: i)
            }
        } else if n - 1 == selectedIndex {
            var q = 0
            for i in 0..<m {
                q = selectedIndex - i
                layoutViewController(at: q, position: q)
            }
        } else {
            layoutViewController(at: selectedIndex, position: selectedIndex)
            layoutViewController(at: selectedIndex - 1, position: selectedIndex - 1)
            layoutViewController(at: selectedIndex + 1, position: selectedIndex + 1)
        }
    }
    
