18 Commits

Author SHA1 Message Date
Michael Schneider
44aa582ceb Fix crash if batch update blocks are nil although method declaration allows nullable (#2599) 2016-11-14 10:15:11 +09:00
george-gw
54cda5fdbb [ASCellNode] Added indexPath property. (#2468)
* [ASCellNode] Added indexPath property.

* [ASCellNode] Cached the type of scrollView we're using in the node, and placed that logic in setScrollView.

* [ASCellNode] Removed table and collection view from indexPath, since they return the index paths from the view-space.

* Changed the logic for getting indexPath so that it works even when the cell is not displayed.

* [VerticalWithinHorizontalScrolling] Explicitally synthesized indexPath property.
2016-10-27 16:56:00 -07:00
george-gw
ea9d785180 Call reloadData if necessary when accessing specific methods. (#2479)
Added test case.
2016-10-26 11:38:21 -07:00
george-gw
3638feffd4 Added selection API to ASTableNode and ASCollectionNode (#2453)
* Added selection API to ASTableNode and ASCollectionNode (#2450)

* Updated test case to use collectionNode instead of collectionView for the selection tests.

* Fixed typos.
Added asserts for main thread.
Updated ASCollectionViewTests for multiple selections for nodes.

* Added assigns to the different properties.
2016-10-24 09:30:09 -07:00
Hannah Troisi
9719357901 [ASLayoutElement] Move ASDisplayNode's .name property to ASLayoutElement (renamed to .debugName) (#2395)
* Move ASDisplay .name property to ASLayoutElement

* keep ASDisplayNode.name deprecated

* address @appleguy's comments
2016-10-20 17:27:31 -07:00
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
bb366d14f0 [ASCellNode] Restore Layout Attributes Fix + iOS 10 Modification (#2335)
* [ASCellNode] Fix applyLayoutAttributes not called, add readonly layoutAttributes property (#2321)

* Clear cell node layout attributes in didEndDisplayingCell: also
2016-10-05 17:31:46 -04:00
Adlai Holler
0a2e35af38 [ASCollectionView] Allow User to Submit Updates Before Initial Data Load (#2337)
* Add tests for how UICV/ASCV will throw if you update before the initial data load

* Allow user to submit updates before initial data load to workaround UICollectionView bug

* Add some info
2016-10-03 19:13:50 -04:00
Scott Goodson
a25f4a7b85 Revert "[ASCellNode] Fix applyLayoutAttributes not called, add readonly layoutAttributes property (#2321)"
This reverts commit f9ee1dd4b6b4d8a062c5453623bc6fde1840cd91.

This appears to have caused a test failure:
https://travis-ci.org/facebook/AsyncDisplayKit/jobs/164532435
2016-10-02 19:36:06 -07:00
Huy Nguyen
066351bad7 Introduce ASSectionContext and ASSection (#2178)
- Objects conform to ASSectionContext protocol can be provided via ASCollectionDataSource and later retrieved from the collection view. They are guaranteed to be in sync with sections of the collection view. They can be used to store additional data associated with each section, to be used in collection view layout and the like.
- ASSection is an internal object that is the foundation for coming debugging tools.
- Unit tests included.
2016-10-01 14:04:05 -04:00
Adlai Holler
f9ee1dd4b6 [ASCellNode] Fix applyLayoutAttributes not called, add readonly layoutAttributes property (#2321) 2016-09-29 16:41:28 -04:00
Adlai Holler
ec64b9b229 [ASDataController] Call All Completion Handlers after Nested Batch Updates (#2274)
* Add tests for batch update completion handler calling

* Ensure we call all completion handlers after collection view updates

* Tweak it

* Fix the doc

* Minor improvements

* Document addCompletionHandler better
2016-09-27 17:21:28 -04:00
Michael Schneider
9f1a387ba0 [ASTableView / ASCollectionView] Improve assertion messages if necessary data source methods are not implemented (#2269)
* Improve assertion message if tableView:nodeBlockForRowAtIndexPath: or tableView:nodeForRowAtIndexPath: is not implemented

* Improve assertion message if collectionView:nodeForItemAtIndexPath: or collectionView:nodeBlockForItemAtIndexPath: is not implemented
2016-09-22 13:35:04 -07:00
Adlai Holler
33a680255c [ASDisplayNode] Add Convenience Interface State Accessors (#2168)
* Finish renaming fetchData range, add convenience accessors

* Update example

* Update new tests
2016-09-01 16:44:16 -07:00
Adlai Holler
284975ecec Fix Case Where Node Is Deallocated While Visible (#2171)
* Attempt to reproduce supplementary crash

* Get closer with supplementary issue testing

* Alright! We have a repro!

* The investigation continues

* Fixed!
2016-08-31 15:50:39 -07:00
Adlai Holler
b21742c3c9 [ASCollectionView] Relayout Nodes as Soon as Bounds Changes (#2121)
* Add failing test case for ASCollectionView rotation

* [ASCollectionView] Relayout nodes immediately on bounds change
2016-08-23 14:33:45 -07:00
Adlai Holler
f434192339 [Tests] Two Minor Cleanups (#1977)
* [Tests] Use XCTestExpectation instead of rolling our own in ASMultiplexImageNode

* [Tests] Remove do-nothing ASCollectionView test method
2016-07-24 15:32:27 -07:00
Adlai Holler
8cde594de3 [ASDataController] Add validation logic to the change set to throw exceptions on invalid updates (#1894)
[_ASHierarchyChangeSet] Oopsy daisy

[ASDataController] Tweak our update validation

[ASHierarchyChangeSet] Fix bugs

Finish up some stuff

[ASDataController] Put some stuff back

[ASChangeSetDataController] Always use changeset

[ASDataController] Put other stuff back

[_ASHierarchyChangeSet] Use fast enumeration

[_ASHierarchyChangeSet] Fix assertion format strings, return on fail so we don't crash in production

[ASDataController] Store data source item counts as vector rather than NSArray

[ASDataController] Build some tests for the update validation

[ASDataController] Fix issues with update validation

Get rid of new file

[ASDataController] Suppress changeset validation before initial reload

[ASDataController] Make invalid update log vs. exception publicly toggleable
2016-07-21 14:37:51 -07:00