ra1028 / DifferenceKit

💻 A fast and flexible O(n) difference algorithm framework for Swift collection.
https://ra1028.github.io/DifferenceKit
Apache License 2.0
3.57k stars 241 forks source link

Support `NSCollectionView` sections #94

Open helje5 opened 4 years ago

helje5 commented 4 years ago

Checklist

Description

The NSCollectionView reload extension method doesn't support sections.

Motivation and Context

Would be nice to have sections, just like on iOS :-)

Proposed Solution

Unlike #93 (NSTableView section support) this one should be an almost exact copy of the UICollectionView.reload implementation? AFAIK the NSCollectionView essentially works the same, at least since ~10.12. (The main difference is that NSCollectionView uses VCs instead of plain views as items, but that doesn't matter here). deleteSections/insertSections etc. are all available.

ra1028 commented 4 years ago

Thanks @helje5 . Sorry for my late reply. I agree with that, but I'm not familiar with AppKit. Feel free to make a pull-request!