18 Commits

Author SHA1 Message Date
Adlai Holler
c2ea7cfeac [Umbrella] ASCollectionView -> ASCollectionNode Migration, Separate Index Spaces (#2372)
* 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
2016-10-14 17:21:16 -07:00
Adlai Holler
124234fef8 [Umbrella] Add warn_unused_result Attribute to Public Headers (#2353)
* Add some warn_unused_result attributes

* Add more

* Add some more
2016-10-06 16:44:49 -04:00
Adlai Holler
4cf571c830 [ASCollectionView] Add Support for Interactive Reordering (#2221)
[ASTableView] Add Support for Interactive Reordering
2016-09-14 22:31:04 -07:00
Hannah Troisi
4baf9bdbfe [Infer] Fix Infer errors/warnings (#1938)
* [Infer] Fix 11 Infer errors/warnings

* fix build error
2016-07-16 15:29:24 -07:00
Adlai Holler
2e19d11350 Reduce block invocations, other small performance bumps 2016-07-12 15:11:13 -07:00
Adlai Holler
77f24231b3 [Documentation] Add a comment why we prefer -indexPathForItem:inSection: 2016-06-24 10:13:51 -07:00
Adlai Holler
457e08005f [ASDataController] Remove asyncDataFetching Option, Cleanup (#1794)
* [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
2016-06-23 21:08:44 -07:00
Adlai Holler
fcf2db79f8 [ASTableViewThrashTests] Initial commit 2016-06-21 18:46:08 -07:00
Hannah Troisi
c857e809f4 Clean up header comments (for consistent Facebook licensing info) (#1741)
[Licensing] Clean up header comments (for consistent Facebook licensing info)
2016-06-11 23:31:39 -07:00
Eric Horacek
d89504e345 Fix index path arithmetic error 2016-06-05 21:38:08 -07:00
Eric Horacek
8f3e511b22 Fix warning 2016-06-05 21:38:08 -07:00
Eric Horacek
fc5eef3269 Repopulate supplementary views on item-level changes
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.
2016-06-05 21:38:08 -07:00
Hannah Troisi
7f6ce4e9de [ASMultidimensionalArrayUtils]
- optimized ASRecursivelyFindIndexPathsForMultidimensionalArray() to remove enumerateUsingBlock:
- replaced single project call to ASIndexPathsForMultidimensionalArray() in ASRangeController with ASIndexPathsForTwoDimensionalArray()
2016-03-14 22:47:43 -07:00
Scott Goodson
9e72679ffd [ASDataController] Swap order of section / item in optimized indexpath creation from yesterday :). 2016-03-07 12:08:31 -08:00
Scott Goodson
8cfd951f42 [ASDataController] If app code issues edit commands before first reload, ignore them, as UIKit will call -reloadData. 2016-03-05 21:21:22 -08:00
Scott Goodson
cc7ca4a08f [ASDataController] If app code issues edit commands before first reload, ignore them, as UIKit will call -reloadData. 2016-03-05 20:22:18 -08:00
Scott Goodson
eac85b6c9a [ASDisplayNode] Optimize -setNeedsDisplay, deep mutable array copies.
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.
2016-02-28 20:54:56 -08:00
Jack Flintermann
ce33149548 make additional private headers actually private; import all public headers in AsyncDisplayKit.h 2015-09-16 23:31:48 -04:00