     }
 
     func em_pageViewController(_ pageViewController: EMPageViewController, didFinishScrollingFrom startingViewController: UIViewController?, destinationViewController: UIViewController, direction: EMPageViewControllerNavigationDirection, transitionSuccessful: Bool) {
-        if let currentIndex = self.currentIndex , currentIndex < self.tabItemCount {
+        if let currentIndex = self.currentIndex, currentIndex < self.tabItemCount {
             self.tabView.updateCurrentIndex(currentIndex, shouldScroll: true)
             self.beforeIndex = currentIndex
             self.delegate?.pageMenuController?(self, didScrollToPageAtIndex: currentIndex, direction: direction.toPageMenuNavigationDirection)

     Reload the view controllers in the page view controller.
     This reloads the dataSource entirely, calling viewControllers(forPageMenuViewController:)
     and defaultPageIndex(forPageMenuViewController:).
    */
    public func reloadPages() {
        self.reloadPages(reloadViewControllers: true)
    }

        }

        guard defaultIndex < self.viewControllers.count else {
            return
        }

        self.pageViewController.selectViewController(
