* Separate dataSource & UIKit index spaces
Beef up our supplementary node support
Make the API way better
Go nuts
Add a unit test for UICollectionView's handling of reloadData inside batch updates
Wrap indexPathForNode: in a cache
Convert index paths in delegate methods
Go back on table view
Put collection view back
Switch up the API
Move most ASCollectionView API to ASCollectionNode
Move most table logic over to ASTableNode
Do the things
More conversion work
Keep on keepin' on
Get table view delegate API done
More porting
Simplify
Clear the delegate
More cleanup
Move more stuff around
Remove pointless file
Re-add some API
Put back more API
Use the right flag
* Some cleanup
* Remove incorrect comment
* Tweak the API
* Put back a couple methods
* update example projects (note: ASCollectionView deprecation warnings expected)
* change reloadDataWithCompletion:nil --> reloadData
* Clean up rebase
* Make deprecated numberOfItemsInSection methods optional
* Use the right flag
* Address nits
* update ASDKTube, ASDKgram & ASViewController examples
* [ASDataController] Add some assertions to clarify what queues things happen on
* [ASCollectionDataController] Optimize willReloadData
* [ASDataController] Minor optimizations, no functional changes
* [ASDataController] Always reload data on _editingTransactionQueue
* [ASDataController] Remove async data fetching option, deprecate callbacks
* [ASDataController] Not mutable
* [ASMultidimensionalArrayUtils] Use fast enumeration
* Optimize ASMultidimensionalArrayUtils
Currently within `ASCollectionView`, there is an assumption that there will always be a static number of supplementary views per section—even when additional items are added or removed from that section. This is evidenced by the fact that when you invoke -[ASCollectionView insertItemsAtIndexPaths:], the data source method -[ASCollectionDataSource collectionView:nodeForSupplementaryElementOfKind:atIndexPath:] is not invoked, preventing consumers from specifying a new number of supplementary nodes for the new set of items.
With this change, the set of supplementary nodes for a section is now recalculated not only on section-level mutations, but also on item-level mutations as well. This adds item-level counterparts to the section-level `-prepareFor...` subclassing hooks in `ASDataController+Subclasses.h` to make this possible.
This should fix#1278 and #1322
This has been tested in my project and seen to fix the assertion. Open to suggestions on how to test in a more universal way.
- optimized ASRecursivelyFindIndexPathsForMultidimensionalArray() to remove enumerateUsingBlock:
- replaced single project call to ASIndexPathsForMultidimensionalArray() in ASRangeController with ASIndexPathsForTwoDimensionalArray()
These optimizations are surprisingly impactful. -setNeedsDisplay being called
for every node triggered cancelAsyncDisplay, locking, and memory management overhead
that is completely avoidable because Core Animation triggers first display automatically.
The mutable array copy optimizations reduced this key cost by over 10x, from 52ms to 5ms
on an iPad Air 2 / A8X with a real-world test case.