     }
 
     private func setupDefaultNavigationBars(pageTitles: [String]) {
-        guard navigationBarShouldNotExist == false else {
+        guard !navigationBarShouldNotExist else {
             return
         }
 
         var navBars = [UINavigationBar]()
-        for index in 0..<pageTitles.count {
-            let navigationBar = UINavigationBar(frame: CGRect(x: 0, y: 0, width: Constants.ScreenWidth, height: Constants.navigationBarHeight))
-            navigationBar.barStyle = UIBarStyle.Default
+        pageTitles.forEach { title in
+            let navigationBarSize = CGSize(width: Constants.ScreenWidth, height: Constants.navigationBarHeight)
+            let navigationBar = UINavigationBar(frame: CGRect(origin: CGPoint.zero, size: navigationBarSize))
+            navigationBar.barStyle = .Default
             navigationBar.barTintColor = Constants.lightGrayColor
 
-            let navigationItem = UINavigationItem(title: pageTitles[index])
+            let navigationItem = UINavigationItem(title: title)
             navigationItem.hidesBackButton = true
             navigationItem.leftBarButtonItem = nil
             navigationItem.rightBarButtonItem = nil

        }
        currentStackVC = stackPageVC[stackPageVC.indexOf(pageViewController.viewControllers!.first!)!]
    }

}


        currentStackVC = stackPageVC[currentIndex + 1]
        pageViewController.setViewControllers([currentStackVC], direction: UIPageViewControllerNavigationDirection.Forward, animated: true, completion: nil)
    }
}

extension EZSwipeController: UIPageViewControllerDataSource {
