To run the example project, clone the repo, and run pod install
from the Example directory first.
HoloTableViewDiffPlugin is a plugin for HoloTableView framework, which provide the diff reload actions support for DeepDiff.
To use it, simply make sure you use DeepDiff and import this plugin.
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()
If the tableView has been reload and then you want to diff reload, you need to perform tableView.stored()
before tableView.holo_makeRows{}
.
HoloTableViewDiffPlugin is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'HoloTableViewDiffPlugin'
gonghonglou, gonghonglou@icloud.com
HoloTableViewDiffPlugin is available under the MIT license. See the LICENSE file for more info.