 import CoreData
 import JSQCoreDataKit
 
-class TasksViewController: UITableViewController, NSFetchedResultsControllerDelegate {
+class TasksViewController: UITableViewController, NSFetchedResultsControllerDelegate, UITabBarControllerDelegate {
     
     var coreDataStack: CoreDataStack?
     

    override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
        self.performSegueWithIdentifier("TasksToEditTask", sender: self.fetchedResultsController.fetchedObjects![indexPath.row])
    }

    @IBAction func addButtonPressed(sender: AnyObject) {
        self.performSegueWithIdentifier("TasksToNewTask", sender: nil)
    }
    
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {

    }()
    
    func controllerDidChangeContent(controller: NSFetchedResultsController) {
//        self.tableView.reloadSections(NSIndexSet(index: 0), withRowAnimation: .Fade) // Need to experiment with this
        self.tableView.reloadData()
    }

