     }
     */
 
-    /*
-    // Override to support conditional editing of the table view.
+
+    // makes cell non-editable when user is searching
     override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool {
         // Return NO if you do not want the specified item to be editable.
+        if searchController.active {
+            return false
+        }
         return true
     }
-    */
 
     /*
     // Override to support editing the table view.

    override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        // #warning Incomplete method implementation.
        // Return the number of rows in the section.
        return restaurants.count
    }
    
    override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let cellIdentifier = "Cell"
        let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath) as CustomTableViewCell
        let restaurant = restaurants[indexPath.row]
        cell.restaurantNameLabel.text = restaurant.name
        // as of now this code displays random images. should be edited to 
        // display proper image for each restaurant

        // on the view controller in which you want the search to be presented.
        definesPresentationContext = true
        
        searchController.searchResultsUpdater = self
        searchController.dimsBackgroundDuringPresentation = false
        
        // Uncomment the following line to preserve selection between presentations
        // self.clearsSelectionOnViewWillAppear = false

