HoloTableViewDiffPlugin 1.0.0

HoloTableViewDiffPlugin 1.0.0

gonghonglou维护。



 
依赖
HoloTableView>= 0
DeepDiff>= 0
 

  • 作者:
  • gonghonglou

HoloTableViewDiffPlugin

CI Status Version License Platform

示例

要运行示例项目,克隆仓库,然后首先从示例目录中运行pod install

用途

HoloTableViewDiffPlugin是一个用于HoloTableView框架的插件,它为DeepDiff提供了差异重载动作支持。

要使用它,只需确保您使用了DeepDiff并导入此插件。

用法

let tableView = UITableView.init(frame: self.view.bounds, style: .plain)
self.view.addSubview(tableView)

tableView.holo_makeRows { (make) in
    for item in [Int]() {
        _ = make.row(TableViewCell.self).model(item).diffId(item)
    }
}
tableView.reloadData()

// diff reload
tableView.stored()

tableView.holo_removeAllSections()
tableView.holo_makeRows { (make) in
    for item in [Int]() {
        _ = make.row(TableViewCell.self).model(item).diffId(item)
    }
}

tableView.reload()

如果tableView已经被重新加载,然后你想进行差异重新加载,你需要在运行tableView.holo_makeRows{}之前执行tableView.stored()

安装

HoloTableViewDiffPlugin 通过 CocoaPods 提供。要安装,只需将以下行添加到您的 Podfile 中:

pod 'HoloTableViewDiffPlugin'

作者

gonghonglou, [email protected]

许可证

HoloTableViewDiffPlugin 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。