27 Commits

Author SHA1 Message Date
Adlai Holler
b16a9e294e Merge branch 'master' into update-objc
Conflicts:
	AsyncDisplayKit/ASDisplayNode+Subclasses.h
2015-12-06 12:25:13 -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
ab326fc683 touchesCancelled:withEvent: has a nullable touches argument in UIKit for some reason 2015-11-13 12:17:17 -08:00
Adlai Holler
7922895b60 (Re?)add type annotations on touchesBegan:withEvent: et al 2015-11-13 12:11:24 -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
a6807ef477 Address comments in #793 2015-11-04 16:53:36 +02: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
Adlai Holler
b4b88da8cd Merge branch 'master' into update-objc
Conflicts:
	AsyncDisplayKit/ASCellNode.h
2015-11-02 09:36:46 -08: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
5b8f7e978d Improve documentation of ASCellNode setNeedsLayout 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
Adlai Holler
8e104f4887 Merge branch 'master' into update-objc
Conflicts:
	AsyncDisplayKit/ASCollectionView.h
	AsyncDisplayKit/ASDisplayNode.h
	AsyncDisplayKit/Details/ASDataController.h
	AsyncDisplayKit/Details/UIView+ASConvenience.h
	AsyncDisplayKit/Layout/ASLayoutSpec.h
2015-10-28 21:10:27 -07:00
Vitaly Baev
8557d65104 ASCellNode selected/highlighted properties 2015-10-15 13:25:12 +03:00
Adlai Holler
8bb9d173dc Merge branch 'master' into update-objc
Conflicts:
	AsyncDisplayKit/ASDisplayNode+Subclasses.h
	AsyncDisplayKit/ASMultiplexImageNode.h
	AsyncDisplayKit/ASViewController.h
	AsyncDisplayKit/Details/ASDataController.h
2015-10-05 13:24:16 -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
Adlai Holler
37e2a530ad Merge branch 'master' into update-objc 2015-09-19 12:53:06 -07:00
Adlai Holler
03648d12a8 Clarify ASCellNode docs that it is for use with collection view as well 2015-09-17 12:30:31 -07:00
Adlai Holler
a7240bac27 More objective-C cleanup 2015-09-16 15:41:56 -07:00
Adlai Holler
814f72535c Add nullability annotations for public API 2015-09-16 15:21:35 -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
ad474fce8e Make project imports consistent 2015-02-23 14:55:15 -08:00
Nadine Salter
a3e78d1cee Support background colour and selection style on ASCellNodes.
Most UITableViewCell properties aren't useful in conjunction with
ASCellNode -- the system's UIView properties are unsupported for
performance reasons, and properties that configure them (e.g., content
indentation) don't affect custom node hierarchies.  This patch adds
support to _ASTableViewCell for the properties that *are* useful.

r=scottg
2014-11-03 17:45:40 -08:00
Nadine Salter
4ce6820efb [appledoc] Document ASCellNode. 2014-10-17 15:53:11 -07:00
Nadine Salter
7dd94a6102 Merge in downstream changes.
Introduce `ASTableView`, a UITableView subclass that uses `ASCellNode`
instead of UITableViewCell.  Add working range support via
`ASRangeController`, which observes the visible range, maintains a
working range, and handles most ASDK machinery.  ASRangeController is
loosely-enough coupled that it should be easily adapted to
UICollectionView if that's desired in the future.

Notable considerations in the ASRangeController architecture:

* There's no sense rewriting UITableView -- the real win comes from
  using nodes instead of UITableViewCells (easily parallelisable
  computation, large number of cells vs. few table views, etc.).  So,
  use a UITableView with empty cells, using UITableViewCell's
  contentView as a host for arbitrary node hierarchies.

* Instead of lazy-loading cells the instant they're needed by
  UITableView, load them in advance.  Preload a substantial number of
  nodes in the direction of scroll, as well as a small buffer in the
  other direction.

* Maintain compatibility with UITableView's API, with one primary change
  -- consumer code yields configured ASCellNodes, not UITableViewCells.

* Don't use -tableView:heightForRowAtIndexPath:.  Nodes already compute
  their preferred sizes and cache results for use at layout-time, so
  ASTableView uses their calculatedSizes directly.

* Corollary:  ASTableView is only aware of nodes that have been sized.
  This means that, if a cell appears onscreen, it has layout data and
  can display a "realistic placeholder", e.g. by making its subnodes'
  background colour grey.

Other improvements:

* Remove dead references and update headers (fixes #7, #20).

* Rename `-[ASDisplayNode sizeToFit:]` to `-measure:` and fix
  `constrainedSizeForCalulatedSize` typo (fixes #15).

* Rename `-willAppear` and `-didDisappear` to `-willEnterHierarchy` and
  `-didExitHierarchy`.  Remove `-willDisappear` -- it was redundant, and
  there was no counterpart `-didAppear`.

* Rename `viewLoaded` to `nodeLoaded`.
2014-09-22 14:33:39 -07:00