14914 Commits

Author SHA1 Message Date
Nadine Salter
6819816bd3 Restore artificial delay in Multiplex demo.
The change to ASBasicImageDownloader regressed the artificial network
delay in the original demo code.  Revert it.
2015-02-03 08:18:57 -08:00
Nadine Salter
685263a58a Merge pull request #280 from facebook/miscellanea
Miscellanea
2015-02-02 20:13:28 -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
Peter
cd0d3c8aa4 no message 2015-01-31 02:39:38 +03:00
Peter
34a7d245da Added .gitignore 2015-01-31 00:20:06 +03:00
Peter
2066b31b05 Initial Commit 2015-01-31 00:18:30 +03:00
Nadine Salter
549d40dac0 Merge pull request #272 from facebook/format-cleanup
Code format cleanup
2015-01-29 10:53:26 -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
Nadine Salter
32ca53fc61 Merge pull request #274 from bdaz/master
Introduce Temporary Internal API to Allow Workaround for Threading Affin...
2015-01-28 20:05:14 -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
Nadine Salter
5c96f669ba Merge pull request #266 from facebook/issue-244
Bail display if parent nodes raster children
2015-01-27 14:18:57 -08:00
andyscott
c098272c0a Fix existing tests and add additional test for max line count 2015-01-27 09:47:55 -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
Peter
5c710b85a7 no message 2015-01-27 18:13:00 +03: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
Ryan Nystrom
5ed66f9758 Merge pull request #253 from facebook/mixed-metaphors
Convert ASTextKitComponents to an object.
2015-01-26 10:09:05 -08:00
Ryan Nystrom
e746989997 Merge pull request #254 from facebook/ASEditableTextNode-example
Simple ASEditableTextNode example project.
2015-01-26 10:08:50 -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
1f1abbdbdf Simple ASEditableTextNode example project. 2015-01-25 16:14:23 -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
9f38488fd2 Bump Podfile.lock to CocoaPods 0.35.0. 2015-01-24 11:50:04 -08:00
Nadine Salter
0a5ba09136 Merge pull request #246 from facebook/ASEditableTextNode
ASEditableTextNode.
2015-01-23 16:05:19 -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
Nadine Salter
facfa695b8 Merge pull request #245 from andyscott/wip/fix-ASDataController-reloadSections
Make ASDataController call rowsInSection with the appropriate index
2015-01-23 12:28:59 -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
Nadine Salter
e1f8342c3b Merge pull request #241 from facebook/add_check
Add check for willDeleteSections:
2015-01-22 12:38:54 -08:00
Li Tan
8ae063dec8 Add check for willDeleteSections: 2015-01-22 12:21:30 -08:00