Skip to content

HoloFoundation/HoloTableViewDiffPlugin

Repository files navigation

HoloTableViewDiffPlugin

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

What's for

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.

Usage

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{}.

Installation

HoloTableViewDiffPlugin is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'HoloTableViewDiffPlugin'

Author

gonghonglou, gonghonglou@icloud.com

License

HoloTableViewDiffPlugin is available under the MIT license. See the LICENSE file for more info.

About

A HoloTableView plugin to support diff reload using DeepDiff.

Resources

License

Stars

Watchers

Forks

Packages

No packages published