这样的事情会不适合你呢?我没有测试它,因为我不在我的Mac上.
var selectedCells = [NSIndexPath]() func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCellWithIdentifier("cell")! cell.accessoryType = selectedCells.contains(indexPath) ? .Checkmark : .None return cell } func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { let selectedCell = tableView.cellForRowAtIndexPath(indexPath) selectedCells.append(indexPath) if selectedCell?.accessoryType == .Checkmark { selectedCell?.accessoryType = .None selectedCells = selectedCells.filter {$0 != indexPath} } else { selectedCell?.accessoryType = .Checkmark } }