     
     func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
        pickerView.isHidden = true
-        
+       sort = sortByOptions[row]
+       self.viewWillAppear(true)
     }
 }
 

class RestaurantDetailViewController: UIViewController, UIPickerViewDataSource, UIPickerViewDelegate {

  // These are optional because we can't do initializer-level dependency injection with storyboards.
  private var restaurant: Restaurant!
  private var localCollection: LocalCollection<Review>!
  private var dataSource: ReviewTableViewDataSource!

  static func fromStoryboard(_ storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil),
                             restaurant: Restaurant) -> RestaurantDetailViewController {

let backgroundView = UIImageView()
let sortByOptions = ["date", "rating", "yumCount"]


  override func viewDidLoad() {
    super.viewDidLoad()

