             currency = currencies[index]
         }
         let currencyCode = currency.code!
-        
+
         delegate?.didChangeCurrency(currencyCode, targetCurrency: targetCurrency)
         self.dismissViewControllerAnimated(true, completion: {})
     }
-    
+
 }
 
 // MARK: - Search
 
 extension ChangeCurrencyViewController: UISearchBarDelegate, UISearchDisplayDelegate {
-    
+
     func filterContentForSearchText(searchText: String) {
 
         var filteredContent:Array<Currency> = []
         let searchText = searchText.lowercaseString
-        
+
         for currency in currencies {
             let matchesName = currency.name!.lowercaseString.rangeOfString(searchText) != nil
             let matchesCode = currency.code!.lowercaseString.rangeOfString(searchText) != nil
-            
+
             if (matchesName || matchesCode) {
                 filteredContent += [currency]
             }
         }
-        
+
         self.searchResults = filteredContent
-        
+
     }
-    
+
     func searchDisplayController(controller: UISearchDisplayController, shouldReloadTableForSearchString searchString: String?) -> Bool {
         self.filterContentForSearchText(searchString!)
         return true
     }
-    
+
 }

        cell!.textLabel!.text = currency.name!
        cell!.detailTextLabel!.text = currency.code!
        cell!.accessoryType = UITableViewCellAccessoryType.None
        
        if currency.code! == selectedCurrency {
            cell!.accessoryType = UITableViewCellAccessoryType.Checkmark
        }
        
        return cell!
    }
    
    func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
        let index = indexPath.row
        let currency: Currency

        }
        return result as! [Currency]
    }

    func fetchRecentCurrencies() -> [Currency]{
        let fetch = NSFetchRequest(entityName: "Currency")
        let sortDescriptor = NSSortDescriptor(key: "lastSelected", ascending: true)
