   }
   
   @IBAction func segmentedControlValueChanged(sender: UISegmentedControl) {
-    
+    // clear out the table view
+    gists = []
+    tableView.reloadData()
+    // then load the new list of gists
+    loadGists(nil)
   }
 }

import UIKit
import PINRemoteImage
import SafariServices

class MasterViewController: UITableViewController,
  LoginViewDelegate,

  
  func loadGists(urlToLoad: String?) {
    self.isLoading = true
    let completionHandler: (Result<[Gist], NSError>, String?) -> Void = { (result, nextPage) in
      self.isLoading = false
      self.nextPageURLString = nextPage
      
