title: Changing navigationBar's title based on position in scrollView
body: <p>I'm trying to change the navigationBar's title based on a scrollView's x position. Here's the code I have. I don't know why it's not working or if it's possible though:</p>
  
  <pre><code>if(scrollView.contentOffset.x == 0) {
              self.navigationController!.navigationBar.topItem!.title = "First"
          }
          else if(scrollView.contentOffset.x == self.view.frame.size.width) {
              self.navigationController!.navigationBar.topItem!.title = "Second"
          }
          else if(scrollView.contentOffset.x == self.view.frame.size.width*2) {
              self.navigationController!.navigationBar.topItem!.title = "Third"
          }
  </code></pre>
  
  <p>Any ideas as to what's going wrong? I put this in the <code>viewDidLoad</code> of the ViewController the scrollView is in. It's only setting the navigationBar's title as "First". Is it because I put in viewDidLoad? Do I have to put it into a new method that updates?</p>
  
  <p>I also tried putting the following code in, updating when the scrollView ended dragging. This does not change anything though:</p>
  
  <pre><code>func scrollViewDidEndDragging(scrollView: UIScrollView!, willDecelerate decelerate: Bool) {
          if(self.scrollView.contentOffset.x == 0) {
              self.navigationController!.navigationBar.topItem!.title = "First"
          }
          else if(self.scrollView.contentOffset.x == self.view.frame.size.width) {
              self.navigationController!.navigationBar.topItem!.title = "Second"
          }
          else if(self.scrollView.contentOffset.x == self.view.frame.size.width*2) {
              self.navigationController!.navigationBar.topItem!.title = "Third"
          }
      }
  </code></pre>
  
  <p><code>self.scrollView.contentOffset.x</code> keeps logging null within <code>scrollViewDidEndDragging</code>. Is there a reason why?</p>