title: have a UINavigationBar title for each page in PageViewController
body: <p>I have set up my pageViewController (embedded in a NavigationController) with an array of ViewControllers to use as the pages (seen below): </p>
  
  <pre><code>`
  class PageViewController: UIPageViewController {
  
      var arrayIndex: Int = 0
      var navigationBar = UINavigationBar()
      var pageControl = UIPageControl.self
  
  
  
  
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          dataSource = self
  
  
  
          if let firstViewController = orderedViewControllers.first {
              setViewControllers([firstViewController],
                                 direction: .Forward,
                                 animated: true,
                                 completion: nil)
          }
  
  
  
  
      }
  
  
      // set up &amp; order all view controllers
  
      private(set) lazy var orderedViewControllers: [UIViewController] = {
          return [self.newDayViewController("monday"),
                  self.newDayViewController("tuesday"),
                  self.newDayViewController("wednesday"),
                  self.newDayViewController("thursday")//,
                  self.newDayViewController("friday"),
                  self.newDayViewController("saturday"),
                  self.newDayViewController("sunday")
          ]
  
  
      }()
  
  
  
  
  
  
      // instantiate view controllers above that contain 'day' (easiest method to differentiate from other controllers)
  
      private func newDayViewController(day: String) -&gt; UIViewController {
          return UIStoryboard(name: "Main", bundle: nil) .
              instantiateViewControllerWithIdentifier("\(day)")
      }
  
  
      func pageViewController(pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) {
          if (!completed) {
              return
          }
  
           arrayIndex =  Int(pageViewController.viewControllers!.first!.view.restorationIdentifier!)!
  
  
          switch arrayIndex {
  
          case 0:
              navigationBar.topItem!.title = "Monday"
              break
  
          case 1:
              navigationBar.topItem!.title = "Tuesday"
              break
  
          case 2:
              navigationBar.topItem!.title = "Wednesday"
              break
  
          case 3:
              navigationBar.topItem!.title = "Thursday"
          default:
              navigationBar.topItem!.title = "Timetable"
  
  
          }
      }
  
  
  
  
  
  
  
  
  }
  
  
  extension PageViewController: UIPageViewControllerDataSource {
  
  
  
  
      func pageViewController(pageViewController: UIPageViewController, viewControllerBeforeViewController viewController: UIViewController) -&gt; UIViewController? {
          guard let viewControllerIndex = orderedViewControllers.indexOf(viewController) else {
              return nil
          }
  
  
  
          let previousIndex = viewControllerIndex - 1
  
  
          guard previousIndex &gt;= 0 else {
              return orderedViewControllers.last
          }
  
          guard orderedViewControllers.count &gt; previousIndex else {
              return nil
          }
  
          return orderedViewControllers[previousIndex]
      }
  
      func pageViewController(pageViewController: UIPageViewController,
                              viewControllerAfterViewController viewController: UIViewController) -&gt; UIViewController? {
          guard let viewControllerIndex = orderedViewControllers.indexOf(viewController) else {
              return nil
          }
  
          let nextIndex = viewControllerIndex + 1
          let orderedViewControllersCount = orderedViewControllers.count
  
  
  
  
          //MARK: - determine which viewController the user is on
  
  
  
          guard orderedViewControllersCount != nextIndex else {
              return orderedViewControllers.first
          }
  
          guard orderedViewControllersCount &gt; nextIndex else {
              return nil
          }
  
          return orderedViewControllers[nextIndex]
      }
  
      func presentationCountForPageViewController(pageViewController: UIPageViewController) -&gt; Int {
          return orderedViewControllers.count
      }
  
      func presentationIndexForPageViewController(pageViewController: UIPageViewController) -&gt; Int {
          guard let firstViewController = viewControllers?.first,
              firstViewControllerIndex = orderedViewControllers.indexOf(firstViewController) else {
                  return 0
          }
  
          return firstViewControllerIndex
      }
  
  
  }
  
  `
  </code></pre>
  
  <p>I am wondering how I could have it so that when the user is swiping through the pageViews, the UINavigationBar's title changes to the title of the view they are looking at ? e.g : When the user is looking at the mondayViewController, the title is monday and they can swipe to tuesday and the title will change etc.</p>
  
  <p>Any suggestions are welcome</p>
  
  <p>Thanks!</p>