HoloCollectionViewDiffPlugin
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
What's for
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.
Usage
let collectionView = UICollectionView.init(frame: self.view.bounds, collectionViewLayout: flowLayout)
self.view.addSubview(collectionView)
collectionView.holo_makeRows { (make) in
for item in [Int]() {
_ = make.row(CollectionViewCell.self).model(item).diffId(item)
}
}
collectionView.reloadData()
// diff reload
collectionView.stored()
collectionView.holo_removeAllSections()
collectionView.holo_makeRows { (make) in
for item in [Int]() {
_ = make.row(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_makeRows{}
.
Installation
HoloCollectionViewDiffPlugin is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'HoloCollectionViewDiffPlugin'
Author
gonghonglou, [email protected]
License
HoloCollectionViewDiffPlugin is available under the MIT license. See the LICENSE file for more info.