title: Scrolling Delegate in TableView
body: <p>I want to make an animation like this link:</p>
  
  <p><a href="https://www.pinterest.com/pin/420523683937443901/sent/?sender=335307272165049646&amp;invite_code=f63f81c77d28a48e6181db7df90b423a" rel="nofollow noreferrer">https://www.pinterest.com/pin/420523683937443901/sent/?sender=335307272165049646&amp;invite_code=f63f81c77d28a48e6181db7df90b423a</a></p>
  
  <p>Here is my simple screenshot:</p>
  
  <p><a href="https://i.stack.imgur.com/q9jLk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q9jLk.png" alt="enter image description here"></a></p>
  
  <p>In my case, I want when I swiping up, the blue Header View will disappear and the navigation bar will change to blue color.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
  
      @IBOutlet var tableView: UITableView!
      @IBOutlet var headerView: UIView!
  
      var dataSource: [String] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14].map {"\($0)"}
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          tableView.dataSource = self
          tableView.delegate = self
          headerView.backgroundColor = UIColor.blueColor()
      }
  
      func numberOfSectionsInTableView(tableView: UITableView) -&gt; Int {
          return 1
      }
  
      func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
          return dataSource.count
      }
  
      func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
          let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath)
          cell.textLabel!.text = dataSource[indexPath.row]
          return cell
      }
  
  }
  </code></pre>
  
  <p>I can change the views with animation like this, include: Navigation Bar, Header View of TableView, Status Bar.</p>
  
  <p>But how to check when the TableView scroll down, then the Header View will change.</p>