132 Commits
Author SHA1 Message Date
appleguy 3f574a3306 Merge pull request #521 from jflinter/jack-uiresponder-additions
Add UIResponder methods to ASDisplayNode
2015-07-04 22:36:09 -07:00
Scott Goodson 6220d65747 Property declaration tweak for odd Travis build failure (only on the Tests build). 2015-07-04 20:54:04 -07:00
Scott Goodson 8fa092fb77 Complete overhaul of ASFlowLayoutController.
Introduced ASIndexPath for efficient handling of index paths in C++ vectors,
while maintaining the readability of ".section" and ".row" instead of
".first" and ".second" inside of complicated business logic.

Confirmed that the working range calls are firing appropriately during
ASTableViewStressTest, including the deallocation of the rich text placeholders
provided by ASTextNode.
2015-07-04 20:22:04 -07:00
Scott Goodson 57465c7fd3 Overhaul ASDataController and extensively test ASTableView.
This diff resolves all known consistency issues with ASTableView and ASCollectionView.
It includes significantly more aggressive thrash-testing in ASTableViewStressTest,
which now passes on a variety of device and simulator configurations.  It also updates
the unit tests run on every commit to ensure any regression is caught quickly.

A few of the salient changes in this diff:
- ASTableView now uses Rene's ASCollectionViewLayoutController, and actually uses a
UICollectionViewFlowLayout without any UICollectionView.  This resolves an issue where
ASFlowLayoutController was generating slightly out-of-bounds indicies when programmatically
scrolling past the end of the table content.  Because the custom implementation is likely
faster, I will revisit this later with profiling and possibly returning to the custom impl.
- There is now a second copy of the _nodes array maintained by ASDataController.  It shares
the same node instances, but this does add some overhead to manipulating the arrays. I've
filed a task to follow up with optimization, as there are several great opportunities to
make it faster.  However, I don't believe the overhead is a significant issue, and it does
guarantee correctness in even the toughest app usage scenarios.
- ASDataController no longer supports calling its delegate /before/ edit operations.  No
other class was relying on this behavior, and it would be unusual for an app developer to
use ASDataController directly.  However, it is possible that someone with a custom view
that integrates with ASDataController and ASRangeController could be affected by this.
- Further cleanup of organization, naming, additional comments, reduced code length
wherever possible.  Overall, significantly more accessible to a new reader.
2015-06-28 18:03:45 -07:00
Scott Goodson feba7f8ed1 Update the identifier that AsyncDisplayKit uses to label its internal queues (2/2). 2015-06-27 12:10:58 -07:00
Scott Goodson dc19970fe8 Clean up organization and naming of methods internal to ASDataController. 2015-06-27 11:48:55 -07:00
Scott Goodson 06cfe68cbd Clean up ASDataController for readability & API naming consistency. 2015-06-27 11:06:54 -07:00
Jack Flintermann 0b14d42033 add UIResponder methods to ASDisplayNode 2015-06-27 03:19:51 -04:00
Victor Mayorov a299a5b550 Implemented UIAccessibilityIdentification for ASDisplayNode 2015-06-24 11:03:51 -07:00
Rene Cacheaux 60e676a38a Adds ASCollectionViewLayoutController and convenience CGRect/ASScrollDirection functions. Fixes default collection view range tuning parameters for Preload and Render ranges; values were flipped. 2015-06-23 07:30:13 -05:00
Rene Cacheaux 4aa796d894 Merge branch 'master' into CollectionViewLayoutSupport 2015-06-21 23:17:41 -05:00
appleguy 607367aacf Merge pull request #496 from facebook/DataControllerCrash
Improvements to thread safety during closely spaced edit events.
2015-06-21 21:16:05 -07:00
Scott Goodson c700618862 Improvements to thread safety during closely spaced edit events.
This applies primarily when beginUpdates / endUpdates is not used.
Due to user interaction-driven edits, like reloads or adding content
at the bottom, sometimes this is unavoidable in app design and thus
critical.

I have a diff in flight to make ASDataController / ASRangeController
robust against very aggressive thrash testing, which will be added
both to the unit test suite and this new example project.
2015-06-21 21:04:09 -07:00
Rene Cacheaux 777b48cc33 Adds layout controller for collection views. This new layout controller leverages UICollectionViewLayout's layoutAttributesForElementsInRect in order to calculate index paths for items in AsyncDisplayKit ranges. Flow layout is still a requirement in order to test the waters. 2015-06-21 18:37:00 -05:00
Rene Cacheaux 0adac6851a Adds abstract ASLayoutController implementation in preparation for custom layout ASLayoutController implementation. 2015-06-21 13:24:24 -05:00
Rene Cacheaux 33118df73b Merge branch 'master' into CollectionViewLayoutSupport 2015-06-21 11:45:56 -05:00
Rene Cacheaux e46c13edc5 Exposes ASCollectionView's ability to determine scroll direction. Scroll direction detection can now support 2-axis collection view layouts. ASCollectionView can now determine scrollable axes. 2015-06-21 11:45:25 -05:00
appleguy ed4ccfcc7f Merge pull request #491 from RCacheaux/CollectionViewLayoutSupport
Custom Collection view layout prep PR
2015-06-20 20:18:54 -07:00
Scott Goodson 904905189c Remove -[_ASDisplayView layoutSubviews] and use only -[_ASDisplayLayer layoutSublayers].
This helps us support special cases such as ASScrollNode correctly driving the -layout
method for subclasses even though it is based on UIScrollView & can't use _ASDisplayView.

I suspect this will be useful for ASCollectionNode and ASTableNode as well, which would
allow nesting those classes inside of other collections / tables (e.g. horizontal
unit within a vertical unit).
2015-06-20 19:40:01 -07:00
Rene Cacheaux a7f7620b8c Turns ASScrollDirection into Option set in preparation for supporting 2-axis collection view layouts. Clears test host target warnings. 2015-06-20 18:25:48 -05:00
VictorM 2c74904368 Fixed crash with deallocated CGImageRef 2015-06-11 10:42:28 +03:00
Victor Mayorov 9c20edb310 Added checking that sessionTask hasn't been added during creation of previous one 2015-06-10 17:58:35 +03:00
Victor Mayorov 7359e2255d Added synchronisation for sessionTask property 2015-06-10 17:50:21 +03:00
Victor Mayorov 7167e4a589 Fixed ASBasicImageDownloader to handle multiple request with the same URL 2015-06-10 15:38:51 +03:00
Scott Goodson e3f0e66cb3 Updating API names for network range and memory culling before ASDK 1.2 tag. 2015-05-21 22:43:38 -10:00
appleguy 079da308ef Merge pull request #437 from eanagel/ASDataController-release-nodes
ASDataController dealloc, ensure cell nodes are not in a superview
2015-05-16 22:49:55 -10:00
appleguy 33c5a72002 Merge pull request #432 from tonklon/master
ASTextNode expose exclusion paths
2015-05-16 22:19:47 -10:00
Ethan Nagel 38f08c9bd8 support layers as well as views when doing ASDisplayCell cleanup (in case we add support for layer-backed ASDisplayCells in the future.) 2015-05-03 21:45:33 -07:00
appleguy f248dbddd1 Merge pull request #405 from eanagel/reloadData-completion
Add (optional) completion handler for ASTableView and AsCollectionView reloadData
2015-05-03 19:25:06 -07:00
Ethan Nagel b40c1dbfc3 on ASDataController dealloc, ensure that loaded Cell nodes are not in the TableViewCell. For reasons I don't fully understand, this avoids a retain cycle with the currently displayed cells. 2015-04-22 13:57:25 -07:00
Tobias Klonk 2a29f81b3a ASTextNode expose exclusion paths
expose NSTextContainer's exclusionPaths property on ASTextNode to be able to exclude view areas from typesetting.

This implements #394
2015-04-20 10:21:01 +02:00
Ryan Nystrom b6715b5cf9 Forward touches to super instead of the superview
fixes #402
2015-03-26 21:11:13 -07:00
Ethan Nagel 3f509dbd2f add completion block to reloadData methods 2015-03-26 16:32:44 -07:00
Ryan Nystrom cd3ad1c86f Enable nodes entering the visible range to display 2015-03-17 10:52:32 -07:00
Nadine Salter 7fa5aa5e01 Merge pull request #371 from facebook/working-window
Working range window
2015-03-11 18:02:20 -07:00
Ryan Nystrom 0b19be0f85 Working range window
This brings back the concept of a window store for nodes that are in the working range (reverting #127). It turns out that due to the system architecture if there are nodes who fetch remote content (e.g. `ASNetworkImageNode`), calls to `-display` will occur before fetching has been completed. The next chance the nodes have to decode and display content is then when they are actually on the screen, thus defeating the purpose of a working range.

With the reintroduction of the working range window, nodes are "stored" in the window and when content is finished being fetched, CA triggers `-display` since they are part of a view hierarchy.

This can be tested in the Kittens project by insuring that before `ASRangeController` adds a node to [a visible view](https://github.com/facebook/AsyncDisplayKit/blob/master/AsyncDisplayKit/Details/ASRangeController.mm#L57) that the image node (with remote content) has set its layer's contents.
2015-03-11 17:59:03 -07:00
Nadine Salter de14f220c3 Merge pull request #367 from facebook/issue-364
Thread safe creation and canceling of download tasks
2015-03-11 17:57:52 -07:00
Ryan Nystrom db8bbcfd0e Thread safe creation and canceling of download tasks
fixes #364
2015-03-11 16:52:14 -07:00
Brian Amerige 9019233c68 Support Forwarding Responder-Chain Actions to Node from its View
Summary:
What it says on the tin. This allows Nodes to effectively participate in the responder chain.

Caveat: see note in implementation below. Would have been nice to use `-targetForAction:withSender:` the way the docs imply you can, but alas.

Test Plan: Observe a node in the responder chain get invoked to handle an action it implements.

Reviewers: bcunning, zsh, sma, jpasqualini, suv, nyn531, b3ll, aaronpang, kimon, grp, jonathan, rnystrom, nadi

Reviewed By: nadi

Subscribers: trunkagent, rnystrom

Differential Revision: https://phabricator.fb.com/D1894023

Signature: t1:1894023:1426026643:203945b6a7c318f6d2c9b94d876da61da31327bd
2015-03-11 14:37:17 -07:00
Nadine Salter a40c8172ac Merge pull request #365 from facebook/issue-363
Range handlers use recursive actions
2015-03-09 12:37:17 -07:00
Ryan Nystrom 5e7755fac0 Range handlers use recursive actions
fixes #363
2015-03-09 12:33:02 -07:00
Stan Chang Khin Boon 7c5b31e419 Block should always be declared using the copy attribute. 2015-03-08 01:54:02 +08:00
Ryan Nystrom 69dbbae91c Fix miscellaneous build failures. 2015-03-02 16:44:25 -08:00
Ryan Nystrom c657411a2e Batch fetch with small data sets 2015-02-26 22:29:13 -08:00
Ryan Nystrom 8d7fe334e2 Revisions based on feedback 2015-02-26 22:29:13 -08:00
Ryan Nystrom b3ae15858a Unit tests for batch fetching 2015-02-26 22:26:25 -08:00
Ryan Nystrom 09ade3dd00 ASTableView batch API and context object 2015-02-26 22:23:32 -08:00
Ryan Nystrom 599bf42675 Revisions based on feedback 2015-02-26 15:41:32 -08:00
Ryan Nystrom 4fa03a01d1 Functioning Preload range
Refactor how we do ranges so they can be arbitrarily managed. Introduce the concept of a preload range.
2015-02-26 15:41:32 -08:00
Ryan Nystrom 9c877c51af Support for dynamic ranges
This refactors how we do ranges and implements tuning parameters for a "Render" range and a "Preload" range
2015-02-26 15:40:21 -08:00