Group Group Group Group Group Group Group Group Group

Checklists - moving and item to a different Checklist

I thought it would be great to have a Done Items Checklist - So managed to create that in DataModel.swift
Then I’d like to the Delete action in the Checklist screen so it moves the item to the Done Items Checklist which has an index of 1.

I’ve worked out that the remove element can be put in a variable element!

override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) {
    var element = checklist.items.remove(at: indexPath.row)
   
   
    let indexPaths = [indexPath]
    
    tableView.deleteRows(at: indexPaths, with: .automatic)
  }

But how do I insert element into Checklist 1 - can’t work it out!