     let eventColor: Event.Color
     let datasource: Datasource
 
+    var canEditItemAtIndexPath: CanEditItemAtIndexPath? {
+        return { _ in true }
+    }
+
+    var commitEditActionForItemAtIndexPath: CommitEditActionForItemAtIndexPath? {
+        return { (action, indexPath) in
+            switch action {
+            case .Delete:
+                if let item = self.datasource.itemAtIndexPath(indexPath) {
+                    self.readWriteConnection.remove(item)
+                }
+            default: break
+            }
+        }
+    }
+
+    var editActionForItemAtIndexPath: EditActionForItemAtIndexPath? {
+        return { _ in .Delete }
+    }
+
+    var canMoveItemAtIndexPath: CanMoveItemAtIndexPath? {
+        return { _ in false }
+    }
+
+    var commitMoveItemAtIndexPathToIndexPath: CommitMoveItemAtIndexPathToIndexPath? {
+        return { (_, _) in }
+    }
+
     init(color: Event.Color, db: YapDatabase, view: Factory.ViewType) {
 
         var ds = YapDBDatasource(id: "\(color) events datasource", database: db, factory: Factory(), processChanges: view.processChanges, configuration: eventsWithColor(color, byColor: true) { mappings in

    }
}

class ViewController: UIViewController {

    @IBOutlet weak var tableView: UITableView!
    @IBOutlet weak var segmentedControl: UISegmentedControl!

    var segmentedDatasourceProvider: SegmentedDatasourceProvider<EventsDatasource>!
    var datasource: BasicTableViewDataSourceProvider<SegmentedDatasourceProvider<EventsDatasource>>!

    override func viewDidLoad() {
        super.viewDidLoad()

        let colors: [Event.Color] = [.Red, .Blue, .Green]
        let datasources = colors.map { EventsDatasource(color: $0, db: database, view: self.tableView) }

        wrapper = TableViewDataSource(SegmentedDatasourceProvider(id: "events segmented datasource", datasources: datasources, selectedIndex: 0) { [weak self] in
            self?.tableView.reloadData()
        })
        wrapper.provider.configureSegmentedControl(segmentedControl)
        tableView.dataSource = wrapper.tableViewDataSource
        tableView.setEditing(true, animated: false)
    }

    @IBAction func addEvent(sender: UIBarButtonItem) {
        let color = selectedDatasourceProvider.eventColor
        selectedDatasourceProvider.addEvent(Event.create(color: color))
    }

    @IBAction func refreshEvents(sender: UIBarButtonItem) {
