         });
     }
     
+    
     override func didReceiveMemoryWarning() {
         super.didReceiveMemoryWarning()
-        // Dispose of any resources that can be recreated.
     }
-
+    
+    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject!) {
+        if (segue.identifier == "menu_details_segue") {
+            var menuController = segue.destinationViewController as! MenuViewController;
+            menuController.restaurant = self.selectedRetaurant
+            menuController.list = self.menuList
+        }
+        
+    }
+    
+    override func viewWillAppear(animated: Bool) {
+        self.navigationItem.title = "Hungrilla"
+    }
     
     func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        if self.searchActive {
-            return self.filtered.count
-        }
         return self.list.count
     }
     
     func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
         var cell:UITableViewCell = self.tableView.dequeueReusableCellWithIdentifier(cellIdentifier) as! UITableViewCell
-        let item: Restaurant;
-        
-        if self.searchActive {
-            item = self.filtered[indexPath.row] as Restaurant
-        }
-        else {
-            item = self.list[indexPath.row] as Restaurant
-        }
-        
+        let item: Restaurant = self.list[indexPath.row] as Restaurant
         cell.textLabel?.text = item.getName()
         cell.detailTextLabel?.text = item.getType()
         cell.accessoryType = UITableViewCellAccessoryType.DisclosureIndicator

    }
    
    func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
        println("You selected cell #\(indexPath.row)!")
    }
    
    func searchBarTextDidBeginEditing(searchBar: UISearchBar) {
        searchActive = true
    }
    
    func searchBarTextDidEndEditing(searchBar: UISearchBar) {
        searchActive = false
    }
    
    func searchBarCancelButtonClicked(searchBar: UISearchBar) {
        searchActive = false
    }
    
    func searchBarSearchButtonClicked(searchBar: UISearchBar) {
        searchActive = false
    }
    
    func searchBar(searchBar: UISearchBar, textDidChange searchText: String) {
        
        filtered = self.filterRestaurants(searchText)
        
        if(filtered.count == 0){
            searchActive = false;
        } else {
            searchActive = true;
        }
        self.tableView.reloadData()
    }

}

import UIKit
import Alamofire;

class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource{

    @IBOutlet weak var tableView: UITableView!
    
    // Cell Identifier
    let cellIdentifier = "TableCell"
    
    // Empty `Restaurant` Array
    var list:[Restaurant] = []
    
    weak var selectedRetaurant: Restaurant!
    var menuList:[Menu] = []
    
    // `viewDidLoad` function override.
    // Set `tableView` height. Registers its class.
    // Initiates a request to fetch restaurants from API.
    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.backgroundColor = Utils.UIColorFromRGB(0xC1272D)
        self.view.tintColor = Utils.UIColorFromRGB(0xFFFFFF)
        
        self.tableView.delegate = self
        self.tableView.dataSource = self
        
        self.tableView.rowHeight = UITableViewAutomaticDimension
        self.tableView.registerClass(TableCell.self, forCellReuseIdentifier: cellIdentifier)
        self.getTopRestaurants()
