使用核心数据将重新排序单元格保存在UITableViewController中

我正在寻找一种简单的实现,可以将{Core}中的重排序单元格保存在UITableViewController中。

现在我正在使用默认功能对单元格进行重新排序:

var timers: [Timers] = []

    override func tableView(_ tableView: UITableView,moveRowAt sourceIndexPath: IndexPath,to destinationIndexPath: IndexPath) {

    let movedObject = timers[sourceIndexPath.row]
    timers.remove(at: sourceIndexPath.row)
    timers.insert(movedObject,at: destinationIndexPath.row)


    }

如何实现用于保存单元格订购功能的核心数据?

wangtao_451674711 回答:使用核心数据将重新排序单元格保存在UITableViewController中

您需要在deinit内的每个vc中重新保存该数组。

本文链接:https://www.f2er.com/3123175.html

大家都在问