52 Commits

Author SHA1 Message Date
Scott Goodson
cc07d77d68 [ASViewController] Ensure we retain a reference to the UIVC object returned by the initWithViewController: block. 2016-03-02 22:38:56 -08:00
Huy Nguyen
c64f23725f Update ASCellNode visibility API 2016-02-29 20:26:16 -08:00
Michael Schneider
45c616d916 Improve ASTextCellNode customization 2016-02-26 06:31:09 -08:00
Huy Nguyen
0fe774511c ASCellNode notifies its layout delegate during layout transition 2016-02-25 12:19:14 -08:00
Adlai Holler
977a509bd4 [ASCellNode] If viewControllerBlock returns an ASViewController, use its node directly instead of wrapping 2016-02-22 15:11:27 -08:00
Adlai Holler
afc70b90ab [ASCellNode] Improve documentation, remove unused ivar 2016-02-22 15:10:02 -08:00
Adlai Holler
563d0893a3 Beef up the properties, beef up the demo app 2016-02-20 15:43:00 -08:00
Scott Goodson
d899f12f70 [ASCellNode] Layout delegate should not be public as it must not be reset externally.
Do not call layout delegate method before the cell node is loaded.  This can happen if
application code calls -setNeedsLayout on the cell manually, and can confuse UIKit state
because we submit an empty batch update call on the next runloop.
2016-02-20 15:24:44 -08:00
Max Gu
115fc2b3da Adding visibility monitoring for ASTableVieww 2016-02-19 22:15:44 -08:00
Max Gu
382509fac8 Letting ASCellNode and its subclasses handle didScroll 2016-02-19 21:30:36 -08:00
Max Gu
53cbd643de Removing ASCellNode+Internal 2016-02-19 14:56:02 -08:00
Max Gu
a834382bcb Update for visibility monitoring 2016-02-19 14:27:22 -08:00
Max Gu
650b500f92 Merge branch 'master' of https://github.com/Xinchi/AsyncDisplayKit 2016-02-19 12:52:03 -08:00
Max Gu
03446d97e1 Adding scroll visibility 2016-02-19 12:46:12 -08:00
Max Gu
75eab1db07 Adding scroll visibility 2016-02-18 18:00:37 -08:00
Scott Goodson
6741ae658e [ASCellNode] Ensure we don't trigger the UIViewController to be created early if we are wrapping one. 2016-01-14 23:28:15 -08:00
Scott Goodson
df9f433353 Prevent calling unsupported UICollectionViewDelegate methods (supplementary view appearance) 2015-12-31 00:21:20 -08:00
Adlai Holler
69767d558e Merge branch 'master' into update-objc
Conflicts:
	AsyncDisplayKit/Private/ASDisplayNode+FrameworkPrivate.h
2015-12-22 00:28:21 -05:00
Luke Parham
322caaeb6a wip after review 2015-12-21 01:24:46 -06:00
Luke Parham
6cbc51dc61 cleaned up comments 2015-12-16 23:44:17 -06:00
Luke Parham
17c985da38 commented some stuff out 2015-12-15 15:30:27 -06:00
Adlai Holler
7079a9cc79 Merge branch 'master' into update-objc
Conflicts:
	AsyncDisplayKit/ASDisplayNode+Subclasses.h
2015-12-13 10:05:03 -08:00
Luke Parham
eeb49859f0 view controller node is resized to match layoutspec for cells 2015-12-09 13:13:39 -06:00
Luke Parham
5e34f10b81 added sample app that initializes ASCollectionView cells using view controllers, wip though 2015-12-08 21:57:14 -06:00
Adlai Holler
b16a9e294e Merge branch 'master' into update-objc
Conflicts:
	AsyncDisplayKit/ASDisplayNode+Subclasses.h
2015-12-06 12:25:13 -08:00
Scott Goodson
840884272d Introduced ASHierarchyState. Created ASDisplayNode+FrameworkPrivate.h. Fixed deadlock. 2015-12-05 22:20:16 -08:00
Adlai Holler
0ee1fd82dc Refactor nodeDidRelayoutWithSizeChange: -> nodeDidRelayout:sizeChanged: 2015-11-30 19:29:27 -08:00
Adlai Holler
04d93532bc Only require node sizes once per run loop, and only if a node's size has changed 2015-11-30 17:20:32 -08:00
Adlai Holler
762be97a51 Merge branch 'master' into update-objc 2015-11-13 12:03:30 -08:00
Adlai Holler
bfe3040f57 Update nullability in ASCellNode.h 2015-11-09 10:10:37 -08:00
Huy Nguyen
5701cbba40 After relayout of a cell node, table and collection views trigger an empty update transaction, instead of a reload 2015-11-04 16:53:33 +02:00
Scott Goodson
e517f88e65 Rename ASCellNode delegate to layoutDelegate to avoid common naming overlap 2015-11-01 12:51:46 -08:00
Huy Nguyen
fb18e7635b Notify ASCellNodeDelegate even if a relayout doesn't result in a resize
If the delegate is an ASTableView, relayoutAnimation will still be considered for animation.
2015-10-29 21:27:29 +02:00
Huy Nguyen
c7d18a4f1b ASTextCellNode triggers a relayout after a text change 2015-10-29 16:59:50 +02:00
Huy Nguyen
00400e166f Introduce ASCellNodeDelegate
- Cell node automatically notifies the delegate after a relayout (via -setNeedsLayout) that results in a new size. Confirming to ASCellNodeDelegate; ASTableView and ASCollectionView reload the calling cell upon notifications. These views automatically set themselves as delegate of every node.
- The result is that ASCellNode subclasses don't need to manually notify the containing view. Thus, `-relayoutItemAtIndexPath` and `-relayoutRowAtIndexPath` are removed.
- Kittens example is updated to reflect the change.
2015-10-29 16:59:46 +02:00
Huy Nguyen
91f3ba1f49 Don't invalidateCalculatedLayout when ASTextCellNode's text is changed
Because calling -invalidateCalculatedLayout removes the current constrained size and therefore any -setNeedsLayout calls in the future won't have a valid constrained size to proceed.

Instead, cell nodes should be relaid-out using the new APIs introduced in ASTableView and ASCollectionView, which are -relayoutRowAtIndexPath:withRowAnimation and -relayoutItemAtIndexPath, respectively.
2015-10-12 21:48:01 +03:00
rcancro
2f3562fa09 scott's comments 2015-09-15 09:11:19 -07:00
rcancro
01be5acece added a callback for initWithViewBlock/initWithLayerBlock 2015-09-14 20:36:08 -07:00
rcancro
c06a6be188 ASLayoutSpec are temporarily mutable and have a more obj-c interface 2015-08-21 16:02:36 -07:00
Huy Nguyen
e1fd58268c Clean up #468:
- -layoutSpecThatFits: must return an ASLayoutSpec.
- Move ASDisplayNode's -measureWithSizeRange: redeclaration to ASDisplayNode.h.
- Rename ASStackLayoutChild.h to ASStackLayoutDefines.h.
- Rename ASStaticLayoutSpecDimension.h to ASRelativeSize.h.
- Don't import ASLayout.h in other headers to prevent circular inclusions.
- Explain use cases of ASLayout's initializers.
- Clean up ASInternalHelpers.h.
2015-07-10 19:41:17 +07:00
Huy Nguyen
9678adaa93 Merge branch 'master' into layout_node 2015-07-06 22:21:32 +07:00
Huy Nguyen
772ed0b019 Fix import in ASCellNode. 2015-07-06 09:15:13 +07:00
Huy Nguyen
2149d44990 Fix naming convetion:
- "Layout node" is changed to "layout spec".
- Update tests.
- Update Kittens sample.
2015-07-01 18:13:44 +07:00
Ethan Nagel
4963a88717 Propagate ASCellNode's clipsToBounds value to the __ASTableViewCell. This helps work around a bug we are seeing in some rare cases (selected background view overlaps other cells if size of ASCellNode has changed.) 2015-06-29 21:22:55 -07:00
Huy Nguyen
dd29a890df Still support -calculateLayoutThatFits: (and manual layout), for backward compatibility. 2015-06-28 20:31:32 +07: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
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
Ryan Nystrom
b6715b5cf9 Forward touches to super instead of the superview
fixes #402
2015-03-26 21:11:13 -07:00
Li Tan
f7f5988fcd Support editing in table view and collection view 2014-12-15 13:19:10 -08:00
Nadine Salter
6c9e499875 Minor ASRangeController improvements (fixes #81). 2014-11-07 15:51:55 -08:00