173 Commits

Author SHA1 Message Date
Adlai Holler
1801620094 Make ASTextNode copy exclusionPaths and attributedString 2015-10-06 00:46:20 -07:00
Adlai Holler
99b9f73b1a Fix index into size ranges 2015-10-05 11:51:05 -07:00
Adlai Holler
33c07db58c Set node.frame entirely 2015-10-05 11:42:25 -07:00
Adlai Holler
4601fccb5a Optimize ASDataController._layoutNodes 2015-10-05 11:37:29 -07:00
Adlai Holler
304ec9b543 Refuse to parse ph:// URLs if iOS < 8 for safety 2015-10-02 15:51:32 -07:00
Adlai Holler
35c118aff0 Merge branch 'master' into AdvancedPhotos
Conflicts:
	AsyncDisplayKit/ASMultiplexImageNode.mm
2015-10-02 12:45:49 -07:00
Adlai Holler
de1f9788f3 Simplify creation of Photos Framework NSURLs in ASMultiplexImageNode 2015-10-02 12:44:21 -07:00
appleguy
c8518c7fa6 Merge pull request #689 from facebook/Synchrotron
Implementation of Synchronous Concurrency features for AsyncDisplayKit 2.0
2015-09-28 14:49:13 -07:00
Scott Goodson
a58844379c Implementation of Synchronous Concurrency features for AsyncDisplayKit 2.0
This provides internal features on _ASAsyncTransaction and ASDisplayNode to facilitate
implementing public API that allows clients to choose if they would prefer to block
on the completion of unfinished rendering, rather than allow a placeholder state to
become visible.

The internal features are:
-[_ASAsyncTransaction waitUntilComplete]
-[ASDisplayNode recursivelyEnsureDisplay]

Also provided are two such implementations:
-[ASCellNode setNeverShowPlaceholders:], which integrates with both Tables and Collections
-[ASViewController setNeverShowPlaceholders:], which should work with Nav and Tab controllers.

Lastly, on ASDisplayNode, a new property .shouldBypassEnsureDisplay allows individual node types
to exempt themselves from blocking the main thread on their display.

By implementing the feature at the ASCellNode level rather than ASTableView & ASCollectionView,
developers can retain fine-grained control on display characteristics.  For example, certain
cell types may be appropriate to display to the user with placeholders, whereas others may not.

Follow-up work will include unit tests, revisiting names, and the header locations of definitions.
2015-09-27 19:14:36 -07:00
Huy Nguyen
a94cd9dd99 Remove externalCompletedNodes getter in ASDataController. 2015-09-28 00:18:49 +03:00
Huy Nguyen
e619edcd86 Ensure data consistency between ASDataController and its delegate while executing update transactions. 2015-09-27 22:59:36 +03:00
Adlai Holler
ffa0829fc9 Update & document changes to ASPhotosFrameworkImageRequest handling of PHImageRequestOptionsDeliveryMode 2015-09-26 18:41:38 -07:00
Adlai Holler
bf88bd8e19 Rename image request class, add deliveryMode into the request params 2015-09-26 13:40:00 -07:00
Adlai Holler
e787c40411 Only parse photos URL after we check the scheme 2015-09-25 15:45:14 -07:00
Adlai Holler
bbf9550e08 Use ASPhotosImageRequest in ASMultiplexImageNode, in a backwards-compatible way 2015-09-25 15:41:35 -07:00
Adlai Holler
ee0c027ba6 Build photos image request class and tests 2015-09-25 15:25:37 -07:00
Steven Ramkumar
d09888f9c2 Add a indexPathForNode: to ASTableView 2015-09-22 12:09:56 -07:00
Adlai Holler
4ef2e572e6 Elevate ceilPixel functions to ASTextNodeTextKitHelpers.h, add ceilSize 2015-09-20 21:17:24 -07: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
Huy Nguyen
7dc9b7fc40 Fix appledoc warnings. 2015-09-15 00:58:48 +03:00
Scott Goodson
a01d21f509 Switch to use only layers in the offscreen window used for the render range.
Accomodate and document unusual cases in which it is necessary to remove views when clearing backing stores.

ASDK layout and display calls don't depend on UIView in any way, so this
will achieve the necessary behavior of the render range while eliminating significant
UIView-specific overhead from heirarchy manipulation.
2015-09-07 14:20:57 -07:00
Garrett Moon
98b41a4b1c scrollable directions was invalid for non-flow layouts as bounds and contentSize were zero on init 2015-08-26 16:15:18 -07:00
Huy Nguyen
97f323a8d9 Fix relayoutAllRows to trigger measurement (with the new constrained size) on all nodes, including loading ones. 2015-08-21 01:02:19 +03:00
Scott Goodson
60cf43766b Revert "Switch to use only layers for offscreen working range window."
There is an unsolved issue with this optimization that may cause crashes
in certain cases.  Reverting until it's properly resolved.  It doesn't
appear to be possible to cause the issue in the test apps used to develop it.

This reverts commit 3f982b5c9a7e4a557c102268f11f71b58085ffef.
2015-08-17 17:19:51 -07:00
appleguy
bd9c9030d9 Merge pull request #610 from SRandazzo/606_sizezero_nil_text
Return CGSizeZero when computing the size of zero-length strings in ASTextNode.
2015-08-17 17:06:54 -07:00
Sal
05cb1d734d use attributedString.length instead of attributedString.string.length to check for empty strings 2015-08-16 18:24:20 -04:00
Sal
344c472349 Return CGSizeZero if ASTextNode's text length or attributed string is nil 2015-08-13 13:53:08 -04:00
Huy Nguyen
7249661990 Improve relayout when constrained size of all nodes is changed:
- In -layoutSubviews of table and collection views, detect changes that cause a different constrained size for nodes, and trigger relayout immediately.
- Orientation change can be handled by this solution. So, no need to observe to its events.
- Update Kittens example to support iPad (easier to catch bugs on these devices) and add a title to navigation bar (looks a bit nicer).
2015-08-13 06:28:47 +03:00
Scott Goodson
3f982b5c9a Switch to use only layers for offscreen working range window.
ASDK layout and display calls don't depend on UIView in any way, so this
will reduce UIView-specific overhead from heirarchy manipulation.
2015-08-12 18:03:47 -07:00
Huy Nguyen
a3c2dbf8cd Table and collection views' async data source can provide different constrained size per node. And because the size is of type ASSizeRange, it has a min size that is very helpful in many cases.. 2015-08-12 22:45:08 +03:00
appleguy
d401b0e5f6 Merge pull request #593 from shannonma/merge_fork
Fixes for ASTextNode test, setNeedsDisplay and font loading failures
2015-08-08 18:55:00 -07:00
Huy Nguyen
e657bedd40 Automatically relayout cells after orientation changed. 2015-08-09 00:36:58 +03:00
Roy Marmelstein
76e5f794da Fixing framework target build issues - missing info plist and headers 2015-08-03 23:47:53 +02:00
Shannon Ma
d5de2a22fd Text node to gracefully fail upon font failure 2015-07-31 12:24:04 -07:00
Ethan Nagel
bf0766169b PR Feedback: Require main thread for all edit commands, various cleanup. 2015-07-20 22:08:19 -07:00
Ethan Nagel
f497639124 Add support automatically adjusting the content offset to UITableView as well as support for performing endUpdates with no animations. Additionally, there are critical bug fixes for ASDataController (begin/end updates delegates not called in correct order) and ASRangeController (failure to fully refresh internal state when inserts or delete are made.) 2015-07-20 14:05:56 -07:00
Huy Nguyen
cfac6c992a [appledoc] Fix appledoc warnings. (#553) 2015-07-10 19:02:04 +07:00
Bogdan Iusco
a0fcecc469 Fix duplicate symbols on ASIndexPath 2015-07-07 18:23:04 +03:00
Huy Nguyen
9678adaa93 Merge branch 'master' into layout_node 2015-07-06 22:21:32 +07:00
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
Huy Nguyen
e74823bbee Merge branch 'master' into layout_node 2015-06-28 23:47:09 +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
Huy Nguyen
abe98d5b09 Integrate new layout nodes to the framework.
- Introduce ASLayoutNode and its subclasses.
- ASDisplayNode measures its ASLayoutNode and cache the result (ASLayout). Calculated size and position of each subnode can be retrieved from the calculated layout.
- Custom nodes need to override -layoutNodeThatFits:(CGSize) instead of -calculateSizeThatFits:(CGSize).
- Custom nodes do not need to layout its subnodes (in -layout:) anymore. ASDisplayNode can handle the job most of the time, by walking through its layout tree.
- ASCompositeNode is used to embed (display) subnodes to a node's layout. That way, each subnode will also be measured while the parent node is measuring. And the parent node knows where its subnodes are within its layout.
2015-06-25 11:34:35 +07:00
Victor Mayorov
a299a5b550 Implemented UIAccessibilityIdentification for ASDisplayNode 2015-06-24 11:03:51 -07:00