Throw assertion when attempting to inject section changes on AppKit#95
Throw assertion when attempting to inject section changes on AppKit#95helje5 wants to merge 1 commit intora1028:masterfrom helje5:feature/appkit-assert-on-sections
Conversation
|
I prefer NSCollectionView to support sections instead of asserts. |
|
@helje5 |
|
To be honest I don't understand what you are saying / trying to say :-)
You mean you prefer DifferenceKit to support NSCollectionView sections? Yeah, I'd prefer that too, but while that isn't available, asserts seem to be way to go? Otherwise people, like me, run into this and wonder why it isn't working.
You mean you prefer DifferenceKit to support NSTableView groups (same like sections, just w/ a different API)? Yeah, I'd prefer that too, but while that isn't available, asserts seem to be way to go? Otherwise people, like me, run into this and wonder why it isn't working. |
|
@helje5 |
I agree! And until that works, have the assertion, a one line change.
Don't have the time right now to check it out, maybe?
Your understanding is wrong. NSTableView has groups which is the same thing like UIKit sections, it just has a (quite) different API for that. So the task here would be to either provide a fascade which makes it work, or have a version of the algorithm running against the tableview representation of the data.
Assertions only stop the app when building them in debug mode. They exist specifically to help during development and are inactive when building in release mode. I think there is no reason not to enable them. |
Section changes are not supported yet on AppKit (neither
NSCollectionView nor NSTableView, see issues #93/#94).
Checklist
Description
Just added a single assertion to both extensions:
Related Issue
NSTableViewsections (aka group rows) #93 for NSTableViewNSCollectionViewsections #94 for NSCollectionViewMotivation and Context
Without the assertion, the extensions silently drop changes / do the wrong thing. This way we can at least catch them in debug mode.
Impact on Existing Code
No impact.
Screenshots (if appropriate)