             stack.saveAndWait()
             dataSourceProvider?.performFetch()
         }
+
     }
     
 }
+
+
+extension UITableView {
+
+    func deselectAllRows() {
+        if let indexPaths = indexPathsForSelectedRows() as? [NSIndexPath] {
+            for i in indexPaths {
+                deselectRowAtIndexPath(i, animated: true)
+            }
+        }
+    }
+
+}


    @IBOutlet weak var tableView: UITableView!

    let stack = CoreDataStack()

    var dataSourceProvider: TableViewFetchedResultsDataSourceProvider<Thing, TableViewCellFactory<TableViewCell, Thing> >?

    var delegateProvider: TableViewFetchedResultsDelegateProvider<Thing, TableViewCellFactory<TableViewCell, Thing> >?

    override func viewDidLoad() {
        super.viewDidLoad()



    @IBAction func didTapDeleteButton(sender: UIBarButtonItem) {
        if let indexPaths = tableView.indexPathsForSelectedRows() as? [NSIndexPath] {

            println("Deleting things at indexPaths: \(indexPaths)")
