198 Commits

Author SHA1 Message Date
Ryan Nystrom
2a75f2bcd4 ASImageNode not opaque by default
fixes #298
2015-02-11 12:58:35 -08:00
Nadine Salter
3b8f275a2a Revert "Let ASMultiplexImageNode skip failed image identifiers" 2015-02-09 16:35:38 -08:00
andyscott
cc819a7d49 Use more specific types for Collection/TableView async delegate params 2015-02-05 10:35:07 -08:00
Nadine Salter
e6d7985ac2 Merge pull request #286 from facebook/image-aspect-fit
Respect opacity of ASImageNode
2015-02-04 18:34:36 -08:00
Li Tan
08bb0b5d70 remove throw umimplemented exception 2015-02-04 11:55:38 -08:00
Li Tan
b5245f7cd4 Fix group update 2015-02-04 11:49:39 -08:00
Ryan Nystrom
1752c724fe Respect opacity of ASImageNode
fixes #284
2015-02-03 19:54:11 -08:00
andyscott
4bd9ef2927 Add image modification block to render template images w/ tint. 2015-02-03 12:54:41 -08:00
Nadine Salter
f085f06ff3 -[UIView addSubnode:], -[CALayer addSubnode:].
Bring back this convenience API -- it disappeared somewhere along the
line while we were building Paper.  This is totally trivial, but
conveniently won't break if you layer-back a leaf node.

Closes #278.
2015-02-02 19:59:30 -08:00
Nadine Salter
c6a04ef8bd Switch ASScrollNode to block initialiser syntax. 2015-02-02 19:41:30 -08:00
Nadine Salter
44f2f8bad0 Merge pull request #279 from bdaz/master
Fix ASControlNode Event Dispatch Table Memory Semantics
2015-02-02 18:50:46 -08:00
Brian Amerige
b3e9b7845f Fix ASControlNode Event Dispatch Table Memory Semantics
Summary: `weakToStrong` where the keys are NSNumbers that aren't strongly held by anyone means the events in the table get removed almost immediately. Derp.

Test Plan: Confirm that events are not dropped from the table after they're added. Confirm that the "Search" button actually works in the Share Sheet.

Reviewers: suv, zsh, nyn531, kimon, bcunning, sma, grp, nadi, b3ll

Reviewed By: b3ll

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

Tasks: 6137402

Signature: t1:1819759:1422918745:bf25bc2662f767fec3a78fc0c7702c591ed17064
2015-02-02 17:30:27 -08:00
Nadine Salter
d9e7e5d931 Merge pull request #250 from facebook/ASScrollNode
Simple UIScrollView wrapper node.
2015-02-02 11:03:21 -08:00
Ryan Nystrom
e6506899cb Code format cleanup 2015-01-29 10:12:12 -08:00
Nadine Salter
1f2b11f36b Merge pull request #273 from nolanw/tableview-editactions
Add -tableView:editActionsForRowAtIndexPath: to ASCommonTableViewDelegate
2015-01-28 20:19:55 -08:00
Brian Amerige
0c2bbd2aab Introduce Temporary Internal API to Allow Workaround for Threading Affinity Violation
See D1809545 in fbobjc.
2015-01-28 19:57:31 -08:00
Nolan Waite
f7e10f5c28 Add -tableView:editActionsForRowAtIndexPath: to ASCommonTableViewDelegate
It worked perfectly well before. Now it's explicitly declared.
2015-01-28 22:43:11 -04:00
Nadine Salter
d5f18f7637 Merge pull request #270 from facebook/issue-268
Track control node touches
2015-01-27 16:16:27 -08:00
Ryan Nystrom
76b3d1310f Track control node touches
Tested with custom `ASTextNode` subclass. No targets added, but tracking events are still received upon touches.

fixes #268
2015-01-27 15:47:05 -08:00
Nadine Salter
772cf15335 Merge pull request #260 from dshahidehpour/node_access
Added node access methods to ASTableView, ASCollectionView.
2015-01-27 14:42:48 -08:00
Nadine Salter
9f6ce8e16e Merge pull request #265 from andyscott/ASTextNode-max-line-count
Add maximumLineCount to ASTextNode
2015-01-27 14:41:25 -08:00
Nadine Salter
50be56f339 Merge pull request #264 from facebook/extension
Compile for extensions
2015-01-27 14:21:17 -08:00
Ryan Nystrom
6bc94190e8 Bail display if parent nodes raster children
fixes #244
2015-01-27 09:46:12 -08:00
Ryan Nystrom
ea6c29fb7f Compile for extensions 2015-01-27 09:30:09 -08:00
andyscott
72ea1c94df Add maximumLineCount to ASTextNode... which corresponds to maximumNumberOfLines on the underlying container 2015-01-26 21:05:28 -08:00
Dustin Shahidehpour
94cd785870 Added node access methods to ASTableView, ASCollectionView. 2015-01-26 13:57:04 -08:00
Ryan Nystrom
f200f9504a Merge pull request #248 from facebook/tidy-initialisers
Tidy initialisers.
2015-01-26 11:11:08 -08:00
Ryan Nystrom
93bb7cd591 Merge pull request #249 from facebook/weak-delegation
Fix strong ASNetworkImageNodeDelegate reference.
2015-01-26 11:02:40 -08:00
Nadine Salter
241fe8ebb5 Further ASTextKitComponents API improvements. 2015-01-25 16:27:01 -08:00
Nadine Salter
e0f926c861 Switch ASTextKitComponents interface C -> ObjC. 2015-01-25 16:27:01 -08:00
Nadine Salter
35d7f43fb6 Convert ASTextKitComponents to an object.
ARC doesn't play nicely with structs that contain references to
Objective-C objects, which causes breakage when using AsyncDisplayKit as
a dynamic framework (e.g., with CocoaPods 0.36+).  Fixes #198.
2015-01-25 15:50:54 -08:00
Nadine Salter
ad57e126e7 Simple UIScrollView wrapper node.
Closes #99.  This is a quick sketch -- room for improvement includes
considering a less-questionable class name, potentially exposing
additional UIScrollView functionality directly on the node, and using it
in a sample project.
2015-01-24 12:11:59 -08:00
Nadine Salter
9cf71828ad Include ASEditableTextNode in framework header. 2015-01-24 12:04:06 -08:00
Nadine Salter
92d6c577ed Fix strong ASNetworkImageNodeDelegate reference.
Fixes #239.
2015-01-24 11:59:41 -08:00
Nadine Salter
fab6f623a8 Deprecate -initWith{View,Layer}Class:.
These have been superseded by -[ASDisplayNode initWithViewBlock:] and
-[ASDisplayNode initWithLayerBlock:], respectively -- the new API allows
for custom initialisers, but does not support asynchronous display.

The old initialisers are still available in ASDisplayNodeInternal.h, for
internal subclasses and daring adventurers.
2015-01-24 11:52:27 -08:00
Nadine Salter
795b297c38 ASEditableTextNode. 2015-01-23 15:02:16 -08:00
Nadine Salter
1608a002e5 Merge pull request #228 from andyscott/wip/ASMultiplexImageNode-skip-failed-identifiers
Let ASMultiplexImageNode skip failed image identifiers
2015-01-23 12:30:47 -08:00
Nadine Salter
46f2d723f2 Merge pull request #235 from ide/bridge-node
ASBridgeNode: wrapper around an existing UIView with ASDisplayNode semantics
2015-01-23 12:29:50 -08:00
andyscott
3eba302b27 Make ASDataController call rowsInSection with the appropriate index 2015-01-23 12:03:52 -08:00
James Ide
1545384c7c Let ASDisplayNode take a block that returns the backing view/layer
This adds new initializer methods to ASDisplayNode:
```objc
initWithViewBlock:(ASDisplayNodeViewBlock)viewBlock
initWithLayerBlock:(ASDisplayNodeLayerBlock)layerBlock
```

Sometimes a view can't be constructed with `-[initWithViewClass:]` but you want to use it with ASDK, so these new methods provide a way to wrap an existing view in a node.

The API is meant to preserve ASDisplayNode's behavior, so you can still construct and set properties on the node on a background queue before its view is loaded; even though the view was created a priori, it is not considered to be loaded until `node.view` is accessed.

Using the API looks like this:

    dispatch_async(backgroundQueue, ^{
        ASDisplayNode *node = [ASDisplayNode alloc] initWithViewBlock:^{
            // Guaranteed to run on the main queue
            UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
            [button sizeToFit];
            node.frame = button.frame;
            return button;
        }];
        // Use `node` as you normally would...
        node.backgroundColor = [UIColor redColor];
    });

The main thing this bridging API doesn't do (can't do?) is layout. Methods like `-[ASDisplayNode calculateSizeThatFits:]` and `-[ASDisplayNode layout]` cannot delegate to `[UIView sizeThatFits:]` and `[UIView layoutSubviews]` since the UIView methods must run on the main thread. If ASDK were internally asynchronous and could dispatch its layout methods to different threads (sort of like how ASTableView computes its cells' layouts) then we could mark nodes with externally provided views/layers as having "main-queue affinity" and delegate its layout to UIKit.

Test cases are included and all existing tests pass.
2015-01-22 16:31:37 -08:00
Li Tan
8ae063dec8 Add check for willDeleteSections: 2015-01-22 12:21:30 -08:00
andyscott
11e3cf518c Slight naming adjustments for recent ASMultiplexImageNode additions 2015-01-21 22:30:24 -08:00
James Ide
b5d999ab55 Fix ASRangeController's delegate method invocations
"did" should be "will" in a couple of places
2015-01-21 17:07:53 -08:00
Ryan Nystrom
afb21bf8dd Default proxy object for ASTableView and ASCollectionView
fixes #231 #233
2015-01-20 13:15:39 -08:00
Nadine Salter
7542f7ca17 Fix build-break. 2015-01-20 12:16:30 -08:00
Nadine Salter
978cf85ae1 Merge pull request #211 from facebook/batch_animation
Batch animation
2015-01-20 11:51:31 -08:00
andyscott
60b27829e1 Let ASMultiplexImageNode skip failed image identifiers 2015-01-15 15:25:41 -08:00
Ryan Nystrom
d9a3bac05d Suppress build warning with designated initializer 2015-01-14 15:43:28 -08:00
Ryan Nystrom
efaaa25017 ASMultiplexImageNode designated initializer
fixes #220
2015-01-14 15:02:15 -08:00
Łukasz Jerciński
ff260f58e1 Removed unintentional conversion. 2015-01-14 22:15:41 +01:00