262 Commits

Author SHA1 Message Date
rlasante
04ec602500 Don’t retain an action’s target in ASControlNode
- addTarget:action:forControlEvents: should not retain the target. If it does
then there is a very high likelihood of a retain cycle.
2015-05-01 13:04:26 -04:00
Ryan Nystrom
527a6228a9 Xcode 6.3 support 2015-04-08 16:35:10 -07:00
Michael Kuntscher
a92dd3189b Adds property for long press touch cancellation 2015-04-01 16:38:29 -07:00
Ryan Nystrom
6ae17e55bc Merge pull request #403 from facebook/touch-forwarding
Forward touches to super instead of the superview
2015-03-26 21:11:53 -07:00
Ryan Nystrom
b6715b5cf9 Forward touches to super instead of the superview
fixes #402
2015-03-26 21:11:13 -07:00
Ryan Nystrom
29a360d562 Allow double-tap gestures on text nodes 2015-03-26 17:22:22 -07:00
Nadine Salter
13e1c65d03 Fix ASImageNode -measure: / -setImage: deadlock.
Speculative fix for #380.  Calling `-[ASImageNode setImage:]` on a
background queue will take the image lock, then trampoline to the main
queue to invalidate calculatedSize and set needsDisplay without
releasing the lock.  Any other method call that takes the image lock on
the main queue can block on the trampoline completing -- deadlock.

Note that the trampoline is itself a clowny workaround for thread
affinity (#134) and should be removed.  With this patch applied,
ASImageNode's `-setImage:` and `-calculateSizeThatFits:` can still race:

1.  -setImage changes _image, then trampolines to main
2.  -calculateSizeThatFits measures _image
3.  trampoline completes, invalidates calculated size
4.  ???
5.  ~~profit!~~ 💥
2015-03-23 14:05:15 -07:00
Ryan Nystrom
814aff5a6d Merge pull request #388 from facebook/issue-383
Remove ASImageNode's tint property.
2015-03-23 13:59:20 -07:00
Nadine Salter
8164d63d29 Fix ASTextNode positioning for non-left alignment, part deux.
Apply the fix from #329 to `-setFrame:`.  Fixes #89.
2015-03-20 12:45:06 -07:00
Nadine Salter
7344cb98bb Remove ASImageNode's tint property.
ASImageNodeTint is inflexible (your options are "no tint" and "use
`[UIColor grayColor]`") and needlessly complicates the ASImageNode
implementation.  Use ASImageNodeTintColorModificationBlock() instead.
Closes #383.
2015-03-20 12:37:27 -07:00
Ryan Nystrom
cd3ad1c86f Enable nodes entering the visible range to display 2015-03-17 10:52:32 -07:00
Ryan Nystrom
fa2f36004b Merge pull request #375 from facebook/issue-374
Stretchy or mod block images
2015-03-15 15:59:38 -07:00
Ryan Nystrom
59c9fc8819 Stretchy or mod block images
fixes #374
2015-03-12 14:41:11 -07:00
Ryan Nystrom
1278fe2cf0 Merge pull request #373 from facebook/issue-349
Remove the nil-asyncDelegate proxy.
2015-03-12 14:29:28 -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
Nadine Salter
a79b771a85 Remove the nil-asyncDelegate proxy.
Fixes #349.
2015-03-11 17:43:45 -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
Ryan Nystrom
b6dea69070 Text placeholders snap to pixels 2015-03-11 13:56:12 -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
Nadine Salter
afb0aa41b7 Merge pull request #360 from lxcid/bug/block-copy
Block should always be declared using the copy attribute.
2015-03-07 14:47:57 -08:00
Nadine Salter
860a8783b4 Merge pull request #356 from nguyenhuy/master
Fix method documentation in ASCollectionView.
2015-03-07 14:46:55 -08:00
Stan Chang Khin Boon
7c5b31e419 Block should always be declared using the copy attribute. 2015-03-08 01:54:02 +08:00
Huy Nguyen
6a13703932 Fix method documentation in ASCollectionView. 2015-03-06 12:29:59 +02:00
Max von Webel
086af4f99c I’m not completly sure, but shouldn’t this be “result” instead of “image”? 2015-03-05 14:35:40 -08:00
Ryan Nystrom
6588e7b665 Make data locking API optional 2015-03-04 10:13:32 -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
1f8001a104 ASCollectionView batch API 2015-02-26 22:24:46 -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
Ryan Nystrom
43be3294bc Remove "working range" from flow layout
This is a step towards a preloading range. We first want to migrate towards arbitrary ranges instead of being coupled to the notion of a single "working range".
2015-02-26 15:40:21 -08:00
Nadine Salter
9477114c86 Merge pull request #340 from facebook/fix_locking
Fix function call on lock/unlock api
2015-02-25 21:13:47 -08:00
Li Tan
88f77e5d52 Fix function call on lock/unlock api 2015-02-25 21:01:59 -08:00
Nadine Salter
8097a6edf1 Merge pull request #323 from facebook/issue-282
Change placeholder boolean to time interval
2015-02-25 20:54:19 -08:00
Li Tan
e862e04b05 Fix wrong assertion 2015-02-25 19:37:22 -08:00
Oliver Clark Rickard
582c11d447 Fix text node positioning for non-left alignment 2015-02-24 14:31:08 -05:00
Nadine Salter
2397bd0db6 Merge pull request #325 from facebook/fix_data_fetching
Sort array before data fetching
2015-02-24 11:09:51 -08:00
Li Tan
0e15b061d0 Sort array before data fetching 2015-02-23 20:45:25 -08:00
Nadine Salter
b023cfbb2a Merge pull request #303 from facebook/enable_async_data_fetching
Move ASTableView & ASCollectionView data fetching to background thread
2015-02-23 15:25:36 -08:00
Ryan Nystrom
ad474fce8e Make project imports consistent 2015-02-23 14:55:15 -08:00
Ryan Nystrom
5d76d6649f Change placeholder boolean to time interval 2015-02-23 14:01:17 -08:00
Ryan Nystrom
d8f5d135b0 Revert ASControlNode to previous touch/gesture handling 2015-02-18 17:51:18 -08:00