     }
 }
 
+
+// MARK: Cell creation & event handling
+
 extension ToDoListWindowController: NSTableViewDelegate {
 
     func tableView(tableView: NSTableView, viewForTableColumn tableColumn: NSTableColumn?, row: Int) -> NSView? {
 
-        return dataSource.toDoCellView(tableView: tableView, row: row, owner: self)
+        guard let cellView = dataSource.toDoCellView(tableView: tableView, row: row, owner: self)
+            else { return nil }
+
+        cellView.toDoItemChangeDelegate = self
+
+        return cellView
     }
 }
+
+extension ToDoListWindowController: ToDoItemChangeDelegate {
+
+    func toDoItem(identifier identifier: String, didChangeChecked checked: Bool) {
+
+        guard let toDoID = ToDoID(identifier: identifier)
+            else { preconditionFailure("Invalid To-Do item identifier \(identifier).") }
+
+        let action: ToDoAction = {
+            switch checked {
+            case true:  return ToDoAction.check(toDoID)
+            case false: return ToDoAction.uncheck(toDoID)
+            }
+        }()
+
+        dispatchAction(action)
+    }
+}

        return self
    }
}

class ToDoListWindowController: NSWindowController {


        dispatchAction(RenameToDoListAction(renameTo: newName))
    }

    private func dispatchAction(action: Action) {

        store?.dispatch(action)
    }
