         }
         
         // Create a new View Controller and pass suitable data.
-        guard let wrappedViewController = dataSource.viewControllerAtIndex(index) else {
+        guard let viewController = dataSource.viewControllerAtIndex(index) else {
             return nil
         }
-        
-        let viewController = PageViewWrapper()
-        viewController.wrappedViewController = wrappedViewController
-        viewController.pageIndex = index
+
+        viewController.view.tag = index
         return viewController
     }
     

        pageControl?.currentPage = 0
    }
    
    fileprivate func getViewControllerAtIndex(_ index: Int) -> PageViewWrapper? {
        if (getNumberOfPages() == 0
            || index >= getNumberOfPages())
        {

    
    // MARK: - UIPageViewControllerDataSource
    open func pageViewController(_ pageViewController: UIPageViewController, viewControllerBefore viewController: UIViewController) -> UIViewController? {
        var index = viewController.view.tag
        if (index == 0) || (index == NSNotFound) { return nil }
        index -= 1
        return getViewControllerAtIndex(index)
    }
    
    open func pageViewController(_ pageViewController: UIPageViewController, viewControllerAfter viewController: UIViewController) -> UIViewController? {
        var index = viewController.view.tag
        if index == NSNotFound { return nil }
        index += 1
        if (index == getNumberOfPages()) { return nil }
        return getViewControllerAtIndex(index)
    }
    
    // MARK: - UIPageViewControllerDelegate
    open func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) {
        if completed {
            if let pageVC = pageViewController.viewControllers!.last as? UIViewController {
                if let delegate = delegate {
                    delegate.onPageSelected(pageVC, index: pageVC.view.tag)
                }
                // Save currentIndex
                currentIndex = pageVC.view.tag
                pageControl?.currentPage = currentIndex
            }
        }
    }
}
