54 Commits

Author SHA1 Message Date
Huy Nguyen
64e2323a4e Remove ASLayoutNodeSize:
- ASLayoutNode no longer has 'size' constraint during its initialization..
- ASLayoutNode no longer needs parentSize to calculate its layout.
2015-06-25 11:34:36 +07:00
Huy Nguyen
323136298c Update visibility of layout header files. Travis should be happy now. 2015-06-25 11:34:36 +07:00
Huy Nguyen
e23a3fe4c2 Add layout tests. 2015-06-25 11:34:36 +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
Sebastian Rehnby
c215356eb3 Include missing files in iOS Framework target 2015-06-24 15:55:50 +02:00
appleguy
e5f2f820c4 Merge pull request #449 from nrcmedia/master
Added iOS framework target for Carthage support
2015-06-23 10:51:23 -07:00
Rene Cacheaux
777b48cc33 Adds layout controller for collection views. This new layout controller leverages UICollectionViewLayout's layoutAttributesForElementsInRect in order to calculate index paths for items in AsyncDisplayKit ranges. Flow layout is still a requirement in order to test the waters. 2015-06-21 18:37:00 -05:00
Rene Cacheaux
0adac6851a Adds abstract ASLayoutController implementation in preparation for custom layout ASLayoutController implementation. 2015-06-21 13:24:24 -05:00
Rene Cacheaux
e46c13edc5 Exposes ASCollectionView's ability to determine scroll direction. Scroll direction detection can now support 2-axis collection view layouts. ASCollectionView can now determine scrollable axes. 2015-06-21 11:45:25 -05:00
Rene Cacheaux
a7f7620b8c Turns ASScrollDirection into Option set in preparation for supporting 2-axis collection view layouts. Clears test host target warnings. 2015-06-20 18:25:48 -05:00
VictorM
645b3c1e4a Added tests to project file 2015-06-11 10:47:13 +03:00
Niels van Hoorn
b8f60e126a Added iOS framework target for Carthage support 2015-06-09 09:16:06 -07:00
Ryan Nystrom
527a6228a9 Xcode 6.3 support 2015-04-08 16:35:10 -07:00
Nadine Salter
ecd6872814 [tests] AsyncDisplayKitTestHost. 2015-03-23 14:06:38 -07:00
Nadine Salter
b869d025ff [tests] ASSnapshotTestCase. 2015-03-23 14:06:38 -07:00
Ryan Nystrom
7117548bc1 Longer timeout for async tests 2015-03-17 11:44:10 -07:00
Ryan Nystrom
db8bbcfd0e Thread safe creation and canceling of download tasks
fixes #364
2015-03-11 16:52:14 -07:00
Ryan Nystrom
47b53d9293 Stricter build flags for ASDK and tests 2015-03-04 11:09:02 -08:00
Ryan Nystrom
69dbbae91c Fix miscellaneous build failures. 2015-03-02 16:44:25 -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
ad474fce8e Make project imports consistent 2015-02-23 14:55:15 -08:00
Ryan Nystrom
52cbbd3d3c Allow all gestures through ASControlNode
fixes #305
2015-02-11 17:00:44 -08:00
Nadine Salter
c6a04ef8bd Switch ASScrollNode to block initialiser syntax. 2015-02-02 19:41:30 -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
ea6c29fb7f Compile for extensions 2015-01-27 09:30:09 -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
795b297c38 ASEditableTextNode. 2015-01-23 15:02:16 -08:00
Nadine Salter
6d4993f414 -Wall -Werror. 2015-01-14 16:15:04 -08:00
Nadine Salter
7e79950112 Fix build-break. 2014-12-18 18:49:16 -08:00
Li Tan
8b303710b6 fix unncessary change in editing 2014-12-15 15:57:11 -08:00
Li Tan
f7f5988fcd Support editing in table view and collection view 2014-12-15 13:19:10 -08:00
Justin Pasqualini
e098e13884 Setting a node's background color shouldn't require calling setNeedsDisplay explicitly 2014-12-12 15:47:31 -08:00
Nadine Salter
38cc2f6896 Fix header visibility. 2014-12-05 16:16:54 -08:00
Nadine Salter
3c690bf9e5 ASBasicImageDownloader.
This is a simplistic, NSURLSession-based downloader object that
implements ASImageDownloaderProtocol and can be used with
ASMultiplexImageNode and ASNetworkImageNode.

(Closes #115.  NSURLSession should suffice for most usecases, and this
code should provide a good jumping-off point for a more-complex
implementation.)
2014-11-21 18:40:18 -08:00
Nadine Salter
1eda1834e6 ASNetworkImageNode.
Initial open-source release of ASNetworkImageNode, a simple counterpart
to ASMultiplexImageNode.
2014-11-18 18:07:31 -08:00
appleguy
3f7dc75bb1 Merge pull request #101 from nguyenhuy/collection_view
Add ASCollectionView
2014-11-17 19:03:59 -08:00
Nadine Salter
3c8d4e9517 ASMultiplexImageNode.
Initial open-source release of ASMultiplexImageNode.  Documentation and
example code forthcoming.

Note:  ASMultiplexImageNode requires Xcode 6 to compile.  Tests are now
compiled against the iOS 8 SDK and run on iOS 7.1 and iOS 8.
2014-11-17 15:02:17 -08:00
Huy Nguyen
8e0c49a909 Define ASCollectionView interface, ASCollectionViewDataSource and ASCollectionViewDelegate protocols. 2014-11-10 22:56:21 +02:00
Nadine Salter
613acb789c Static library support (fixes #54). 2014-10-22 14:55:49 -07:00
Nadine Salter
367b6da116 Use ASDisplayNodeScreenScale().
ASImageNode and ASHighlightOverlayLayer were both using
[[UIScreen mainScreen] scale] directly.  Bad.  No cookie.  Use
ASDisplayNodeScreenScale() instead.

(Also, regenerate Xcode project with Xcode 6 and current CocoaPods.)
2014-10-22 13:36:40 -07:00
Nadine Salter
6cfb347355 Shared schemes. 2014-10-15 10:52:13 -07:00
Ian Cloutier
41c3289a11 Fix retain cycles in ASDisplayNode and ASTableView 2014-10-09 19:00:38 -04:00
Nadine Salter
05cb52ad21 Fix ASDealloc2MainObject header export. 2014-09-24 14:23:09 -07:00
Nadine Salter
803585164c Convert AsyncDisplayKit to ARC. 2014-09-23 15:30:30 -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