To run the example project, clone the repo, and run pod install from the Example directory first.
HoloCollectionViewDiffPlugin is a plugin for HoloCollectionView framework, which provide the diff reload actions support for DeepDiff.
To use it, simply make sure you use DeepDiff and import this plugin.
let collectionView = UICollectionView.init(frame: self.view.bounds, collectionViewLayout: flowLayout)
self.view.addSubview(collectionView)
collectionView.holo_makeItems { (make) in
for item in [Int]() {
_ = make.item(CollectionViewCell.self).model(item).diffId(item)
}
}
collectionView.reloadData()
// diff reload
collectionView.stored()
collectionView.holo_removeAllSections()
collectionView.holo_makeItems { (make) in
for item in [Int]() {
_ = make.item(CollectionViewCell.self).model(item).diffId(item)
}
}
collectionView.reload()If the collectionView has been reload and then you want to diff reload, you need to perform collectionView.stored() before collectionView.holo_makeItems{}.
HoloCollectionViewDiffPlugin is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'HoloCollectionViewDiffPlugin'gonghonglou, gonghonglou@icloud.com
HoloCollectionViewDiffPlugin is available under the MIT license. See the LICENSE file for more info.