Check out example codes for "swift remove tableview cell". It will help you in understanding the concepts better.

Code Example 1

func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
  if editingStyle == .delete {
    print("Deleted")

    self.catNames.remove(at: indexPath.row)
    self.tableView.deleteRows(at: [indexPath], with: .automatic)
  }
}

Learn ReactJs, React Native from akashmittal.com