diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100755 index 00000000..bd5d1888 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,2 @@ +_site/ + diff --git a/docs/404.md b/docs/404.md new file mode 100755 index 00000000..259ecac4 --- /dev/null +++ b/docs/404.md @@ -0,0 +1,11 @@ +--- +id: 4oh4 +title: Page Not Found +layout: default +--- + +# Page Not Found + +Crikey! There doesn't seem to be anything here. + +If you find a broken link, feel free to send a pull request. You can also let us know at [Github](https://github.com/facebook/AsyncDisplayKit/issues) so that we can fix it. diff --git a/docs/CNAME b/docs/CNAME new file mode 100755 index 00000000..08060e08 --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +asyncdisplaykit.org diff --git a/docs/Gemfile b/docs/Gemfile new file mode 100755 index 00000000..99e72d83 --- /dev/null +++ b/docs/Gemfile @@ -0,0 +1,5 @@ +source 'https://rubygems.org' + +gem 'github-pages' +gem 'rouge', '~>1.7' +gem 'jekyll', '~>3.2.0' diff --git a/docs/README.md b/docs/README.md new file mode 100755 index 00000000..1c83038e --- /dev/null +++ b/docs/README.md @@ -0,0 +1,31 @@ +# AsyncDisplayKit Documentation + +We use [Jekyll](http://jekyllrb.com/) to build the site using Markdown and host it on [Github Pages](https://pages.github.com/). + +### Dependencies + +Github Pages uses Jekyll to host a site and Jekyll has the following dependencies. + + - [Ruby](http://www.ruby-lang.org/) (version >= 2.0.0) + - [RubyGems](http://rubygems.org/) (version >= 1.3.7) + - [Bundler](http://gembundler.com/) + +Mac OS X comes pre-installed with Ruby, but you may need to update RubyGems (via `gem update --system`). +Once you have RubyGems, use it to install bundler. + +```sh +$ gem install bundler +$ cd gh-pages # Go to folder +$ bundle install # Might need sudo. +``` + +### Run Jekyll Locally + +Use Jekyll to serve the website locally (by default, at `http://localhost:4000`): + +```sh +$ bundle exec jekyll serve [--incremental] +$ open http://localhost:4000/ +``` + +For more, see https://help.github.com/articles/setting-up-your-github-pages-site-locally-with-jekyll/ diff --git a/docs/_config.yml b/docs/_config.yml new file mode 100755 index 00000000..6bde53e0 --- /dev/null +++ b/docs/_config.yml @@ -0,0 +1,24 @@ +--- +url: http://asyncdisplaykit.org +name: AsyncDisplayKit +relative_permalinks: false +markdown: kramdown +timezone: America/Los_Angeles +google_analytics: UA-87502907-1 + +safe: true +lsi: false +highlighter: rouge + +defaults: + - + scope: + path: "" + type: "posts" + values: + layout: post + is_post: true + +collections: + docs: + output: true diff --git a/docs/_data/nav_docs.yml b/docs/_data/nav_docs.yml new file mode 100755 index 00000000..91e76d34 --- /dev/null +++ b/docs/_data/nav_docs.yml @@ -0,0 +1,72 @@ +- title: Quick Start + items: + - getting-started + - resources + - installation + - adoption-guide-2-0-beta1 +- title: Core Concepts + items: + - intelligent-preloading + - containers-overview + - node-overview + - subclassing + - node-lifecycle + - faq +- title: Layout + items: + - layout2-quickstart + - automatic-layout-examples-2 + - layout2-layoutspec-types + - layout2-layout-element-properties + - layout2-api-sizing + - layout-transition-api +- title: Conveniences + items: + - hit-test-slop + - batch-fetching-api + - automatic-subnode-mgmt + - inversion + - image-modification-block + - placeholder-fade-duration + - accessibility + - uicollectionviewinterop +- title: Optimizations + items: + - layer-backing + - subtree-rasterization + - synchronous-concurrency + - corner-rounding +- title: Tools + items: + - debug-tool-hit-test-visualization + - debug-tool-pixel-scaling + - debug-tool-ASRangeController +- title: Advanced Technologies + items: + - asvisibility + - asenvironment + - asrunloopqueue +- title: Node Containers + items: + - containers-asviewcontroller + - containers-asnodecontroller + - containers-astablenode + - containers-ascollectionnode + - containers-aspagernode +- title: Nodes + items: + - display-node + - cell-node + - button-node + - text-node + - image-node + - network-image-node + - video-node + - map-node + - control-node + - scroll-node + - editable-text-node + - multiplex-image-node + + + diff --git a/docs/_docs/accessibility.md b/docs/_docs/accessibility.md new file mode 100755 index 00000000..ef13ab94 --- /dev/null +++ b/docs/_docs/accessibility.md @@ -0,0 +1,11 @@ +--- +title: Accessibility +layout: docs +permalink: /docs/accessibility.html +prevPage: placeholder-fade-duration.html +nextPage: layer-backing.html +--- + +Accessibility works seamlessly in ways that even UIKit doesn’t provide. When using the powerful optimization features of Layer Backing (`.layerBacked`) and Subtree Rasterization (`.shouldRasterizeDescendants`), VoiceOver can access fine-grained metadata about each element. This is pretty amazing: `CALayer` doesn’t support accessibility, and rasterization reduces everything to a single flat image. + +The AsyncDisplayKit team fundamentally believes in Accessibility, and invested the time to create an innovative system to make this possible with zero developer effort. As a bonus, this also allows Automated UI Testing greater access to the interface. \ No newline at end of file diff --git a/docs/_docs/adoption-guide-2-0-beta1.md b/docs/_docs/adoption-guide-2-0-beta1.md new file mode 100755 index 00000000..26294d53 --- /dev/null +++ b/docs/_docs/adoption-guide-2-0-beta1.md @@ -0,0 +1,146 @@ +--- +title: "Upgrading to 2.0" +layout: docs +permalink: /docs/adoption-guide-2-0-beta1.html +prevPage: adoption-guide-2-0-beta1.html +--- + +
    +
  1. GitHub Release Notes
  2. +
  3. Getting the 2.0 Release Candidate
  4. +
  5. Testing your app with 2.0
  6. +
  7. Migrating to 2.0
  8. +
  9. Migrating to 2.0 (Layout)
  10. +
+ +## Release Notes + +Please read the official release notes on GitHub. + + +## Getting the Release Candidate + +Add the following to your podfile + +
+
+
+pod 'AsyncDisplayKit', '>= 2.0'
+
+
+
+ +then run + +
+
+
+pod repo update
+pod update AsyncDisplayKit
+
+
+
+ +in the terminal. + +## Testing 2.0 + +Once you have updated to 2.0, you will see many deprecation warnings. Don't worry! + +These warnings are quite safe, because we have bridged all of the old APIs for you, so that you can test out the 2.0, before migrating to the new API. + +If your app fails to build instead of just showing the warnings, you might have Warnings as Errors enabled for your project. You have a few options: + +1. Disable deprecation warnings in the Xcode project settings +2. Disable warnings as errors in the project's build settings. +3. Disable deprecation warnings in ASDK. To do this, change `line 74` in `ASBaseDefines.h` to `# define ASDISPLAYNODE_WARN_DEPRECATED 0` + +Once your app builds and runs, test it to make sure everything is working normally. If you find any problems, try adopting the new API in that area and re-test. + +One key behavior change you may notice: + +- ASStackLayoutSpec's `.alignItems` property default changed to `ASStackLayoutAlignItemsStretch` instead of `ASStackLayoutAlignItemsStart`. This may cause distortion in your UI. + +If you still have issues, please file a GitHub issue and we'd be happy to help you out! + +## Migrating to 2.0 + +Once your app is working, it's time to start converting! + +A full API changelog from `1.9.92` to `2.0-beta.1` is available here. + +#### ASDisplayNode Changes + +- ASDisplayNode's `.usesImplicitHierarchyManagement` has been renamed to `.automaticallyManagesSubnodes`. The Automatic Subnode Management API has been moved out of Beta, but has a few documented [limitations](). + +- ASDisplayNode's `-cancelLayoutTransitionsInProgress` has been renamed to `-cancelLayoutTransition`. The Layout Transition API has been moved out of Beta. Significant new functionality is planed for future dot releases. + + +#### Updated Interface State Callback Methods + +The new method names are meant to unify the range update methods to show how they relate to each other and be a bit more self-explanatory: + +- `didEnterPreloadState / didExitPreloadState` +- `didEnterDisplayState / didExitDisplayState` +- `didEnterVisibleState / didExitVisibleState` + +These new methods replace the following: + +- `loadStateDidChange:(BOOL)inLoadState` +- `displayStateDidChange:(BOOL)inDisplayState` +- `visibleStateDidChange:(BOOL)isVisible` + +#### Collection / Table API Updates + +AsyncDisplayKit's collection and table APIs have been moved from the view space (`collectionView`, `tableView`) to the node space (`collectionNode`, `tableNode`). + +- Search your project for `tableView` and `collectionView`. Most, if not all, of the data source / delegate methods have new node versions. + +It is important that developers using AsyncDisplayKit understand that an ASCollectionNode is backed by an ASCollectionView (a subclass of UICollectionView). ASCollectionNode runs asynchronously, so calling number -numberOfRowsInSection on the collectionNode is different than calling it on the collectionView. + +For example, let's say you have an empty table. You insert `100` rows and then immediately call -tableView:numberOfRowsInSection. This will return `0` rows. If you call -waitUntilAllUpdatesAreCommitted after insertion (waits until the collectionNode synchronizes with the collectionView), you will get 100, _but_ you might block the main thread. A good developer should rarely (or never) need to use -waitUntilAllUpdatesAreCommitted. If you update the collectionNode and then need to read back immediately, you should use the collectionNode API. You shouldn't need to talk to the collectionView. + +As a rule of thumb, use the collection / table node API for everything, unless the API is not available on the collectionNode. + +To summarize, any `indexPath` that is passed to the `collectionView` space references data that has been synced with `ASCollectionNode`'s underlying `UICollectionView`. Conversly, any `indexPath` that is passed to the `collectionNode` space references asynchronous data that *might not yet* have been synced with ASCollectionNode's underlying `UICollectionView`. The same concepts apply to `ASTableNode`. + +An exception to this is `ASTableNode`'s `-didSelectRowAtIndexPath:`, which is called in UIKit space to make sure that `indexPath` indicies reference the data in the onscreen (data that has been synced to the underlying `UICollectionView` `dataSource`). + +While previous versions of the framework required the developer to be aware of the asynchronous interplay between `ASCollectionNode` and its underlying `UICollectionView`, this new API should provide better safegaurds against developer-introduced data source inconsistencies. + +Other updates include: + +- Deprecate `ASTableView`'s -init method. Please use `ASTableNode` instead of `ASTableView`. While this makes adopting the framework marginally more difficult to, the benefits of using ASTableNode / ASCollectionNode over their ASTableView / ASCollectionView counterparts are signficant. + +- Deprecate `-beginUpdates` and `-endUpdatesAnimated:`. Please use the `-performBatchUpdates:` methods instead. + +- Deprecate `-reloadDataImmediately`. Please see the header file comments for the deprecation solution. + +- Moved range tuning to the `tableNode` / `collectionNode` (from the `tableView` / `collectionView`) + +- `constrainedSizeForNodeAtIndexPath:` moved from the `.dataSource` to the `.delegate` to be consistent with UIKit definitions of the roles. **Note:** Make sure that you provide a delegate for any `ASTableNode`, `ASCollectionNode` or `ASPagerNodes` that use this method. Your code will silently not call your delegate method, if you do not have a delegate assigned. + +- Renamed `pagerNode:constrainedSizeForNodeAtIndexPath:` to `pagerNode:constrainedSizeForNodeAtIndex:` + +- collection view update validation assertions are now enabled. If you see something like `"Invalid number of items in section 2. The number of items after the update (7) must be equal to the number of items before the update (4) plus or minus the number of items inserted or removed from the section (4 inserted, 0 removed)”`, please check the data source logic. If you have any questions, reach out to us on GitHub. + +Best Practices: + +- Use node blocks if possible. These are run in parallel on a background thread, resulting in 10x performance gains. +- Use nodes to store things about your rows. +- Make sure to batch updates that need to be batched. + +Resources: + +- [Video](https://youtu.be/yuDqvE5n_1g) of the ASCollectionNode Behind-the-Scenes talk at Pinterest. The diagrams seen in the talk. + +- PR [#2390](https://github.com/facebook/AsyncDisplayKit/pull/2390) and PR [#2381](https://github.com/facebook/AsyncDisplayKit/pull/2381) show how we converted AsyncDisplayKit's [example projects](https://github.com/facebook/AsyncDisplayKit/tree/master/examples) to conform to this new API. + + +#### Layout API Updates + +Please read the separate Layout 2.0 Conversion Guide for an overview of the upgrades and to see how to convert your existing layout code. + +#### Help us out + +If we're missing something from this list, please let us know or edit this doc for us (GitHub edit link at the top of page)! diff --git a/docs/_docs/apidiff-1992-to-20beta1.md b/docs/_docs/apidiff-1992-to-20beta1.md new file mode 100755 index 00000000..bc681276 --- /dev/null +++ b/docs/_docs/apidiff-1992-to-20beta1.md @@ -0,0 +1,7 @@ +--- +title: API Diff +layout: apidiff +permalink: /docs/apidiff-1992-to-20beta1.html +--- + + diff --git a/docs/_docs/appledocs.md b/docs/_docs/appledocs.md new file mode 100755 index 00000000..4b466e99 --- /dev/null +++ b/docs/_docs/appledocs.md @@ -0,0 +1,9 @@ + +--- +title: api +layout: docs +permalink: /docs/appledocs.html +--- + +

hi

+ \ No newline at end of file diff --git a/docs/_docs/asenvironment.md b/docs/_docs/asenvironment.md new file mode 100755 index 00000000..b2e0432c --- /dev/null +++ b/docs/_docs/asenvironment.md @@ -0,0 +1,19 @@ +--- +title: ASEnvironment +layout: docs +permalink: /docs/asenvironment.html +prevPage: asvisibility.html +nextPage: asrunloopqueue.html +--- + +`ASEnvironment` is a performant and scalable way to enable upward and downward propagation of information throughout the node hierarchy. It stores a variety of critical “environmental” metadata, like the trait collection, interface state, hierarchy state, and more. + +Any object that conforms to the `` protocol can propagate specific states defined in an `ASEnvironmentState` up and/or down the ASEnvironment tree. To define how merges of States should happen, specific merge functions can be provided. + +Compared to UIKit, this system is very efficient and one of the reasons why nodes are much lighter weight than UIViews. This is achieved by using simple structures to store data rather than creating objects. For example, `UITraitCollection` is an object, but `ASEnvironmentTraitCollection` is just a struct. + +This means that whenever a node needs to query something about its environment, for example to check its [interface state](http://asyncdisplaykit.org/docs/intelligent-preloading.html#interface-state-ranges), instead of climbing the entire tree or checking all of its children, it can go to one spot and read the value that was propogated to it. + +A key operating principle of ASEnvironment is to update values when new subnodes are added or removed. + +ASEnvironment powers many of the most valuable features of AsyncDisplayKit. **There is no public API available at this time.** diff --git a/docs/_docs/asrunloopqueue.md b/docs/_docs/asrunloopqueue.md new file mode 100755 index 00000000..24344087 --- /dev/null +++ b/docs/_docs/asrunloopqueue.md @@ -0,0 +1,14 @@ +--- +title: ASRunLoopQueue +layout: docs +permalink: /docs/asrunloopqueue.html +prevPage: asenvironment.html +--- + +Even with main thread work, AsyncDisplayKit is able to dramatically reduce its impact on the user experience by way of the rather amazing ASRunLoopQueue. + +`ASRunloopQueue` breaks up operations that must be performed on the main thread into far smaller chunks, easily 1/10th of the size that they otherwise would be, so that operation such as allocating UIViews or even destroying objects can be spread out and allow the run loops to more frequently turn. This more periodic turning allows the device to much more frequently check if a user touch has started or if an animation timer requires a new frame to be drawn, allowing far greater responsiveness even when the device is very busy and processing a large queue of main thread work. + +It's a longer discussion why this kind of technique is extremely challenging to implement with `UIKit`, but it has to do with the fact that `AsyncDisplayKit` prepares content in advance, giving it a buffer of time where it can spread out the creation of these objects in tiny chunks. If it doesn't finish by the time it needs to be on screen, then it finishes the rest of what needs to be created in a single chunk. `UIKit` has no similar mechanisms to create things in advance, and there is always just one huge chunk as a view controller or cell needs to come on screen. + +**ASRunLoopQueue is enabled by default when running AsyncDisplayKit.** A developer does not need to be aware of it's existence except to know that it helps reduce main thread blockage. diff --git a/docs/_docs/asviewcontroller.md b/docs/_docs/asviewcontroller.md new file mode 100755 index 00000000..9cba5be9 --- /dev/null +++ b/docs/_docs/asviewcontroller.md @@ -0,0 +1,55 @@ +--- +title: ASViewController +layout: docs +permalink: /docs/asviewcontroller.html +prevPage: +nextPage: aspagernode.html +--- + +`ASViewController` is a direct subclass of `UIViewController`. For the most part, it can be used in place of any `UIViewController` relatively easily. + +The main difference is that you construct and return the node you'd like managed as opposed to the way `UIViewController` provides a view of its own. + +Consider the following `ASViewController` subclass that would like to use a custom table node as its managed node. + +
+SwiftObjective-C +
+
+- (instancetype)initWithModel:(NSArray *)models
+{
+    ASTableNode *tableNode = [[ASTableNode alloc] initWithStyle:UITableViewStylePlain];
+
+    if (!(self = [super initWithNode:tableNode])) { return nil; }
+
+    self.models = models;
+    
+    self.tableNode = tableNode;
+    self.tableNode.dataSource = self;
+    
+    return self;
+}
+
+ + +
+
+ +The most important line is: + +`if (!(self = [super initWithNode:tableNode])) { return nil; }` + +As you can see, `ASViewController`'s are initialized with a node of your choosing. diff --git a/docs/_docs/asvisibility.md b/docs/_docs/asvisibility.md new file mode 100755 index 00000000..6ca8ef2d --- /dev/null +++ b/docs/_docs/asvisibility.md @@ -0,0 +1,15 @@ +--- +title: ASVisibility +layout: docs +permalink: /docs/asvisibility.html +prevPage: debug-tool-ASRangeController.html +nextPage: asenvironment.html +--- + +`ASNavigationController` and `ASTabBarController` both implement the `ASVisibility` protocol. These classes can be used even without `ASDisplayNodes`, making them suitable base classes for your inheritance hierarchy. For any child view controllers that are `ASViewControllers`, these classes know the exact number of user taps it would take to make the view controller visible (0 if currently visible). + +Knowing a view controller’s visibility depth allows view controllers to automatically take appropriate actions as a user approaches or leaves them. Non-default tabs in an app might preload some of their data; a controller 3 levels deep in a navigation stack might progressively free memory for images, text, and fetched data as it gets deeper. + +Any container view controller can implement a simple protocol to integrate with the system. For example, `ASNavigationController` will return a visibility depth of it's own `visibilityDepth` + 1 for a view controller that would be revealed by tapping the back button once. + +You can opt into some of this behavior automatically by enabling `automaticallyAdjustRangeModeBasedOnViewEvents` on `ASViewController`s. With this enabled, if either the view controller or its node conform to `ASRangeControllerUpdateRangeProtocol` (`ASCollectionNode` and `ASTableNode` do by default), the ranges will automatically be decreased as the visibility depth increases to save memory. diff --git a/docs/_docs/automatic-layout-basics.md b/docs/_docs/automatic-layout-basics.md new file mode 100755 index 00000000..85b50d3e --- /dev/null +++ b/docs/_docs/automatic-layout-basics.md @@ -0,0 +1,36 @@ +--- +title: Layout Basics +layout: docs +permalink: /docs/automatic-layout-basics.html +prevPage: scroll-node.html +nextPage: automatic-layout-containers.html +--- + +##Box Model Layout + +ASLayout is an automatic, asynchronous, purely Objective-C box model layout feature. It is a simplified version of CSS flex box, loosely inspired by ComponentKit’s Layout. It is designed to make your layouts extensible and reusable. + +`UIView` instances store position and size in their `center` and `bounds` properties. As constraints change, Core Animation performs a layout pass to call `layoutSubviews`, asking views to update these properties on their subviews. + +`` instances (all ASDisplayNodes and subclasses) do not have any size or position information. Instead, AsyncDisplayKit calls the `layoutSpecThatFits:` method with a given size constraint and the component must return a structure describing both its size, and the position and sizes of its children. + +##Terminology + +The terminology is a bit confusing, so here is a brief description of all of the ASDK automatic layout players: + +Items that conform to the **\ protocol** declares a method for measuring the layout of an object. A layout is defined by an ASLayout return value, and must specify 1) the size (but not position) of the layoutable object, and 2) the size and position of all of its immediate child objects. The tree recursion is driven by parents requesting layouts from their children in order to determine their size, followed by the parents setting the position of the children once the size is known. + +This protocol also implements a "family" of layoutable protocols - the `AS{*}LayoutSpec` protocols. These protocols contain layout options that can be used for specific layout specs. For example, `ASStackLayoutSpec` has options defining how a layoutable should shrink or grow based upon available space. These layout options are all stored in an `ASLayoutOptions` class (that is defined in `ASLayoutablePrivate`). Generally you needn't worry about the layout options class, as the layoutable protocols allow all direct access to the options via convenience properties. If you are creating custom layout spec, then you can extend the backing layout options class to accommodate any new layout options. + +All ASDisplayNodes and subclasses as well as the `ASLayoutSpecs` conform to this protocol. + +An **`ASLayoutSpec`** is an immutable object that describes a layout. Creation of a layout spec should only happen by a user in layoutSpecThatFits:. During that method, a layout spec can be created and mutated. Once it is passed back to ASDK, the isMutable flag will be set to NO and any further mutations will cause an assert. + +Every ASLayoutSpec must act on at least one child. The ASLayoutSpec has the responsibility of holding on to the spec children. Some layout specs, like ASInsetLayoutSpec, only require a single child. Others, have multiple. + +You don’t need to be aware of **`ASLayout`** except to know that it represents a computed immutable layout tree and is returned by objects conforming to the `` protocol. + +##Layout for UIKit Components: +- for UIViews that are added directly, you will still need to manually lay it out in `didLoad:` +- for UIViews that are added via `[ASDisplayNode initWithViewBlock:]` or its variants, you can then include it in `layoutSpecThatFits:` + diff --git a/docs/_docs/automatic-layout-containers.md b/docs/_docs/automatic-layout-containers.md new file mode 100755 index 00000000..05655ee5 --- /dev/null +++ b/docs/_docs/automatic-layout-containers.md @@ -0,0 +1,192 @@ +--- +title: LayoutSpecs +layout: docs +permalink: /docs/automatic-layout-containers.html +prevPage: scroll-node.html +nextPage: layout-api-debugging.html +--- + +AsyncDisplayKit includes a library of `layoutSpec` components that can be composed to declaratively specify a layout. + +The **child(ren) of a layoutSpec may be a node, a layoutSpec or a combination of the two types.** In the below image, an `ASStackLayoutSpec` (vertical) containing a text node and an image node, is wrapped in another `ASStackLayoutSpec` (horizontal) with another text node. + + + +Both nodes and layoutSpecs conform to the `` protocol. Any `ASLayoutable` object may be the child of a layoutSpec. ASLayoutable properties may be applied to `ASLayoutable` objects to create complex UI designs. + +### Single Child layoutSpecs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LayoutSpecDescription
ASInsetLayoutSpec

Applies an inset margin around a component.

The object that is being inset must have an intrinsic size.

ASOverlayLayoutSpec

Lays out a component, stretching another component on top of it as an overlay.

The underlay object must have an intrinsic size. Additionally, the order in which subnodes are added matters for this layoutSpec; the overlay object must be added as a subnode to the parent node after the underlay object.

ASBackgroundLayoutSpec

Lays out a component, stretching another component behind it as a backdrop.

The foreground object must have an intrinsic size. The order in which subnodes are added matters for this layoutSpec; the background object must be added as a subnode to the parent node before the foreground object.

ASCenterLayoutSpec

Centers a component in the available space.

The ASCenterLayoutSpec must have an intrinisic size.

ASRatioLayoutSpec

Lays out a component at a fixed aspect ratio (which can be scaled).

This spec is great for objects that do not have an intrinisic size, such as ASNetworkImageNodes and ASVideoNodes.

ASRelativeLayoutSpec

Lays out a component and positions it within the layout bounds according to vertical and horizontal positional specifiers. Similar to the “9-part” image areas, a child can be positioned at any of the 4 corners, or the middle of any of the 4 edges, as well as the center.

ASLayoutSpec

Can be used as a spacer in a stack spec with other children, when .flexGrow and/or .flexShrink is applied.

This class can also be subclassed to create custom layout specs - advanced ASDK only!

+ +### Multiple Child(ren) layoutSpecs + +The following layoutSpecs may contain one or more children. + + + + + + + + + + + + + + +
LayoutSpecDescription
ASStackLayoutSpec

Allows you to stack components vertically or horizontally and specify how they should be flexed and aligned to fit in the available space.

This is the most common layoutSpec.

ASStaticLayoutSpecAllows positioning children at fixed offsets using the .sizeRange and .layoutPosition ASLayoutable properties.
+ +# ASLayoutable Properties + +The following properties can be applied to both nodes _and_ `layoutSpec`s; both conform to the `ASLayoutable` protocol. + +### ASStackLayoutable Properties + +The following properties may be set on any node or `layoutSpec`s, but will only apply to those who are a **child of a stack** `layoutSpec`. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyDescription
CGFloat .spacingBeforeAdditional space to place before this object in the stacking direction.
CGFloat .spacingAfterAdditional space to place after this object in the stacking direction.
BOOL .flexGrowIf the sum of childrens' stack dimensions is less than the minimum size, should this object grow? Used when attached to a stack layout.
BOOL .flexShrinkIf the sum of childrens' stack dimensions is greater than the maximum size, should this object shrink? Used when attached to a stack layout.
ASRelativeDimension .flexBasisSpecifies the initial size for this object, in the stack dimension (horizontal or vertical), before the flexGrow or flexShrink properties are applied and the remaining space is distributed.
ASStackLayoutAlignSelf alignSelfOrientation of the object along cross axis, overriding alignItems. Used when attached to a stack layout.
CGFloat .ascenderUsed for baseline alignment. The distance from the top of the object to its baseline.
CGFloat .descenderUsed for baseline alignment. The distance from the baseline of the object to its bottom.
+ +### ASStaticLayoutable Properties + +The following properties may be set on any node or `layoutSpec`s, but will only apply to those who are a **child of a static** `layoutSpec`. + + + + + + + + + + + + + + +
PropertyDescription
.sizeRangeIf specified, the child's size is restricted according to this ASRelativeSizeRange. Percentages are resolved relative to the static layout spec.
.layoutPositionThe CGPoint position of this object within its parent spec.
+ +### Providing Intrinsic Sizes for Leaf Nodes + +AsyncDisplayKit's layout is recursive, starting at the layoutSpec returned from `layoutSpecThatFits:` and proceeding down until it reaches the leaf nodes included in any nested `layoutSpec`s. + +Some leaf nodes provide their own intrinsic size, such as `ASTextNode` or `ASImageNode`. An attributed string or an image have their own sizes. Other leaf nodes require an intrinsic size to be set. + +**Nodes that require the developer to provide an intrinsic size:** + + - `ASDisplayNode` custom subclasses may provide their intrinisc size by implementing `calculateSizeThatFits:`. + - `ASNetworkImageNode` or `ASMultiplexImageNode` have no intrinsic size until the image is downloaded. + - `ASVideoNode` or `ASVideoNodePlayer` have no intrinsic size until the video is downloaded. + + +To provide an intrinisc size for these nodes, you can set one of the following: + + 1. implement `calculateSizeThatFits:` for **custom ASDisplayNode subclasses** only. + 2. set `.preferredFrameSize` + 3. set `.sizeRange` for children of **static** nodes only. + + +Note that `.preferredFrameSize` is not considered by `ASTextNodes`. Also, setting .sizeRange on a node will override the node's intrinisic size provided by `calculateSizeThatFits:`. + +### Common Confusions + +There are two main confusions that developers have when using layoutSpecs + + 1. Certain ASLayoutable properties only apply to children of stack nodes, while other properties only apply to children of static nodes. All ASLayoutable properties can be applied to any node or layoutSpec, however certain properties will only take effect depending on the type of the parent layoutSpec they are wrapped in. These differences are highlighted above in the ASStackLayoutable Properties and ASStaticLayoutable Properties sections. + 2. Have I set an intrinsic size for all of my leaf nodes? + + +#### I set `.flexGrow` on my node, but it doesn't grow? + +Upward propogation of `ASLayoutable` properties is currently disabled. Thus, in certain situations, the `.flexGrow` property must be manually applied to the containers. Two common examples of this that we see include: + +- a node (with `flexGrow` enabled) is wrapped in a static layoutSpec, wrapped in a stack layoutSpec. **solution**: enable `flexGrow` on the static layoutSpec as well. +- a node (with `flexGrow` enabled) is wrapped in an inset spec. **solution**: enable `flexGrow` on the inset spec as well. + + +#### I want to provide a size for my image, but I don't want to hard code the size. + +#### Why won't my stack spec span the full width? + +#### Difference between `ASInsetLayoutSpec` and `ASOverlayLayoutSpec` + +An overlay spec requires the underlay object (object to which the overlay item will be applied) to have an intrinsic size. It will center the overlay object in the middle of this area. + +An inset spec requires its object to have an intrinsic size. It adds the inset padding to this size to calculate the final size of the inset spec. + + + +### Best Practices + - AsyncDisplayKit layout is called on a background thread. Do not access the device screen bounds, or any other UIKit methods in `layoutSpecThatFits:`. + - don't wrap everything in a staticLayoutSpec? + - avoid using preferred frame size for everything - won't respond nicely to device rotation or device sizing differences? diff --git a/docs/_docs/automatic-layout-examples-2.md b/docs/_docs/automatic-layout-examples-2.md new file mode 100755 index 00000000..eb55c2f5 --- /dev/null +++ b/docs/_docs/automatic-layout-examples-2.md @@ -0,0 +1,264 @@ +--- +title: Layout Examples +layout: docs +permalink: /docs/automatic-layout-examples-2.html +prevPage: layout2-quickstart.html +nextPage: layout2-layoutspec-types.html +--- + +Check out the layout specs example project to play around with the code below. + +## Simple Header with Left and Right Justified Text + + + +To create this layout, we will use a: + +- a vertical `ASStackLayoutSpec` +- a horizontal `ASStackLayoutSpec` +- `ASInsetLayoutSpec` to inset the entire header + +The diagram below shows the composition of the layout elements (nodes + layout specs). + + + +
+ + Swift + Objective-C + +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+  // when the username / location text is too long, 
+  // shrink the stack to fit onscreen rather than push content to the right, offscreen
+  ASStackLayoutSpec *nameLocationStack = [ASStackLayoutSpec verticalStackLayoutSpec];
+  nameLocationStack.style.flexShrink = 1.0;
+  nameLocationStack.style.flexGrow = 1.0;
+  
+  // if fetching post location data from server, 
+  // check if it is available yet and include it if so
+  if (_postLocationNode.attributedText) {
+    nameLocationStack.children = @[_usernameNode, _postLocationNode];
+  } else {
+    nameLocationStack.children = @[_usernameNode];
+  }
+  
+  // horizontal stack
+  ASStackLayoutSpec *headerStackSpec = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionHorizontal
+                                                                               spacing:40
+                                                                        justifyContent:ASStackLayoutJustifyContentStart
+                                                                            alignItems:ASStackLayoutAlignItemsCenter
+                                                                              children:@[nameLocationStack, _postTimeNode]];
+  
+  // inset the horizontal stack
+  return [ASInsetLayoutSpec insetLayoutSpecWithInsets:UIEdgeInsetsMake(0, 10, 0, 10) child:headerStackSpec];
+}
+  
+ +
+
+ +Rotate the example project from portrait to landscape to see how the spacer grows and shrinks. + +## Photo with Inset Text Overlay + + + +To create this layout, we will use a: + +- `ASInsetLayoutSpec` to inset the text +- `ASOverlayLayoutSpec` to overlay the inset text spec on top of the photo + +
+ + Swift + Objective-C + +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+  _photoNode.style.preferredSize = CGSizeMake(USER_IMAGE_HEIGHT*2, USER_IMAGE_HEIGHT*2);
+
+  // INIFINITY is used to make the inset unbounded
+  UIEdgeInsets insets = UIEdgeInsetsMake(INFINITY, 12, 12, 12);
+  ASInsetLayoutSpec *textInsetSpec = [ASInsetLayoutSpec insetLayoutSpecWithInsets:insets child:_titleNode];
+  
+  return [ASOverlayLayoutSpec overlayLayoutSpecWithChild:_photoNode overlay:textInsetSpec];
+}
+  
+ +
+
+ +## Photo with Outset Icon Overlay + + + +To create this layout, we will use a: + +- `ASAbsoluteLayoutSpec` to place the photo and icon which have been individually sized and positioned using their `ASLayoutable` properties + +
+ + Swift + Objective-C + +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+  _iconNode.style.preferredSize = CGSizeMake(40, 40);
+  _iconNode.style.layoutPosition = CGPointMake(150, 0);
+  
+  _photoNode.style.preferredSize = CGSizeMake(150, 150);
+  _photoNode.style.layoutPosition = CGPointMake(40 / 2.0, 40 / 2.0);
+  
+  return [ASAbsoluteLayoutSpec absoluteLayoutSpecWithSizing:ASAbsoluteLayoutSpecSizingSizeToFit
+                                                   children:@[_photoNode, _iconNode]];
+}
+  
+ +
+
+ + + +## Simple Inset Text Cell + + + +To recreate the layout of a single cell as is used in Pinterest's search view above, we will use a: + +- `ASInsetLayoutSpec` to inset the text +- `ASCenterLayoutSpec` to center the text according to the specified properties + +
+ + Swift + Objective-C + +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+    UIEdgeInsets insets = UIEdgeInsetsMake(0, 12, 4, 4);
+    ASInsetLayoutSpec *inset = [ASInsetLayoutSpec insetLayoutSpecWithInsets:insets
+                                                                      child:_titleNode];
+
+    return [ASCenterLayoutSpec centerLayoutSpecWithCenteringOptions:ASCenterLayoutSpecCenteringY
+                                                      sizingOptions:ASCenterLayoutSpecSizingOptionMinimumX
+                                                              child:inset];
+}
+  
+ +
+
+ +## Top and Bottom Separator Lines + + + +To create the layout above, we will use a: + +- a `ASInsetLayoutSpec` to inset the text +- a vertical `ASStackLayoutSpec` to stack the two separator lines on the top and bottom of the text + +The diagram below shows the composition of the layoutables (layout specs + nodes). + + + +The following code can also be found in the `ASLayoutSpecPlayground` [example project](). + +
+ + Swift + Objective-C + +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+  _topSeparator.style.flexGrow = 1.0;
+  _bottomSeparator.style.flexGrow = 1.0;
+
+  ASInsetLayoutSpec *insetContentSpec = [ASInsetLayoutSpec insetLayoutSpecWithInsets:UIEdgeInsetsMake(20, 20, 20, 20) child:_textNode];
+
+  return [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionVertical
+                                                 spacing:0
+                                          justifyContent:ASStackLayoutJustifyContentCenter
+                                              alignItems:ASStackLayoutAlignItemsStretch
+                                                children:@[_topSeparator, insetContentSpec, _bottomSeparator]];
+}
+  
+ +
+
diff --git a/docs/_docs/automatic-layout-examples.md b/docs/_docs/automatic-layout-examples.md new file mode 100755 index 00000000..7b2b4139 --- /dev/null +++ b/docs/_docs/automatic-layout-examples.md @@ -0,0 +1,204 @@ +--- +title: Layout Examples +layout: docs +permalink: /docs/automatic-layout-examples.html +prevPage: automatic-layout-containers.html +nextPage: automatic-layout-debugging.html +--- + +Three examples in increasing order of complexity. +#NSSpain Talk Example + + + +
+SwiftObjective-C + +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constraint
+{
+  ASStackLayoutSpec *vStack = [[ASStackLayoutSpec alloc] init];
+  
+  [vStack setChildren:@[titleNode, bodyNode];
+
+  ASStackLayoutSpec *hstack = [[ASStackLayoutSpec alloc] init];
+  hStack.direction          = ASStackLayoutDirectionHorizontal;
+  hStack.spacing            = 5.0;
+
+  [hStack setChildren:@[imageNode, vStack]];
+  
+  ASInsetLayoutSpec *insetSpec = [ASInsetLayoutSpec insetLayoutSpecWithInsets:UIEdgeInsetsMake(5,5,5,5) child:hStack];
+
+  return insetSpec;
+}
+
+ +
+
+ +###Discussion + +#Social App Layout + + + +
+SwiftObjective-C + +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+  // header stack
+  _userAvatarImageView.preferredFrameSize = CGSizeMake(USER_IMAGE_HEIGHT, USER_IMAGE_HEIGHT);  // constrain avatar image frame size
+  
+  ASLayoutSpec *spacer = [[ASLayoutSpec alloc] init];
+  spacer.flexGrow      = YES;
+
+  ASStackLayoutSpec *headerStack = [ASStackLayoutSpec horizontalStackLayoutSpec];
+  headerStack.alignItems         = ASStackLayoutAlignItemsCenter;       // center items vertically in horizontal stack
+  headerStack.justifyContent     = ASStackLayoutJustifyContentStart;    // justify content to left side of header stack
+  headerStack.spacing            = HORIZONTAL_BUFFER;
+
+  [headerStack setChildren:@[_userAvatarImageView, _userNameLabel, spacer, _photoTimeIntervalSincePostLabel]];
+  
+  // header inset stack
+  
+  UIEdgeInsets insets                = UIEdgeInsetsMake(0, HORIZONTAL_BUFFER, 0, HORIZONTAL_BUFFER);
+  ASInsetLayoutSpec *headerWithInset = [ASInsetLayoutSpec insetLayoutSpecWithInsets:insets child:headerStack];
+  headerWithInset.flexShrink = YES;
+  
+  // vertical stack
+  
+  CGFloat cellWidth                  = constrainedSize.max.width;
+  _photoImageView.preferredFrameSize = CGSizeMake(cellWidth, cellWidth);  // constrain photo frame size
+  
+  ASStackLayoutSpec *verticalStack   = [ASStackLayoutSpec verticalStackLayoutSpec];
+  verticalStack.alignItems           = ASStackLayoutAlignItemsStretch;    // stretch headerStack to fill horizontal space
+  
+  [verticalStack setChildren:@[headerWithInset, _photoImageView, footerWithInset]];
+
+  return verticalStack;
+}
+
+ +
+
+ +###Discussion + +Get the full ASDK project at examples/ASDKgram. + +#Social App Layout 2 + + + +
+SwiftObjective-C + +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize {
+
+  ASLayoutSpec *textSpec  = [self textSpec];
+  ASLayoutSpec *imageSpec = [self imageSpecWithSize:constrainedSize];
+  ASOverlayLayoutSpec *soldOutOverImage = [ASOverlayLayoutSpec overlayLayoutSpecWithChild:imageSpec 
+                                                                                  overlay:[self soldOutLabelSpec]];
+  
+  NSArray *stackChildren = @[soldOutOverImage, textSpec];
+  
+  ASStackLayoutSpec *mainStack = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionVertical 
+                                                                         spacing:0.0
+                                                                  justifyContent:ASStackLayoutJustifyContentStart
+                                                                      alignItems:ASStackLayoutAlignItemsStretch          
+                                                                        children:stackChildren];
+  
+  ASOverlayLayoutSpec *soldOutOverlay = [ASOverlayLayoutSpec overlayLayoutSpecWithChild:mainStack 
+                                                                                overlay:self.soldOutOverlay];
+  
+  return soldOutOverlay;
+}
+
+- (ASLayoutSpec *)textSpec {
+  CGFloat kInsetHorizontal        = 16.0;
+  CGFloat kInsetTop               = 6.0;
+  CGFloat kInsetBottom            = 0.0;
+  UIEdgeInsets textInsets         = UIEdgeInsetsMake(kInsetTop, kInsetHorizontal, kInsetBottom, kInsetHorizontal);
+  
+  ASLayoutSpec *verticalSpacer    = [[ASLayoutSpec alloc] init];
+  verticalSpacer.flexGrow         = YES;
+  
+  ASLayoutSpec *horizontalSpacer1 = [[ASLayoutSpec alloc] init];
+  horizontalSpacer1.flexGrow      = YES;
+  
+  ASLayoutSpec *horizontalSpacer2 = [[ASLayoutSpec alloc] init];
+  horizontalSpacer2.flexGrow      = YES;
+  
+  NSArray *info1Children = @[self.firstInfoLabel, self.distanceLabel, horizontalSpacer1, self.originalPriceLabel];
+  NSArray *info2Children = @[self.secondInfoLabel, horizontalSpacer2, self.finalPriceLabel];
+  if ([ItemNode isRTL]) {
+    info1Children = [[info1Children reverseObjectEnumerator] allObjects];
+    info2Children = [[info2Children reverseObjectEnumerator] allObjects];
+  }
+  
+  ASStackLayoutSpec *info1Stack = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionHorizontal 
+                                                                          spacing:1.0
+                                                                   justifyContent:ASStackLayoutJustifyContentStart 
+                                                                       alignItems:ASStackLayoutAlignItemsBaselineLast children:info1Children];
+  
+  ASStackLayoutSpec *info2Stack = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionHorizontal 
+                                                                          spacing:0.0
+                                                                   justifyContent:ASStackLayoutJustifyContentCenter 
+                                                                       alignItems:ASStackLayoutAlignItemsBaselineLast children:info2Children];
+  
+  ASStackLayoutSpec *textStack = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionVertical 
+                                                                         spacing:0.0
+                                                                  justifyContent:ASStackLayoutJustifyContentEnd
+                                                                      alignItems:ASStackLayoutAlignItemsStretch
+                                                                        children:@[self.titleLabel, verticalSpacer, info1Stack, info2Stack]];
+  
+  ASInsetLayoutSpec *textWrapper = [ASInsetLayoutSpec insetLayoutSpecWithInsets:textInsets 
+                                                                          child:textStack];
+  textWrapper.flexGrow = YES;
+  
+  return textWrapper;
+}
+
+- (ASLayoutSpec *)imageSpecWithSize:(ASSizeRange)constrainedSize {
+  CGFloat imageRatio = [self imageRatioFromSize:constrainedSize.max];
+  
+  ASRatioLayoutSpec *imagePlace = [ASRatioLayoutSpec ratioLayoutSpecWithRatio:imageRatio child:self.dealImageView];
+  
+  self.badge.layoutPosition = CGPointMake(0, constrainedSize.max.height - kFixedLabelsAreaHeight - kBadgeHeight);
+  self.badge.sizeRange = ASRelativeSizeRangeMake(ASRelativeSizeMake(ASRelativeDimensionMakeWithPercent(0), ASRelativeDimensionMakeWithPoints(kBadgeHeight)), ASRelativeSizeMake(ASRelativeDimensionMakeWithPercent(1), ASRelativeDimensionMakeWithPoints(kBadgeHeight)));
+  ASStaticLayoutSpec *badgePosition = [ASStaticLayoutSpec staticLayoutSpecWithChildren:@[self.badge]];
+  
+  ASOverlayLayoutSpec *badgeOverImage = [ASOverlayLayoutSpec overlayLayoutSpecWithChild:imagePlace overlay:badgePosition];
+  badgeOverImage.flexGrow = YES;
+  
+  return badgeOverImage;
+}
+
+- (ASLayoutSpec *)soldOutLabelSpec {
+  ASCenterLayoutSpec *centerSoldOutLabel = [ASCenterLayoutSpec centerLayoutSpecWithCenteringOptions:ASCenterLayoutSpecCenteringXY 
+  sizingOptions:ASCenterLayoutSpecSizingOptionMinimumXY child:self.soldOutLabelFlat];
+  ASStaticLayoutSpec *soldOutBG = [ASStaticLayoutSpec staticLayoutSpecWithChildren:@[self.soldOutLabelBackground]];
+  ASCenterLayoutSpec *centerSoldOut = [ASCenterLayoutSpec centerLayoutSpecWithCenteringOptions:ASCenterLayoutSpecCenteringXY   sizingOptions:ASCenterLayoutSpecSizingOptionDefault child:soldOutBG];
+  ASBackgroundLayoutSpec *soldOutLabelOverBackground = [ASBackgroundLayoutSpec backgroundLayoutSpecWithChild:centerSoldOutLabel background:centerSoldOut];
+  return soldOutLabelOverBackground;
+}
+
+ +
+
+ +###Discussion + +Get the full ASDK project at examples/CatDealsCollectionView. diff --git a/docs/_docs/automatic-subnode-mgmt.md b/docs/_docs/automatic-subnode-mgmt.md new file mode 100755 index 00000000..7432c180 --- /dev/null +++ b/docs/_docs/automatic-subnode-mgmt.md @@ -0,0 +1,178 @@ +--- +title: Automatic Subnode Management +layout: docs +permalink: /docs/automatic-subnode-mgmt.html +prevPage: batch-fetching-api.html +nextPage: inversion.html +--- + +Enabling Automatic Subnode Management (ASM) is required to use the Layout Transition API. However, apps that don't require animations can still benefit from the reduction in code size that this feature enables. + +When enabled, ASM means that your nodes no longer require `addSubnode:` or `removeFromSupernode` method calls. The presence or absence of the ASM node _and_ its subnodes is completely determined in its `layoutSpecThatFits:` method. + +### Example ### +
+Consider the following intialization method from the PhotoCellNode class in ASDKgram sample app. This ASCellNode subclass produces a simple social media photo feed cell. + +In the "Original Code" we see the familiar `addSubnode:` calls in bold. In the "Code with ASM" (switch at top right of code block) these have been removed and replaced with a single line that enables ASM. + +By setting `.automaticallyManagesSubnodes` to `YES` on the `ASCellNode`, we _no longer_ need to call `addSubnode:` for each of the `ASCellNode`'s subnodes. These `subNodes` will be present in the node hierarchy as long as this class' `layoutSpecThatFits:` method includes them. + +
+ + Code with ASM + Original Code + +
+
+- (instancetype)initWithPhotoObject:(PhotoModel *)photo;
+{
+  self = [super init];
+  
+  if (self) {
+    _photoModel = photo;
+    
+    _userAvatarImageNode = [[ASNetworkImageNode alloc] init];
+    _userAvatarImageNode.URL = photo.ownerUserProfile.userPicURL;
+    [self addSubnode:_userAvatarImageNode];
+
+    _photoImageNode = [[ASNetworkImageNode alloc] init];
+    _photoImageNode.URL = photo.URL;
+    [self addSubnode:_photoImageNode];
+
+    _userNameTextNode = [[ASTextNode alloc] init];
+    _userNameTextNode.attributedString = [photo.ownerUserProfile usernameAttributedStringWithFontSize:FONT_SIZE];
+    [self addSubnode:_userNameTextNode];
+    
+    _photoLocationTextNode = [[ASTextNode alloc] init];
+    [photo.location reverseGeocodedLocationWithCompletionBlock:^(LocationModel *locationModel) {
+      if (locationModel == _photoModel.location) {
+        _photoLocationTextNode.attributedString = [photo locationAttributedStringWithFontSize:FONT_SIZE];
+        [self setNeedsLayout];
+      }
+    }];
+    [self addSubnode:_photoLocationTextNode];
+  }
+  
+  return self;
+}
+
+ + +
+
+ +Several of the elements in this cell - `_userAvatarImageNode`, `_photoImageNode`, and `_photoLocationLabel` depend on seperate data fetches from the network that could return at any time. When should they be added to the UI? + +ASM knows whether or not to include these elements in the UI based on the information provided in the cell's `ASLayoutSpec`. + +
+An ASLayoutSpec completely describes the UI of a view in your app by specifying the hierarchy state of a node and its subnodes. An ASLayoutSpec is returned by a node from its layoutSpecThatFits: method. +
+ +**It is your job to construct a `layoutSpecThatFits:` that handles how the UI should look with and without these elements.** + +Consider the abreviated `layoutSpecThatFits:` method for the `ASCellNode` subclass above. + +
+SwiftObjective-C + +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{  
+  ASStackLayoutSpec *headerSubStack = [ASStackLayoutSpec verticalStackLayoutSpec];
+  headerSubStack.flexShrink         = YES;
+  if (_photoLocationLabel.attributedString) {
+    [headerSubStack setChildren:@[_userNameLabel, _photoLocationLabel]];
+  } else {
+    [headerSubStack setChildren:@[_userNameLabel]];
+  }
+  
+  _userAvatarImageNode.preferredFrameSize = CGSizeMake(USER_IMAGE_HEIGHT, USER_IMAGE_HEIGHT);     // constrain avatar image frame size
+
+  ASLayoutSpec *spacer           = [[ASLayoutSpec alloc] init]; 
+  spacer.flexGrow                = YES;
+  
+  UIEdgeInsets avatarInsets      = UIEdgeInsetsMake(HORIZONTAL_BUFFER, 0, HORIZONTAL_BUFFER, HORIZONTAL_BUFFER);
+  ASInsetLayoutSpec *avatarInset = [ASInsetLayoutSpec insetLayoutSpecWithInsets:avatarInsets child:_userAvatarImageNode];
+
+  ASStackLayoutSpec *headerStack = [ASStackLayoutSpec horizontalStackLayoutSpec];
+  headerStack.alignItems         = ASStackLayoutAlignItemsCenter;                     // center items vertically in horizontal stack
+  headerStack.justifyContent     = ASStackLayoutJustifyContentStart;                  // justify content to the left side of the header stack
+  [headerStack setChildren:@[avatarInset, headerSubStack, spacer]];
+  
+  // header inset stack
+  UIEdgeInsets insets                = UIEdgeInsetsMake(0, HORIZONTAL_BUFFER, 0, HORIZONTAL_BUFFER);
+  ASInsetLayoutSpec *headerWithInset = [ASInsetLayoutSpec insetLayoutSpecWithInsets:insets child:headerStack];
+  
+  // footer inset stack
+  UIEdgeInsets footerInsets          = UIEdgeInsetsMake(VERTICAL_BUFFER, HORIZONTAL_BUFFER, VERTICAL_BUFFER, HORIZONTAL_BUFFER);
+  ASInsetLayoutSpec *footerWithInset = [ASInsetLayoutSpec insetLayoutSpecWithInsets:footerInsets child:_photoCommentsNode];
+  
+  // vertical stack
+  CGFloat cellWidth                  = constrainedSize.max.width;
+  _photoImageNode.preferredFrameSize = CGSizeMake(cellWidth, cellWidth);              // constrain photo frame size
+  
+  ASStackLayoutSpec *verticalStack   = [ASStackLayoutSpec verticalStackLayoutSpec];
+  verticalStack.alignItems           = ASStackLayoutAlignItemsStretch;                // stretch headerStack to fill horizontal space
+  [verticalStack setChildren:@[headerWithInset, _photoImageNode, footerWithInset]];
+
+  return verticalStack;
+}
+
+ + +
+
+ + +Here you can see that the children of the `headerSubStack` depend on whether or not the `_photoLocationLabel` attributed string has returned from the reverseGeocode process yet. + +The `_userAvatarImageNode`, `_photoImageNode`, and `_photoCommentsNode` are added into the ASLayoutSpec, but will not show up until their data fetches return. + +### Updating an ASLayoutSpec ### +
+**If something happens that you know will change your `ASLayoutSpec`, it is your job to call `setNeedsLayout`**. This is equivalent to `transitionLayout:duration:0` in the Transition Layout API. You can see this call in the completion block of the `photo.location reverseGeocodedLocationWithCompletionBlock:` call in the first code block. + +An appropriately constructed ASLayoutSpec will know which subnodes need to be added, removed or animated. + +Try out the ASDKgram sample app after looking at the code above, and you will see how simple it is to code an `ASCellNode` whose layout is responsive to numerous, individual data fetches and returns. While the `ASLayoutSpec` is coded in a way that leaves holes for the avatar and photo to populate, you can see how the cell's height will automatically adjust to accomodate the comments node at the bottom of the photo. + +This is just a simple example, but this feature has many more powerful uses. + +
+Warning: addSubnode: and removeFromSupernode should never be called on a node that has ASM enabled. Doing so could cause the following exception - "A flattened layout must consist exclusively of node sublayouts". +
diff --git a/docs/_docs/batch-fetching-api.md b/docs/_docs/batch-fetching-api.md new file mode 100755 index 00000000..4cb153e2 --- /dev/null +++ b/docs/_docs/batch-fetching-api.md @@ -0,0 +1,151 @@ +--- +title: Batch Fetching API +layout: docs +permalink: /docs/batch-fetching-api.html +prevPage: hit-test-slop.html +nextPage: automatic-subnode-mgmt.html +--- + +AsyncDisplayKit's Batch Fetching API makes it easy to add fetching chunks of new data. Usually this would be done in a `-scrollViewDidScroll:` method, but ASDK provides a more structured mechanism. + +By default, as a user is scrolling, when they approach the point in the table or collection where they are 2 "screens" away from the end of the current content, the table will try to fetch more data. + +If you'd like to configure how far away from the end you should be, just change the `leadingScreensForBatching` property on an `ASTableView` or `ASCollectionView` to something else. + +
+SwiftObjective-C + +
+
+tableNode.view.leadingScreensForBatching = 3.0;  // overriding default of 2.0
+
+ +
+
+ +### Batch Fetching Delegate Methods + +The first thing you have to do in order to support batch fetching, is implement a method that decides if it's an appropriate time to load new content or not. + +For tables it would look something like: + +
+SwiftObjective-C + +
+
+- (BOOL)shouldBatchFetchForTableNode:(ASTableNode *)tableNode
+{
+  if (_weNeedMoreContent) {
+    return YES;
+  }
+
+  return NO;
+}
+
+ +
+
+ +and for collections: + +
+SwiftObjective-C + +
+
+
+- (BOOL)shouldBatchFetchForCollectionNode:(ASCollectionNode *)collectionNode
+{
+  if (_weNeedMoreContent) {
+    return YES;
+  }
+
+  return NO;
+}
+
+ +
+
+ +These methods will be called when the user has scrolled into the batch fetching range, and their answer will determine if another request actually needs to be made or not. Usually this decision is based on if there is still data to fetch. + +If you return NO, then no new batch fetching process will happen. If you return YES, the batch fetching mechanism will start and the following method will be called next. + +`-tableNode:willBeginBatchFetchWithContext:` + +or + +`-collectionNode:willBeginBatchFetchWithContext:` + +This is where you should actually fetch data, be it from a web API or some local database. + +
+Note: This method will always be called on a background thread. This means, if you need to do any work on the main thread, you should dispatch it to the main thread and then proceed with the work needed in order to finish the batch fetch operation. +
+ +
+SwiftObjective-C + +
+
+- (void)tableNode:(ASTableNode *)tableNode willBeginBatchFetchWithContext:(ASBatchContext *)context 
+{
+  // Fetch data most of the time asynchronoulsy from an API or local database
+  NSArray *newPhotos = [SomeSource getNewPhotos];
+
+  // Insert data into table or collection node
+  [self insertNewRowsInTableNode:newPhotos];
+
+  // Decide if it's still necessary to trigger more batch fetches in the future
+  _stillDataToFetch = ...;
+
+  // Properly finish the batch fetch
+  [context completeBatchFetching:YES];
+}
+
+ +
+
+ +Once you've finished fetching your data, it is very important to let ASDK know that you have finished the process. To do that, you need to call `-completeBatchFetching:` on the `context` object that was passed in with a parameter value of `YES`. This assures that the whole batch fetching mechanism stays in sync and the next batch fetching cycle can happen. Only by passing `YES` will the context know to attempt another batch update when necessary. + +Check out the following sample apps to see the batch fetching API in action: + diff --git a/docs/_docs/button-node.md b/docs/_docs/button-node.md new file mode 100755 index 00000000..2dcbd030 --- /dev/null +++ b/docs/_docs/button-node.md @@ -0,0 +1,98 @@ +--- +title: ASButtonNode +layout: docs +permalink: /docs/button-node.html +prevPage: cell-node.html +nextPage: text-node.html +--- + +### Basic Usage + +`ASButtonNode` subclasses `ASControlNode` in the same way `UIButton` subclasses `UIControl`. In contrast, being able to layer back the subnodes of every button can significantly lighten main thread impact relative to `UIButton`. + +### Control State + +If you've used `-setTitle:forControlState:` then you already know how to set up an ASButtonNode. The `ASButtonNode` version adds in a few parameters for conveniently setting attributes. + +
+SwiftObjective-C + +
+
+[buttonNode setTitle:@"Button Title Normal" withFont:nil withColor:[UIColor blueColor] forState:ASControlStateNormal];
+
+ +
+
+ +If you need even more control, you can also opt to use the attributed string version directly: + +
+SwiftObjective-C + +
+
+[self.buttonNode setAttributedTitle:attributedTitle forState:ASControlStateNormal];
+
+ +
+
+ +### Target-Action Pairs + +Again, analagous to UIKit, you can add sets of target-action pairs to respond to various events. + +
+SwiftObjective-C + +
+
+[buttonNode addTarget:self action:@selector(buttonPressed:) forControlEvents:ASControlNodeEventTouchUpInside];
+
+ +
+
+ +### Content Alignment + +`ASButtonNode` offers both `contentVerticalAlignment` and `contentHorizontalAlignment` properties. This allows you to easily set the alignment of the titleLabel or image you're using for your button. + +
+SwiftObjective-C + +
+
+self.buttonNode.contentVerticalAlignment = ASVerticalAlignmentTop;
+self.buttonNode.contentHorizontalAlignment = ASHorizontalAlignmentMiddle;
+
+ +
+
+ +
Note: At the moment, this property will not work if you aren't using -layoutSpecThatFits:. +
+ +### Gotchas + +There are a few things that might trip up someone new to the framework. + +##### View Hierarchies +Let's say you want to add an `ASButtonNode` to the view of one of your existing view controllers. The first thing you'll notice is that setting a title for a control state doesn't seem to make your title appear. You can fix this by calling `-measure:` on the button which will cause its title label to be measured and laid out. + +The next thing you'll notice is that, if you set titles of various lengths for different control states, the button will dynamically grow and shrink as the title changes. This is because changing the title causes `-setNeedsLayout` to be called on the button. Within a node hierarchy, this makes sense, and will work as expected. + +Long story short, use an `ASViewController`. + +##### Selected State + +If you want your button to change to a "selected" state after being tapped, you'll need to do that manually. + diff --git a/docs/_docs/cell-node.md b/docs/_docs/cell-node.md new file mode 100755 index 00000000..85c626a8 --- /dev/null +++ b/docs/_docs/cell-node.md @@ -0,0 +1,142 @@ +--- +title: ASCellNode +layout: docs +permalink: /docs/cell-node.html +prevPage: display-node.html +nextPage: button-node.html +--- + +`ASCellNode`, as you may have guessed, is the cell class of ASDK. Unlike the various cells in UIKit, `ASCellNode` can be used with `ASTableNodes`, `ASCollectionNodes` and `ASPagerNodes`, making it incredibly flexible. + +### 3 Ways to Party + +There are three ways in which you can implement the cells you'll use in your ASDK app: subclassing `ASCellNode`, initializing with an existing `ASViewController` or using an existing UIView or `CALayer`. + +#### Subclassing + +Subclassing an `ASCellNode` is pretty much the same as subclassing a regular `ASDisplayNode`. + +Most likely, you'll write a few of the following: + +- `-init` -- Thread safe initialization. +- `-layoutSpecThatFits:` -- Return a layout spec that defines the layout of your cell. +- `-didLoad` -- Called on the main thread. Good place to add gesture recognizers, etc. +- `-layout` -- Also called on the main thread. Layout is complete after the call to super which means you can do any extra tweaking you need to do. + + +#### Initializing with an `ASViewController` + +Say you already have some type of view controller written to display a view in your app. If you want to take that view controller and drop its view in as a cell in one of the scrolling nodes or a pager node its no problem. + +For example, say you already have a view controller written that manages an `ASTableNode`. To use that table as a page in an `ASPagerNode` you can use `-initWithViewControllerBlock`. + +
+SwiftObjective-C +
+
+- (ASCellNode *)pagerNode:(ASPagerNode *)pagerNode nodeAtIndex:(NSInteger)index
+{
+    NSArray *animals = self.allAnimals[index];
+    
+    ASCellNode *node = [[ASCellNode alloc] initWithViewControllerBlock:^UIViewController * _Nonnull{
+        return [[AnimalTableNodeController alloc] initWithAnimals:animals];
+    } didLoadBlock:nil];
+    
+    node.preferredFrameSize = pagerNode.bounds.size;
+    
+    return node;
+}
+
+ +
+
+ +And this works for any combo of scrolling container node and `UIViewController` subclass. You want to embed random view controllers in your collection node? Go for it. + +
+Notice that you need to set the .style.preferredSize of a node created this way. Normally your nodes will implement -layoutSpecThatFits: but since these don't you'll need give the cell a size. +
+ + +#### Initializing with a `UIView` or `CALayer` + +Alternatively, if you already have a `UIView` or `CALayer` subclass that you'd like to drop in as cell you can do that instead. + +
+SwiftObjective-C +
+
+- (ASCellNode *)pagerNode:(ASPagerNode *)pagerNode nodeAtIndex:(NSInteger)index
+{
+    NSArray *animal = self.animals[index];
+    
+    ASCellNode *node = [[ASCellNode alloc] initWithViewBlock:^UIView * _Nonnull{
+        return [[SomeAnimalView alloc] initWithAnimal:animal];
+    }];
+
+    node.preferredFrameSize = pagerNode.bounds.size;
+    
+    return node;
+}
+
+ +
+
+ +As you can see, its roughly the same idea. That being said, if you're doing this, you may consider converting the existing `UIView` subclass to be an `ASCellNode` subclass in order to gain the advantage of asynchronous display. + +### Never Show Placeholders + +Usually, if a cell hasn't finished its display pass before it has reached the screen it will show placeholders until it has completed drawing its content. + +If placeholders are unacceptable, you can set an `ASCellNode`'s `neverShowPlaceholders` property to `YES`. + +
+SwiftObjective-C +
+
+node.neverShowPlaceholders = YES;
+
+ +
+
+ +With this property set to `YES`, the main thread will be blocked until display has completed for the cell. This is more similar to UIKit, and in fact makes AsyncDisplayKit scrolling visually indistinguishable from UIKit's, except being faster. + +
+Using this option does not eliminate all of the performance advantages of AsyncDisplayKit. Normally, a cell has been preloading and is almost done when it reaches the screen, so the blocking time is very short. Even if the rangeTuningParameters are set to 0 this option outperforms UIKit. While the main thread is waiting, subnode display executes concurrently. +
+ +### `UITableViewCell` specific propertys + +UITableViewCell has properties like selectionStyle, accessoryType and seperatorInset that many of us use sometimes to give the Cell more detail. For this case ASCellNode has the same (passthrough) properties that can be used. + +
+UIKits UITableViewCell contains ASCellNode as a subview. Depending how your ASLayoutSpec is defined it may occure that your Layout overlays the UITableViewCell.accessoryView and therefore not visible. Make sure that your Layout doesn't overlays any UITableViewCell's specific properties. +
diff --git a/docs/_docs/containers-ascollectionnode.md b/docs/_docs/containers-ascollectionnode.md new file mode 100755 index 00000000..4cad85a8 --- /dev/null +++ b/docs/_docs/containers-ascollectionnode.md @@ -0,0 +1,182 @@ +--- +title: ASCollectionNode +layout: docs +permalink: /docs/containers-ascollectionnode.html +prevPage: containers-astablenode.html +nextPage: containers-aspagernode.html +--- + +`ASCollectionNode` is equivalent to UIKit's `UICollectionView` and can be used in place of any `UICollectionView`. + +`ASCollectionNode` replaces `UICollectionView`'s required method + +
+ + Swift + Objective-C + + +
+
+- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath;
+  
+ + +
+
+ +with your choice of **_one_** of the following methods + +
+SwiftObjective-C + +
+
+- (ASCellNode *)collectionNode:(ASCollectionNode *)collectionNode nodeForItemAtIndexPath:(NSIndexPath *)indexPath
+
+ +
+
+ +

+or +

+ +
+SwiftObjective-C + +
+
+- (ASCellNodeBlock)collectionNode:(ASCollectionNode *)collectionNode nodeBlockForItemAtIndexPath:(NSIndexPath *)indexPath
+
+ +
+
+ +It is recommended that you use the node block version of the method so that your collection node will be able to prepare and display all of its cells concurrently. + +As noted in the previous section: + +
    +
  • ASCollectionNodes do not utilize cell resuse.
  • +
  • Using the "nodeBlock" method is preferred.
  • +
  • It is very important that the returned node blocks are thread-safe.
  • +
  • ASCellNodes can be used by ASTableNode, ASCollectionNode and ASPagerNode.
  • +
+ +### Replacing a UICollectionViewController with an ASViewController + +AsyncDisplayKit does not offer an equivalent to UICollectionViewController. Instead, you can use the flexibility of ASViewController to recreate any type of UI...ViewController. + +Consider, the following ASViewController subclass. + +An ASCollectionNode is assigned to be managed by an `ASViewController` in its `-initWithNode:` designated initializer method, thus making it a sort of ASCollectionNodeController. + +
+SwiftObjective-C +
+
+- (instancetype)init
+{
+  _flowLayout     = [[UICollectionViewFlowLayout alloc] init];
+  _collectionNode = [[ASCollectionNode alloc] initWithCollectionViewLayout:_flowLayout];
+  
+  self = [super initWithNode:_collectionNode];
+  if (self) {
+    _flowLayout.minimumInteritemSpacing  = 1;
+    _flowLayout.minimumLineSpacing       = 1;
+  }
+  
+  return self;
+}
+
+ + +
+
+ +This works just as well with any node including as an ASTableNode, ASPagerNode, etc. + +### Accessing the ASCollectionView +If you've used previous versions of ASDK, you'll notice that `ASCollectionView` has been removed in favor of `ASCollectionNode`. + +
+`ASCollectionView`, an actual `UICollectionView` subclass, is still used internally by `ASCollectionNode`. While it should not be created directly, it can still be used directly by accessing the `.view` property of an `ASCollectionNode`. +

+Don't forget that a node's `view` or `layer` property should only be accessed after viewDidLoad or didLoad, respectively, have been called. +
+ +The `LocationCollectionNodeController` above accesses the `ASCollectionView` directly in `-viewDidLoad`. + +
+SwiftObjective-C +
+
+- (void)viewDidLoad
+{
+  [super viewDidLoad];
+  
+  _collectionNode.delegate   = self;
+  _collectionNode.dataSource = self;
+  _collectionNode.view.allowsSelection = NO;
+  _collectionNode.view.backgroundColor = [UIColor whiteColor];
+}
+
+ + +
+
+ +### Cell Sizing and Layout + +As discussed in the previous section, `ASCollectionNode` and `ASTableNode` do not need to keep track of the height of their `ASCellNode`s. + +Right now, cells will grow to fit their constrained size and will be laid out by whatever `UICollectionViewLayout` you provide. + +Soon, there will be a method such as `ASTableNode`'s `-constrainedSizeForRow:` but at the moment, if you'd like to constrain the size of a cell used in a collection node, you need to wrap your layoutSpec object in an `ASStaticLayoutSpec` and provide it with a + +### Examples + +The most detailed example of laying out the cells of an `ASCollectionNode` is the CustomCollectionView app. It includes a Pinterest style cell layout using an `ASCollectionNode` and a custom `UICollectionViewLayout`. + +#### More Sample Apps with ASCollectionNodes + + + +### Interoperability with UICollectionViewCells + +`ASCollectionNode` supports using UICollectionViewCells alongside native ASCellNodes. + +Note that these UIKit cells will **not** have the performance benefits of `ASCellNodes` (like preloading, async layout, and async drawing), even when mixed within the same `ASCollectionNode`. + +However, this interoperability allows developers the flexibility to test out the framework without needing to convert all of their cells at once. Read more here. \ No newline at end of file diff --git a/docs/_docs/containers-asnodecontroller.md b/docs/_docs/containers-asnodecontroller.md new file mode 100755 index 00000000..c1c5c272 --- /dev/null +++ b/docs/_docs/containers-asnodecontroller.md @@ -0,0 +1,178 @@ +--- +title: "ASNodeController (Beta)" +layout: docs +permalink: /docs/containers-asnodecontroller.html +prevPage: containers-asviewcontroller.html +nextPage: containers-astablenode.html +--- + +
+To use this feature, you will need to import "ASNodeController+Beta.h" +
+ +The ASDK team has many exciting ideas for expanding `ASNodeController`. Follow along [here](https://github.com/facebook/AsyncDisplayKit/issues/2964) if you'd like to participate in shaping the future of node controllers. + +For now, `ASNodeController` remains a simple, but powerful class. + +### Example + +The [example project](https://github.com/facebook/AsyncDisplayKit/pull/2945) attached in the initial PR modifies the normal [ASDKgram](https://github.com/facebook/AsyncDisplayKit/tree/master/examples/ASDKgram) project to use an `ASNodeController`. +This `PhotoCellNodeController` is used to manage the fetching of the comments data for a photo in a photo feed, once the photo enters the preload range. This node controller allows us to separate the preloading logic from where it previously existed in the `PhotoCellNode` "view" class. + +To convert ASDKgram to use an `ASNodeController`, we first create a `PhotoCellNodeController` class. + +This node controller overrides `ASNodeController`'s' `-loadNode` method to create a `PhotoCellNode` once required. It is not neccessary to call super in this method. + +This node controller also observes its node's interface state in order to intelligently preload the photo's comment feed model data when the `PhotoCellNode` enters the preload state (which indicates that the photo cell is likely to scroll onscreen soon). + +All of this logic can be removed from where it previously existed in the "view" (our `PhotoCellNode` class), leading to a more concise and MVC-friendly view class. + +
+ + Swift + Objective-C + + +
+
+@implementation PhotoCellNodeController
+
+- (void)loadNode
+{
+  self.node = [[PhotoCellNode alloc] initWithPhotoObject:self.photoModel];
+}
+
+- (void)didEnterPreloadState
+{
+  [super didEnterPreloadState];
+  
+  CommentFeedModel *commentFeedModel = _photoModel.commentFeed;
+  [commentFeedModel refreshFeedWithCompletionBlock:^(NSArray *newComments) {
+    // load comments for photo
+    if (commentFeedModel.numberOfItemsInFeed > 0) {
+      [self.node.photoCommentsNode updateWithCommentFeedModel:commentFeedModel];
+      [self.node setNeedsLayout];
+    }
+  }];
+}
+
+@end
+  
+ + +
+
+ +Next, we add a mutable array to the `PhotoFeedNodeController` to store our node controllers and instantiate it in the init method. + +
+ + Swift + Objective-C + + +
+
+@implementation PhotoFeedNodeController
+{
+  PhotoFeedModel          *_photoFeed;
+  ASTableNode             *_tableNode;
+  NSMutableArray *_photoCellNodeControllers;
+}
+
+- (instancetype)init
+{
+  _tableNode = [[ASTableNode alloc] init];
+  self = [super initWithNode:_tableNode];
+  
+  if (self) {
+    self.navigationItem.title = @"ASDK";
+    [self.navigationController setNavigationBarHidden:YES];
+    
+    _tableNode.dataSource = self;
+    _tableNode.delegate = self;
+    
+    _photoCellNodeControllers = [NSMutableArray array];
+  }
+  
+  return self;
+}
+  
+ + +
+
+ +To use this node controller, we modify our table row insertion logic to create a `PhotoCellNodeController` rather than a `PhotoCellNode` directly and add it to our node controller array. + +
+ + Swift + Objective-C + + +
+
+- (void)insertNewRowsInTableNode:(NSArray *)newPhotos
+{
+  NSInteger section = 0;
+  NSMutableArray *indexPaths = [NSMutableArray array];
+  
+  NSUInteger newTotalNumberOfPhotos = [_photoFeed numberOfItemsInFeed];
+  for (NSUInteger row = newTotalNumberOfPhotos - newPhotos.count; row < newTotalNumberOfPhotos; row++) {
+  
+    // create photoCellNodeControllers for the new photos
+    PhotoCellNodeController *cellController = [[PhotoCellNodeController alloc] init];
+    cellController.photoModel = [_photoFeed objectAtIndex:row];
+    [_photoCellNodeControllers addObject:cellController];
+    
+    // include this index path in the insert rows call for the table
+    NSIndexPath *path = [NSIndexPath indexPathForRow:row inSection:section];
+    [indexPaths addObject:path];
+  }
+  
+  [_tableNode insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone];
+}
+  
+ + +
+
+ +Don't forget to modify the table data source method to return the node controller rather than the cell node. + +
+ + Swift + Objective-C + + +
+
+- (ASCellNodeBlock)tableNode:(ASTableNode *)tableNode nodeBlockForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+  PhotoCellNodeController *cellController = [_photoCellNodeControllers objectAtIndex:indexPath.row];
+  // this will be executed on a background thread - important to make sure it's thread safe
+  ASCellNode *(^ASCellNodeBlock)() = ^ASCellNode *() {
+    PhotoCellNode *cellNode = [cellController node];
+    return cellNode;
+  };
+  
+  return ASCellNodeBlock;
+}
+  
+ + +
+
+ + + diff --git a/docs/_docs/containers-aspagernode.md b/docs/_docs/containers-aspagernode.md new file mode 100755 index 00000000..918e297f --- /dev/null +++ b/docs/_docs/containers-aspagernode.md @@ -0,0 +1,166 @@ +--- +title: ASPagerNode +layout: docs +permalink: /docs/containers-aspagernode.html +prevPage: containers-ascollectionnode.html +nextPage: display-node.html +--- + +`ASPagerNode` is a subclass of `ASCollectionNode` with a specific `UICollectionViewLayout` used under the hood. + +Using it allows you to produce a page style UI similar to what you'd create with UIKit's `UIPageViewController`. `ASPagerNode` currently supports staying on the correct page during rotation. It does _not_ currently support circular scrolling. + +The main dataSource methods are: + +
+SwiftObjective-C +
+
+- (NSInteger)numberOfPagesInPagerNode:(ASPagerNode *)pagerNode
+
+ + +
+
+ +and + +
+SwiftObjective-C +
+
+- (ASCellNode *)pagerNode:(ASPagerNode *)pagerNode nodeAtIndex:(NSInteger)index
+
+ + +
+
+ +or + +
+SwiftObjective-C +
+
+- (ASCellNodeBlock)pagerNode:(ASPagerNode *)pagerNode nodeBlockAtIndex:(NSInteger)index`
+
+ + +
+
+ +These two methods, just as with `ASCollectionNode` and `ASTableNode` need to return either an `ASCellNode` or an `ASCellNodeBlock` - a block that creates an `ASCellNode` and can be run on a background thread. + +Note that neither methods should rely on cell reuse (they will be called once per row). Also, unlike UIKit, these methods are not called when the row is just about to display. + +While `-pagerNode:nodeAtIndex:` will be called on the main thread, `-pagerNode:nodeBlockAtIndex:` is preferred because it concurrently allocates cell nodes, meaning that the `-init:` method of each of your subnodes will be run in the background. **It is very important that node blocks be thread-safe** as they can be called on the main thread or a background queue. + +### Node Block Thread Safety Warning + +It is imperative that the data model be accessed outside of the node block. This means that it is highly unlikely that you should need to use the index inside of the block. + +In the example below, you can see how the index is used to access the photo model before creating the node block. + +
+SwiftObjective-C +
+
+- (ASCellNodeBlock)pagerNode:(ASPagerNode *)pagerNode nodeBlockAtIndex:(NSInteger)index
+{
+  PhotoModel *photoModel = _photoFeed[index];
+  
+  // this part can be executed on a background thread - it is important to make sure it is thread safe!
+  ASCellNode *(^cellNodeBlock)() = ^ASCellNode *() {
+    PhotoCellNode *cellNode = [[PhotoCellNode alloc] initWithPhoto:photoModel];
+    return cellNode;
+  };
+  
+  return cellNodeBlock;
+}
+
+ + +
+
+ +### Using an ASViewController For Optimal Performance + +One especially useful pattern is to return an `ASCellNode` that is initialized with an existing `UIViewController` or `ASViewController`. For optimal performance, use an `ASViewController`. + +
+SwiftObjective-C +
+
+- (ASCellNode *)pagerNode:(ASPagerNode *)pagerNode nodeAtIndex:(NSInteger)index
+{
+    NSArray *animals = self.animals[index];
+    
+    ASCellNode *node = [[ASCellNode alloc] initWithViewControllerBlock:^{
+        return [[AnimalTableNodeController alloc] initWithAnimals:animals];;
+    } didLoadBlock:nil];
+    
+    node.style.preferredSize = pagerNode.bounds.size;
+    
+    return node;
+}
+
+ + +
+
+ +In this example, you can see that the node is constructed using the `-initWithViewControllerBlock:` method. It is usually necessary to provide a cell created this way with a `style.preferredSize` so that it can be laid out correctly. + +### Use ASPagerNode as root node of an ASViewController + +#### Log message while popping back in the view controller hierarchy +If you use an `ASPagerNode` embedded in an `ASViewController` in full screen. If you pop back from the view controller hierarchy you will see some error message in the console. + +To resolve the error message set `self.automaticallyAdjustsScrollViewInsets = NO;` in `viewDidLoad` in your `ASViewController` subclass. + +#### `navigationBar.translucent` is set to YES +If you have an `ASPagerNode` embedded in an `ASViewController` in full screen and set the `navigationBar.translucent` to `YES`, you will see an error message while pushing the view controller on the view controller stack. + +To resolve the error message add `[self.pagerNode waitUntilAllUpdatesAreCommitted];` within `- (void)viewWillAppear:(BOOL)animated` in your `ASViewController` subclass. +Unfortunately the disadvantage of this is that the first measurement pass will block the main thread until it finishes. + +#### Some more details about the error messages above +The reason for this error message is that due to the asynchronous nature of AsyncDisplayKit, measurement of nodes will happen on a background thread as UIKit will resize the view of the `ASViewController` on on the main thread. The new layout pass has to wait until the old layout pass finishes with an old layout constrained size. Unfortunately while the measurement pass with the old constrained size is still in progress the `ASPagerFlowLayout` that is backing a `ASPagerNode` will print some errors in the console as it expects sizes for nodes already measured with the new constrained size. + +### Sample Apps + +Check out the following sample apps to see an `ASPagerNode` in action: + diff --git a/docs/_docs/containers-astablenode.md b/docs/_docs/containers-astablenode.md new file mode 100755 index 00000000..509b58ce --- /dev/null +++ b/docs/_docs/containers-astablenode.md @@ -0,0 +1,229 @@ +--- +title: ASTableNode +layout: docs +permalink: /docs/containers-astablenode.html +prevPage: containers-asnodecontroller.html +nextPage: containers-ascollectionnode.html +--- + +`ASTableNode` is equivalent to UIKit's `UITableView` and can be used in place of any `UITableView`. + +`ASTableNode` replaces `UITableView`'s required method + +
+ + Swift + Objective-C + + +
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+  
+ + +
+
+ +with your choice of **_one_** of the following methods + +
+ + Swift + Objective-C + + +
+
+- (ASCellNode *)tableNode:(ASTableNode *)tableNode nodeForRowAtIndexPath:(NSIndexPath *)indexPath
+  
+ + +
+
+ +or + +
+ + Swift + Objective-C + + +
+
+- (ASCellNodeBlock)tableNode:(ASTableNode *)tableNode nodeBlockForRowAtIndexPath:(NSIndexPath *)indexPath
+  
+ + +
+
+ +
+
+It is recommended that you use the node block version of these methods so that your collection node will be able to prepare and display all of its cells concurrently. This means that all subnode initialization methods can be run in the background. Make sure to keep 'em thread safe. +
+ +These two methods, need to return either an `ASCellNode` or an `ASCellNodeBlock`. An `ASCellNodeBlock` is a block that creates a `ASCellNode` which can be run on a background thread. Note that `ASCellNodes` are used by `ASTableNode`, `ASCollectionNode` and `ASPagerNode`. + +Note that neither of these methods require a reuse mechanism. + +### Replacing UITableViewController with ASViewController + +AsyncDisplayKit does not offer an equivalent to `UITableViewController`. Instead, use an `ASViewController` initialized with an `ASTableNode`. + +Consider, again, the `ASViewController` subclass - PhotoFeedNodeController - from the `ASDKgram sample app` that uses a table node as its managed node. + +An `ASTableNode` is assigned to be managed by an `ASViewController` in its `-initWithNode:` designated initializer method. + +
+SwiftObjective-C +
+
+- (instancetype)init
+{
+    _tableNode = [[ASTableNode alloc] initWithStyle:UITableViewStylePlain];
+    self = [super initWithNode:_tableNode];
+    
+    if (self) {
+      _tableNode.dataSource = self;
+      _tableNode.delegate = self;
+    }
+    
+    return self;
+}
+  
+ + +
+
+ +### Node Block Thread Safety Warning + +It is very important that node blocks be thread-safe. One aspect of that is ensuring that the data model is accessed _outside_ of the node block. Therefore, it is unlikely that you should need to use the index inside of the block. + +Consider the following `-tableNode:nodeBlockForRowAtIndexPath:` method from the `PhotoFeedNodeController.m` file in the ASDKgram sample app. + +In the example below, you can see how the index is used to access the photo model before creating the node block. + +
+SwiftObjective-C +
+
+- (ASCellNodeBlock)tableNode:(ASTableNode *)tableNode nodeBlockForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    PhotoModel *photoModel = [_photoFeed objectAtIndex:indexPath.row];
+    
+    // this may be executed on a background thread - it is important to make sure it is thread safe
+    ASCellNode *(^cellNodeBlock)() = ^ASCellNode *() {
+        PhotoCellNode *cellNode = [[PhotoCellNode alloc] initWithPhoto:photoModel];
+        cellNode.delegate = self;
+        return cellNode;
+    };
+    
+    return cellNodeBlock;
+}
+  
+ + +
+
+ + +### Accessing the ASTableView + +If you've used previous versions of ASDK, you'll notice that `ASTableView` has been removed in favor of `ASTableNode`. + +
+ASTableView, an actual UITableView subclass, is still used internally by ASTableNode. While it should not be created directly, it can still be used directly by accessing the .view property of an ASTableNode. + +Don't forget that a node's view or layer property should only be accessed after -viewDidLoad or -didLoad, respectively, have been called. +
+ +For example, you may want to set a table's separator style property. This can be done by accessing the table node's view in the `-viewDidLoad:` method as seen in the example below. + +
+SwiftObjective-C +
+
+- (void)viewDidLoad
+{
+  [super viewDidLoad];
+  
+  _tableNode.view.allowsSelection = NO;
+  _tableNode.view.separatorStyle = UITableViewCellSeparatorStyleNone;
+  _tableNode.view.leadingScreensForBatching = 3.0;  // default is 2.0
+}
+
+ + +
+
+ +### Table Row Height + +An important thing to notice is that `ASTableNode` does not provide an equivalent to `UITableView`'s `-tableView:heightForRowAtIndexPath:`. + +This is because nodes are responsible for determining their own height based on the provided constraints. This means you no longer have to write code to determine this detail at the view controller level. + +A node defines its height by way of the layoutSpec returned in the `-layoutSpecThatFits:` method. All nodes given a constrained size are able to calculate their desired size. + +
+By default, a ASTableNode provides its cells with a size range constraint where the minimum width is the tableNode's width and a minimum height is 0. The maximum width is also the tableNode's width but the maximum height is FLT_MAX. +

+This is all to say, a `tableNode`'s cells will always fill the full width of the `tableNode`, but their height is flexible making self-sizing cells something that happens automatically. +
+ +If you call `-setNeedsLayout` on an `ASCellNode`, it will automatically perform another layout pass and if its overall desired size has changed, the table will be informed and will update itself. + +This is different from `UIKit` where normally you would have to call reload row / item. This saves tons of code, check out the ASDKgram sample app to see side by side implementations of an `UITableView` and `ASTableNode` implemented social media feed. + +### Sample Apps using ASTableNode + diff --git a/docs/_docs/containers-asviewcontroller.md b/docs/_docs/containers-asviewcontroller.md new file mode 100755 index 00000000..6c4962ae --- /dev/null +++ b/docs/_docs/containers-asviewcontroller.md @@ -0,0 +1,69 @@ +--- +title: ASViewController +layout: docs +permalink: /docs/containers-asviewcontroller.html +prevPage: faq.html +nextPage: containers-asnodecontroller.html +--- + +`ASViewController` is a subclass of `UIViewController` that adds several useful features for hosting `ASDisplayNode` hierarchies. + +An `ASViewController` can be used in place of any `UIViewController` - including within a `UINavigationController`, `UITabBarController` and `UISplitViewController` or as a modal view controller. + +Benefits of using an `ASViewController`: +
    +
  1. Save Memory. An ASViewController that goes off screen will automatically reduce the size of the fetch data and display ranges of any of its children. This is key for memory management in large applications.
  2. +
  3. ASVisibility Feature. When used in an ASNavigationController or ASTabBarController, these classes know the exact number of user taps it would take to make the view controller visible.
  4. +
+ +More features will be added over time, so it is a good idea to base your view controllers off of this class. + +## Usage + +A `UIViewController` provides a view of its own. An `ASViewController` is assigned a node to manage in its designated initializer `-initWithNode:`. + +Consider the following `ASViewController` subclass, `PhotoFeedNodeController`, from the ASDKgram example project that would like to use a table node as its managed node. + +This table node is assigned to the `ASViewController` in its `-initWithNode:` designated initializer method. + +
+SwiftObjective-C +
+
+- (instancetype)init
+{
+  _tableNode = [[ASTableNode alloc] initWithStyle:UITableViewStylePlain];
+  self = [super initWithNode:_tableNode];
+  
+  if (self) {
+    _tableNode.dataSource = self;
+    _tableNode.delegate = self;
+  }
+  
+  return self;
+}
+  
+ + +
+
+ +
+
+Conversion Tip: If your app already has a complex view controller hierarchy, it is perfectly fine to have all of them subclass ASViewController. That is to say, even if you don't use ASViewController's designated initializer -initiWithNode:, and only use the ASViewController in the manner of a traditional UIViewController, this will give you the additional node support if you choose to adopt it in different areas your application. +
+ diff --git a/docs/_docs/containers-overview.md b/docs/_docs/containers-overview.md new file mode 100755 index 00000000..7d55b0c4 --- /dev/null +++ b/docs/_docs/containers-overview.md @@ -0,0 +1,52 @@ +--- +title: Node Containers +layout: docs +permalink: /docs/containers-overview.html +prevPage: intelligent-preloading.html +nextPage: node-overview.html +--- + +### Use Nodes in Node Containers +It is highly recommended that you use AsyncDisplayKit's nodes within a node container. AsyncDisplayKit offers the following node containers. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ASDK Node ContainerUIKit Equivalent
`ASCollectionNode`in place of UIKit's `UICollectionView`
`ASPagerNode`in place of UIKit's `UIPageViewController`
`ASTableNode`in place of UIKit's `UITableView`
`ASViewController`in place of UIKit's `UIViewController`
`ASNavigationController`in place of UIKit's `UINavigationController`. Implements the `ASVisibility` protocol.
`ASTabBarController`in place of UIKit's `UITabBarController`. Implements the `ASVisibility` protocol.
+ +
+Example code and specific sample projects are highlighted in the documentation for each node container. + + + +### What do I Gain by Using a Node Container? + +A node container automatically manages the intelligent preloading of its nodes. This means that all of the node's layout measurement, data fetching, decoding and rendering will be done asynchronously. Among other conveniences, this is why it is recommended to use nodes within a container node. + +Note that while it _is_ possible to use nodes directly (without an AsyncDisplayKit node container), unless you add additional calls, they will only start displaying once they come onscreen (as UIKit does). This can lead to performance degredation and flashing of content. diff --git a/docs/_docs/control-node.md b/docs/_docs/control-node.md new file mode 100755 index 00000000..4032af0c --- /dev/null +++ b/docs/_docs/control-node.md @@ -0,0 +1,122 @@ +--- +title: ASControlNode +layout: docs +permalink: /docs/control-node.html +prevPage: map-node.html +nextPage: scroll-node.html +--- + +`ASControlNode` is the ASDK equivalent to `UIControl`. You don't create instances of `ASControlNode` directly. Instead, you can use it as a subclassing point when creating controls of your own. In fact, ASTextNode, ASImageNode, ASVideoNode and ASMapNode are all subclasses of `ASControlNode`. + +This fact is especially useful when it comes to image and text nodes. Having the ability to add target-action pairs means that you can use any text or image node as a button without having to rely on creating gesture recognizers, as you would with text in UIKit, or creating extraneous views as you might when using `UIButton`. + +### Control State + +Like `UIControl`, `ASControlNode` has a state which defines its appearance and ability to support user interactions. Its state can be one of any state defined by `ASControlState`. + +
+SwiftObjective-C +
+
+typedef NS_OPTIONS(NSUInteger, ASControlState) {
+    ASControlStateNormal       = 0,
+    ASControlStateHighlighted  = 1 << 0,  // used when isHighlighted is set
+    ASControlStateDisabled     = 1 << 1,
+    ASControlStateSelected     = 1 << 2,  // used when isSelected is set
+    ...
+};
+
+ +
+
+ +### Target-Action Mechanism + +Also similarly to `UIControl`, `ASControlNode`'s have a set of events defined which you can react to by assigning a target-action pair. + +The available actions are: +
+SwiftObjective-C +
+
+typedef NS_OPTIONS(NSUInteger, ASControlNodeEvent)
+{
+  /** A touch-down event in the control node. */
+  ASControlNodeEventTouchDown         = 1 << 0,
+  /** A repeated touch-down event in the control node; for this event the value of the UITouch tapCount method is greater than one. */
+  ASControlNodeEventTouchDownRepeat   = 1 << 1,
+  /** An event where a finger is dragged inside the bounds of the control node. */
+  ASControlNodeEventTouchDragInside   = 1 << 2,
+  /** An event where a finger is dragged just outside the bounds of the control. */
+  ASControlNodeEventTouchDragOutside  = 1 << 3,
+  /** A touch-up event in the control node where the finger is inside the bounds of the node. */
+  ASControlNodeEventTouchUpInside     = 1 << 4,
+  /** A touch-up event in the control node where the finger is outside the bounds of the node. */
+  ASControlNodeEventTouchUpOutside    = 1 << 5,
+  /** A system event canceling the current touches for the control node. */
+  ASControlNodeEventTouchCancel       = 1 << 6,
+  /** All events, including system events. */
+  ASControlNodeEventAllEvents         = 0xFFFFFFFF
+};
+
+ +
+
+ +Assigning a target and action for these events is done with the same methods as a `UIControl`, namely using `–addTarget:action:forControlEvents:`. + +### Hit Test Slop + +While all node's have a `hitTestSlop` property, this is usually most useful when dealing with controls. Instead of needing to make your control bigger, or needing to override `-hitTest:withEvent:` you can just assign a `UIEdgeInsets` to your control and its boundaries will be expanded accordingly. + +
+SwiftObjective-C +
+
+CGFloat horizontalDiff = (bounds.size.width - _playButton.bounds.size.width)/2;
+CGFloat verticalDiff = (bounds.size.height - _playButton.bounds.size.height)/2;
+
+_playButton.hitTestSlop = UIEdgeInsetsMake(-verticalDiff, -horizontalDiff, -verticalDiff, -horizontalDiff);
+
+ +
+
+ +Remember that, since the property is an inset, you'll need to use negative values in order to expand the size of your tappable region. + +### Hit Test Visualization + +The hit test visualization tool is an option to enable highlighting of the tappable areas of your nodes. To enable it, include `[ASControlNode setEnableHitTestDebug:YES]` in your app delegate in `-application:didFinishLaunchingWithOptions:`. diff --git a/docs/_docs/corner-rounding.md b/docs/_docs/corner-rounding.md new file mode 100755 index 00000000..240b1741 --- /dev/null +++ b/docs/_docs/corner-rounding.md @@ -0,0 +1,103 @@ +--- +title: Corner Rounding +layout: docs +permalink: /docs/corner-rounding.html +prevPage: synchronous-concurrency.html +nextPage: debug-tool-hit-test-visualization.html +--- + +When it comes to corner rounding, many developers stick with CALayer's `.cornerRadius` property. Unfortunately, this convenient property greatly taxes performance and should only be used when there is _no_ alternative. This post will cover: + + + +## CALayer's .cornerRadius is Expensive + +Why is `.cornerRadius` so expensive? Use of CALayer's `.cornerRadius` property triggers off-screen rendering to perform the clipping operation on every frame - 60 FPS during scrolling - even if the content in that area isn't changing! This means that the GPU has to switch contexts on every frame, between compositing the overall frame + additional passes for each use of `.cornerRadius`. + +Importantly, these costs don't show up in the Time Profiler, because they affect work done by the CoreAnimation Render Server on your app's behalf. This intensive thrash annihilates performance for a lot of devices. On the iPhone 4, 4S, and 5 / 5C (along with comparable iPads / iPods), expect to see notably degraded performance. On the iPhone 5S and newer, even if you can't see the impact directly, it will reduce headroom so that it takes less to cause a frame drop. + +## Performant Corner Rounding Strategies + +There are only three things to consider when picking a corner rounding strategy: + +
    +
  1. Is there movement underneath the corner?
  2. +
  3. Is there movement through the corner?
  4. +
  5. Are all 4 corners the same node *and* no other nodes intersect in the corner area?
  6. +
+ +Movement **underneath the corner** is any movement behind the corner. For example, as a rounded-corner collection cell scrolls over a background, the background will move underneath and out from under the corners. + +To describe movement **through the corner,** imagine a small rounded-corner scroll view containing a much larger photo. As you zoom and pan the photo inside of the scroll view, the photo will move through the corners of the of the scroll view. + + + +The above image shows movement underneath the corner highlighted in blue and movement through the corner highlighted in orange. + +
+Note: There can be movement inside of the rounded-corner object, without moving through the corner. The following image shows content, highlighted in green, inset from the edge with a margin equal to the size of the corner radius. When the content scrolls, it will not move through the corners. +
+ + + +Using the above method to adjust your design to eliminate one source of corner movement can make the difference between being able to use a fast rounding technique, or resorting to `.cornerRadius.`. + +The final consideration is to determine if all four corners cover the same node or if any subnodes interesect the corner area. + + + +### Precomposited Corners + +Precomposited corners refer to corners drawn using bezier paths to clip the content in a CGContext / UIGraphicsContext. In this scenario, the corners become part of the image itself — and are "baked in" to the single CALayer. There are two types of precomposited corners. + +The absolute best method is to use **precomposited opaque corners**. This is the most efficient method available, resulting in zero alpha blending (although this is much less critical than avoiding offscreen rendering). Unfortunately, this method is also the least flexible; the background behind the corners will need to be a solid color if the rounded image needs to move around on top of it. It's possible, but tricky to make precomposited corners with a textured or photo background - usually it's best to use precomposited alpha corners instead'.' + +The second method involves using bezier paths with **precomposited alpha corners** (`[path clip]`). This method is pretty flexible and should be one of the most frequently used. It does incur the cost of alpha blending across the full size of the content, and including an alpha channel increases memory impact by 25% over opaque precompositing - but these costs are tiny on modern devices, and a different order of magnitude than `.cornerRadius` offscreen rendering. + +A key limitation of precomposited corners is that the corners must only touch one node and not intersect with any subnodes. If either of these conditions exist, clip corners must be used. + +Note that AsyncDisplayKit nodes have a special optimization of `.cornerRadius` that automatically implements precomposited corners **only when using** `.shouldRasterizeDescendants`. It's important to think carefully before you enable rasterization, so don't use this option without first reading all about the concept. + +
+If you're looking for a simple, flat-color rounded rectangle or circle, AsyncDisplayKit offers a variety of conveniences to provide this. See `UIImage+ASConveniences.h` for methods to create flat-colored, rounded-corner resizable images using precomposited corners (both alpha and opaque are supported). These are great for use as placeholders for image nodes or backgrounds for ASButtonNode. More precomposited corner methods will be released with AsyncDisplayKit 2.0 release. +
+ +### Clip Corner + +This strategy involves placing **4 seperate opaque corners that sit on top of the content** that needs corner rounding. This method is flexible and has quite good performance. It has minor CPU overhead of 4 seperate layers, one layer for each corner. + + + +Clip corners applies to two main types of corner rounding situations: + +
    +
  • Rounded corners in situations in which the corners touch more than one node or intersect with any subnodes.
  • +
  • Rounded corners on top of a stationary texture or photo background. The photo clip corner method is tricky, but useful!
  • +
+ +
+Check back soon! Clip corner methods may be released in AsyncDisplayKit 2.0 release. +
+ +## Is it ever okay to use CALayer's .cornerRadius property? + +There are a few, quite rare cases in which it is appropriate to use `.cornerRadius.` These include when there is dynamic content moving _both_ through the inside and underneath the corner. For certain animations, this is impossible to avoid. However, in many cases, it is easy to adjust your design to eliminate one of the sources of movement. One such case was discussed in the section on corner movement. + +It is much less bad, and okay as a shortcut, to use `.cornerRadius.` for screens in which nothing moves. However, *any* motion on the screen, even movement that doesn't involve the corners, will cause the `.cornerRadius.` perfromance tax. For example, having a rounded element in the navigation bar with a scrolling view beneath it will cause the impact even if they don't overlap. Animating anything onscreen, even if the user doesn't interact, will as well.' Additionally, any type of screen refresh will incur the cost of corner rounding. + +### Rasterization and Layerbacking + +Some people have suggested that using CALayer's `.shouldRasterize` can improve the performance of the `.cornerRadius` property. This is not well understood option that is generally perilous. As long as nothing causes it to re-rasterize (no movement, no tap to change color, not on a table view that moves, etc), it is okay to use. Generally we don't encourage this because it is very easy to cause much worse performance. For people who have not great app architecture and insist on using CALayer's `.cornerRadius` (e.g. their app is not very performant), this _can_ make a meaningful difference. However, if you are building your app from the ground up, we highly reccommend that you choose one of the better corner rounding strategies above. + +CALayer's `.shouldRasterize` is unrelated to AsyncDisplayKit `node.shouldRasterizeDescendents`. When enabled, `.shouldRasterizeDescendents` will prevent the actual view and layer of the subnode children from being created. + +## Corner Rounding Strategy Flowchart + +Use this flowchart to select the most performant strategy to round a set of corners. + +corner rounding strategy flowchart diff --git a/docs/_docs/debug-tool-ASRangeController.md b/docs/_docs/debug-tool-ASRangeController.md new file mode 100755 index 00000000..38fc4802 --- /dev/null +++ b/docs/_docs/debug-tool-ASRangeController.md @@ -0,0 +1,42 @@ +--- +title: Range Visualization +layout: docs +permalink: /docs/debug-tool-ASRangeController.html +prevPage: debug-tool-pixel-scaling.html +nextPage: asvisibility.html +--- + +## Visualize ASRangeController tuning parameters (PR #1390) +
+This debug feature adds a semi-transparent subview in the bottom right hand corner of the sharedApplication keyWindow that visualizes the ASRangeTuningParameters per each ASLayoutRangeType for each visible (on-screen) instance of ASRangeController. + +- The instances of ASRangeController are represented as bars +- As you scroll around within ASTable/CollectionViews you can see the parameters (green = Visible, yellow = Display, and red = FetchData) move relative to each other. +- White arrows on the L and R sides of the individual RangeController bar views indicate the scrolling direction so that you can determine the leading / trailing tuning parameters (especially useful for vertically-oriented rangeControllers whose leading edge might be unclear within the horizontally-oriented bar view). +- The white debug label above the RangeController bar displays the RangeController dataSource’s class name to differentiate between nested views. +- The overlay can be moved with a panning gesture in order to see content under it. + +This debug feature is useful for highly optimized ASDK apps that require tuning of any ASRangeController. Or for anyone who is curious about how ASRangeControllers work. + +The VerticalWithinHorizontal example app contains an ASPagerNode with embedded ASTableViews. In the screenshot with this feature enabled, you can see the two range controllers - ASTableView and ASCollectionView (ASPagerNode) - in the overlay. + +- The white arrows to the right of the rangeController bars indicate that the user is currently scrolling down through the table and right through the ASCollectionView/PagerNode. +- The ASTableView rangeController bar indicates that the range parameters are tuned to both fetch and decode more data in the downward table direction rather than in the reverse direction (which makes sense as the user is scrolling down). +- Since it’s less obvious whether or not the user will page to the right or left next, the ASCollectionView is tuned to fetch and decode equal amounts of data in each direction. +- In the video demo, you can see as the user scrolls between pages, that new ASTableView rangeControllers are created and removed in the overlay view. +![bc0b98f0-ebb8-11e5-8f50-421cb0f320c2](https://cloud.githubusercontent.com/assets/3419380/14057072/ef7f63a0-f2b2-11e5-92a5-f65b2d207e63.png) + +## Limitations +
    +
  • only shows onscreen ASRangeControllers
  • +
  • currently the ratio of red (fetch data), yellow (display) and green (visible) are relative to each other, but not between each bar view. So you cannot compare individual bars to eachother
  • +
+ +## Usage +In your `AppDelegate.m` file, +
    +
  • import AsyncDisplayKit+Debug.h
  • +
  • add [ASRangeController setShouldShowRangeDebugOverlay:YES] at the top of your AppDelegate's didFinishLaunchingWithOptions: method
  • +
+ +**Make sure to call this method before initializing any component that uses an ASRangeControllers (ASTableView, ASCollectionView).** diff --git a/docs/_docs/debug-tool-hit-test-visualization.md b/docs/_docs/debug-tool-hit-test-visualization.md new file mode 100755 index 00000000..2b2f5f2a --- /dev/null +++ b/docs/_docs/debug-tool-hit-test-visualization.md @@ -0,0 +1,34 @@ +--- +title: Hit Test Visualization +layout: docs +permalink: /docs/debug-tool-hit-test-visualization.html +prevPage: corner-rounding.html +nextPage: debug-tool-pixel-scaling.html +--- + +## Visualize ASControlNode Tappable Areas +
+This debug feature adds a semi-transparent highlight overlay on any ASControlNodes containing a `target:action:` pair or gesture recognizer. The tappable range is defined as the ASControlNode’s frame + its `.hitTestSlop` `UIEdgeInsets`. Hit test slop is a unique feature of `ASControlNode` that allows it to extend its tappable range. + +In the screenshot below, you can quickly see that +
    +
  • The tappable area for the avatar image overlaps the username’s tappable area. In this case, the user avatar image is on top in the view hierarchy and is capturing some touches that should go to the username.
  • +
  • It would probably make sense to expand the `.hitTestSlop` for the username to allow the user to more easily hit it.
  • +
  • I’ve accidentally set the hitTestSlop’s UIEdgeInsets to be positive instead of negative for the photo likes count label. It’s going to be hard for a user to tap the smaller target.
  • +
+ +![screen shot 2016-03-25 at 4 39 23 pm](https://cloud.githubusercontent.com/assets/3419380/14057034/e1e71450-f2b1-11e5-8091-3e6f22862994.png) + +## Restrictions +
+A _green_ border on the edge(s) of the highlight overlay indicates that that edge of the tapable area is restricted by one of it's superview's tapable areas. An _orange_ border on the edge(s) of the highlight overlay indicates that that edge of the tapable area is clipped by .clipsToBounds of a parent in its hierarchy. + +## Usage +
+In your `AppDelegate.m` file, +
    +
  • import AsyncDisplayKit+Debug.h
  • +
  • add [ASControlNode setEnableHitTestDebug:YES] at the top of your AppDelegate's didFinishLaunchingWithOptions: method
  • +
+ +**Make sure to call this method before initializing any ASControlNodes - including ASButtonNodes, ASImageNodes, and ASTextNodes.** diff --git a/docs/_docs/debug-tool-pixel-scaling.md b/docs/_docs/debug-tool-pixel-scaling.md new file mode 100755 index 00000000..2ff4e5e3 --- /dev/null +++ b/docs/_docs/debug-tool-pixel-scaling.md @@ -0,0 +1,60 @@ +--- +title: Image Scaling +layout: docs +permalink: /docs/debug-tool-pixel-scaling.html +prevPage: debug-tool-hit-test-visualization.html +nextPage: debug-tool-ASRangeController.html +--- + +## Visualize ASImageNode.image’s pixel scaling +
+This debug feature adds a red text overlay on the bottom right hand corner of an ASImageNode if (and only if) the image’s size in pixels does not match it’s bounds size in pixels, e.g. + +
+SwiftObjective-C + +
+
+CGFloat imageSizeInPixels = image.size.width * image.size.height;
+CGFloat boundsSizeInPixels = imageView.bounds.size.width * imageView.bounds.size.height;
+CGFloat scaleFactor = imageSizeInPixels / boundsSizeInPixels;
+
+if (scaleFactor != 1.0) {
+      NSString *scaleString = [NSString stringWithFormat:@"%.2fx", scaleFactor];
+      _debugLabelNode.hidden = NO;
+}
+
+ +
+
+ + +This debug feature is useful for quickly determining if you are + +
    +
  • downloading and rendering excessive amounts of image data
  • +
  • upscaling a low quality image
  • +
+ +In the screenshot below of an app with this debug feature enabled, you can see that the avatar image is unnecessarily large (9x too large) for it’s bounds size and that the center picture is more optimized, but not perfectly so. If you control your own endpoint, make sure to return an optimally sized image. + +![screen shot 2016-03-25 at 4 04 59 pm](https://cloud.githubusercontent.com/assets/3419380/14056994/15561daa-f2b1-11e5-9606-59d54d2b5354.png) + +## Usage +
+In your `AppDelegate.m` file, +
    +
  • import AsyncDisplayKit+Debug.h
  • +
  • add [ASImageNode setShouldShowImageScalingOverlay:YES] at the top of your AppDelegate's didFinishLaunchingWithOptions: method
  • +
+ +**Make sure to call this method before initializing any ASImageNodes.** diff --git a/docs/_docs/display-node.md b/docs/_docs/display-node.md new file mode 100755 index 00000000..482cfa6d --- /dev/null +++ b/docs/_docs/display-node.md @@ -0,0 +1,93 @@ +--- +title: ASDisplayNode +layout: docs +permalink: /docs/display-node.html +prevPage: containers-aspagernode.html +nextPage: cell-node.html +--- + +### Node Basics + +`ASDisplayNode` is the main view abstraction over `UIView` and `CALayer`. It initializes and owns a `UIView` in the same way `UIViews` create and own their own backing `CALayers`. + +
+SwiftObjective-C + +
+
+ASDisplayNode *node = [[ASDisplayNode alloc] init];
+node.backgroundColor = [UIColor orangeColor];
+node.bounds = CGRectMake(0, 0, 100, 100);
+
+NSLog(@"Underlying view: %@", node.view);
+	
+ + +
+
+ +A node has all the same properties as a `UIView`, so using them should feel very familiar to anyone familiar with UIKit. + +Properties of both views and layers are forwarded to nodes and can be easily accessed. + +
+SwiftObjective-C + +
+
+ASDisplayNode *node = [[ASDisplayNode alloc] init];
+node.clipsToBounds = YES;				  // not .masksToBounds
+node.borderColor = [UIColor blueColor];  //layer name when there is no UIView equivalent
+
+NSLog(@"Backing layer: %@", node.layer);
+	
+ + +
+
+ +As you can see, naming defaults to the `UIView` conventions*** unless there is no `UIView` equivalent. You also have access to your underlying `CALayer` just as you would when dealing with a plain `UIView`. + +When used with one of the node containers, a node’s properties will be set on a background thread, and its backing view/layer will be lazily constructed with the cached properties collected by the node. You rarely need to worry about jumping to a background thread as this will be taken care of by the framework, but it's important to know that this is happening under the hood. + +### View Wrapping + +In some cases, it is desirable to initialize a node and provide a view to be used as the backing view. These views are provided via a block that will return a view so that the actual construction of the view can be saved until later. These nodes’ display step happens synchronously. This is because a node can only be asynchronously displayed when it wraps an `_ASDisplayView` (the internal view subclass), not when it wraps a plain `UIView`. + +
+SwiftObjective-C + +
+
+ASDisplayNode *node = [ASDisplayNode alloc] initWithViewBlock:^{
+	SomeView *view  = [[SomeView alloc] init];
+	return view;
+}];
+	
+ + +
+
+ +Doing this allows you to wrap existing views if that is preferable to converting the `UIView` subclass to an `ASDisplayNode` subclass. + +
+ *** The only exception is that nodes use `position` instead of `center` for reasons beyond this intro. +
diff --git a/docs/_docs/editable-text-node.md b/docs/_docs/editable-text-node.md new file mode 100755 index 00000000..03429195 --- /dev/null +++ b/docs/_docs/editable-text-node.md @@ -0,0 +1,153 @@ +--- +title: ASEditableTextNode +layout: docs +permalink: /docs/editable-text-node.html +prevPage: scroll-node.html +nextPage: multiplex-image-node.html +--- + +`ASEditableTextNode` is available to be used anywhere you'd normally use a `UITextView` or `UITextField`. Under the hood, it uses a specialized `UITextView` as its backing view. You can access and configure this view directly any time after the node has loaded, as long as you do it on the main thread. + +It's also important to note that this node does not support layer backing due to the fact that it supports user interaction. + +### Basic Usage + +Using an editable text node as a text input is easy. If you want it to have text by default, you can assign an attributed string to the `attributedText` property. + +
+SwiftObjective-C + +
+
+ASEditableTextNode *editableTextNode = [[ASEditableTextNode alloc] init];
+
+editableTextNode.attributedText = [[NSAttributedString alloc] initWithString:@"Lorem ipsum dolor sit amet."];
+editableTextNode.textContainerInset = UIEdgeInsetsMake(8, 8, 8, 8);
+
+ + +
+
+ +### Placeholder Text + +If you want to display a text box with a placeholder that disappears after a user starts typing, just assign an attributed string to the `attributedPlaceholderText` property. + +
+SwiftObjective-C + +
+
+editableTextNode.attributedPlaceholderText = [[NSAttributedString alloc] initWithString:@"Type something here..."];
+
+ + +
+
+ +The property `isDisplayingPlaceholder` will initially return `YES`, but will toggle to `NO` any time the `attributedText` property is set to a non-empty string. + +### Typing Attributes + +To set up the style of the text your user will type into this text field, you can set the `typingAttributes`. + + +
+SwiftObjective-C + +
+
+editableTextNode.typingAttributes = @{NSForegroundColorAttributeName: [UIColor blueColor], 
+                                      NSBackgroundColorAttributeName: [UIColor redColor]};
+
+ + +
+
+ + +### ASEditableTextNode Delegate + +In order to respond to events associated with an editable text node, you can use any of the following delegate methods: + + +-- Indicates to the delegate that the text node began editing. + +
+SwiftObjective-C +
+
+- (void)editableTextNodeDidBeginEditing:(ASEditableTextNode *)editableTextNode;
+
+ +
+
+ +-- Asks the delegate whether the specified text should be replaced in the editable text node. + +
+SwiftObjective-C +
+
+- (BOOL)editableTextNode:(ASEditableTextNode *)editableTextNode shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text;
+
+ +
+
+ +-- Indicates to the delegate that the text node's selection has changed. + +
+SwiftObjective-C +
+
+- (void)editableTextNodeDidChangeSelection:(ASEditableTextNode *)editableTextNode fromSelectedRange:(NSRange)fromSelectedRange toSelectedRange:(NSRange)toSelectedRange dueToEditing:(BOOL)dueToEditing;
+
+ +
+
+ +-- Indicates to the delegate that the text node's text was updated. + +
+SwiftObjective-C +
+
+- (void)editableTextNodeDidUpdateText:(ASEditableTextNode *)editableTextNode;
+
+ +
+
+ +--  Indicates to the delegate that teh text node has finished editing. + +
+SwiftObjective-C +
+
+- (void)editableTextNodeDidFinishEditing:(ASEditableTextNode *)editableTextNode;
+
+ +
+
+ diff --git a/docs/_docs/faq.md b/docs/_docs/faq.md new file mode 100755 index 00000000..d188c76e --- /dev/null +++ b/docs/_docs/faq.md @@ -0,0 +1,125 @@ +--- +title: FAQ +layout: docs +permalink: /docs/faq.html +prevPage: subclassing.html +nextPage: containers-asviewcontroller.html +--- + +### Common Developer Mistakes + + + +### Common Conceptual Misunderstandings + + + +### Common Questions + + + +### Accessing the node's view before it is loaded +
+Node `-init` methods are often called off the main thread, therefore it is imperative that no UIKit objects are accessed. Examples of common errors include accessing the node's view or creating a gesture recognizer. Instead, these operations are ideal to perform in `-didLoad`. + +Interacting with UIKit in `-init` can cause crashes and performance problems. +
+ +### Make sure you access your data source outside the node block +
+The `indexPath` parameter is only valid _outside_ the node block returned in `nodeBlockForItemAtIndexPath:` or `nodeBlockForRowAtIndexPath:`. Because these blocks are executed on a background thread, the `indexPath` may be invalid by execution time, due to additional changes in the data source. + +See an example of how to correctly code a node block in the ASTableNode page. Just as with UIKit, it will cause an exception if Nil is returned from the block for any `ASCellNode`. +
+ +### Take steps to avoid a retain cycle in viewBlocks +
+When using `initWithViewBlock:` it is important to prevent a retain cycle by capturing a strong reference to self. The two ways that a cycle can be created are by using any instance variable inside the block or directly referencing self without using a weak pointer. + +You can use properties instead of instance variables as long as they are accessed on a weak pointer to self. + +Because viewBlocks are always executed on the main thread, it is safe to preform UIKit operations (including gesture recognizer creation and addition). + +Although the block is destroyed after the view is created, in the event that the block is never run and the view is never created, then a cycle can persist preventing memory from being released. +
+ +### ASCellNode Reusability +
+AsyncDisplayKit does not use cell reuse, for a number of specific reasons, one side effect of this is that it eliminates the large class of bugs associated with cell reuse. +
+ +### LayoutSpecs Are Regenerated +
+A node's layoutSpec gets regenerated every time its `layoutThatFits:` method is called. +
+ +### Layout API Sizing +
+If you're confused by `ASRelativeDimension`, `ASRelativeSize`, `ASRelativeSizeRange` and `ASSizeRange`, check out our Layout API Sizing guide. +
+ +### CALayer's .cornerRadius Property Kills Performance +
+CALayer's' .cornerRadius property is a disastrously expensive property that should only be used when there is no alternative. It is one of the least efficient, most render-intensive properties on CALayer (alongside shadowPath, masking, borders, etc). These properties trigger offscreen rendering to perform the clipping operation on every frame — 60FPS during scrolling! — even if the content in that area isn't changing. + +Using `.cornerRadius` will visually degraded performance on iPhone 4, 4S, and 5 / 5C (along with comparable iPads / iPods) and reduce head room and make frame drops more likely on 5S and newer devices. + +For a longer discussion and easy alternative corner rounding solutions, please read our comprehensive corner rounding guide. +
+ +### AsyncDisplayKit does not support UIKit Auto Layout or InterfaceBuilder +
+UIKit Auto Layout and InterfaceBuilder are not supported by AsyncDisplayKit. It is worth noting that both of these technologies are not permitted in established and disciplined iOS development teams, such as at Facebook, Instagram, and Pinterest. + +However, AsyncDisplayKit's Layout API provides a variety of ASLayoutSpec objects that allow implementing automatic layout which is more efficient (multithreaded, off the main thread), easier to debug (can step into the code and see where all values come from, as it is open source), and reusable (you can build composable layouts that can be shared with different parts of the UI). +
+ +### ASDisplayNode keep alive reference + +
+
+
+ASTextNode *title=[[ASTextNode alloc]init];
+title.attributedString=Text;
+[self addSubnode:title];
+
+retain cycles
+(
+"-> _keepalive_node -> ASTextNode ",
+"-> _view -> _ASDisplayView "
+)
+
+
+
+ +
+This retain cycle is intentionally created because the node is in a "live" view hierarchy (it is inside the UIWindow that is onscreen). + +To see why this is necessary, consider that Apple also creates this retain cycle between UIView and CALayer. If you create a UIView and add its layer to a super layer, and then release the UIView, it will stay alive even though the CALayer delegate pointing to it is weak. + +For the same reason, if the node's view is a descendant of a window, but there is no reference to the node, we keep the node alive with a strong reference from the view. + +Good application design should not rely on this behavior, because a strong reference to the node should be maintained by the subnodes array or by an instance variable. However, this condition occasionally occurs, for example when using a UIView animation API. This cycle should never create a leak or even extend the lifecycle of a node any longer than it is absolutely necessary. +
+ +### UICollectionViewCell Compatibility + +ASDK supports using UICollectionViewCells alongside native ASCellNodes. + +Note that these UIKit cells will **not** have the performance benefits of `ASCellNodes` (like preloading, async layout, and async drawing), even when mixed within the same `ASCollectionNode`. + +However, this interoperability allows developers the flexibility to test out the framework without needing to convert all of their cells at once. Read more here. diff --git a/docs/_docs/getting-started.md b/docs/_docs/getting-started.md new file mode 100755 index 00000000..4ed58e75 --- /dev/null +++ b/docs/_docs/getting-started.md @@ -0,0 +1,53 @@ +--- +title: Getting Started +layout: docs +permalink: /docs/getting-started.html +nextPage: resources.html +--- + +AsyncDisplayKit's basic unit is the `node`. `ASDisplayNode` is an abstraction +over `UIView`, which in turn is an abstraction over `CALayer`. Unlike views, which +can only be used on the main thread, nodes are thread-safe: you can +instantiate and configure entire hierarchies of them in parallel on background +threads. + +To keep its user interface smooth and responsive, your app should render at 60 +frames per second — the gold standard on iOS. This means the main thread +has one-sixtieth of a second to push each frame. That's 16 milliseconds to +execute all layout and drawing code! And because of system overhead, your code +usually has less than ten milliseconds to run before it causes a frame drop. + +AsyncDisplayKit lets you move image decoding, text sizing and rendering, and +other expensive UI operations off the main thread, to keep the main thread available to +respond to user interaction. AsyncDisplayKit has other tricks up its +sleeve too... but we'll get to that later. + +

Nodes

+ +If you're used to working with views, you already know how to use nodes. Most methods have a node equivalent and most `UIView` and `CALayer` properties are available as well. In any case where there is a naming discrepancy (such as `.clipsToBounds` vs `.masksToBounds`), nodes will default to the `UIView` name. The only exception is that nodes use position instead of center. + +Of course, you can always access the underlying view or layer directly via `node.view` or `node.layer`, just make sure to do it on the main thread! + +AsyncDisplayKit offers a variety of nodes to replace the majority of the UIKit components that you are used to. Large scale apps have been able to completely write their UI using just AsyncDisplayKit nodes. + +

Node Containers

+ +When converting an app to use AsyncDisplayKit, a common mistake is to add nodes directly to an existing view hierarchy. Doing this will virtually guarantee that your nodes will flash as they are rendered. + +Instead, you should add nodes as subnodes of one of the many node container classes. These containers are in charge of telling contained nodes what state they're currently in so that data can be loaded and nodes can be rendered as efficiently as possible. You should think of these classes as the integration point between UIKit and ASDK. + +

Layout Engine

+ +AsyncDisplayKit's layout engine is both one of its most powerful and one of its most unique features. Based on the CSS FlexBox model, it provides a declarative way of specifying a custom node's size and layout of its subnodes. While all nodes are concurrently rendered by default, asynchronous measurement and layout are performed by providing an `ASLayoutSpec` for each node. + +

Advanced Developer Features

+ +AsyncDisplayKit offers a variety of advanced developer features that cannot be found in UIKit or Foundation. Our developers have found that AsyncDisplyKit allows simplifications in their architecture and improves developer velocity. + +(Full list coming soon!) + +

Adding AsyncDisplayKit to your App

+ +If you are new to AsyncDisplayKit, we recommend that you check out our ASDKgram example app. We've created a handy guide (coming soon!) with step-by-step directions and a follow along example on how to add AsyncDisplayKit to an app. + +If you run into any problems along the way, reach out to us GitHub or the AsyncDisplayKit Slack community for help. diff --git a/docs/_docs/hit-test-slop.md b/docs/_docs/hit-test-slop.md new file mode 100755 index 00000000..157d7ae5 --- /dev/null +++ b/docs/_docs/hit-test-slop.md @@ -0,0 +1,44 @@ +--- +title: Hit Test Slop +layout: docs +permalink: /docs/hit-test-slop.html +prevPage: layout-transition-api.html +nextPage: batch-fetching-api.html +--- + +`ASDisplayNode` has a `hitTestSlop` property of type `UIEdgeInsets` that when set to a non-zero inset, increase the bounds for hit testing to make it easier to tap or perform gestures on this node. + +ASDisplayNode is the base class for all nodes, so this property is available on any of AsyncDisplayKit's nodes. + +
+Note: This affects the default implementation of -hitTest and -pointInside, so subclasses should call super if you override it and want hitTestSlop applied. +
+ +A node's ability to capture touch events is restricted by its parent's bounds + parent hitTestSlop UIEdgeInsets. Should you want to extend the hitTestSlop of a child outside its parent's bounds, simply extend the parent node's hitTestSlop to include the child's hitTestSlop needs. + +### Usage + +A common need for hit test slop, is when you have a text node (aka label) you'd like to use as a button. Often, the text node's height won't meet the 44 point minimum recommended for tappable areas. In that case, you can calculate the difference, and apply a negative inset to your label to increase the tappable area. + +
+SwiftObjective-C + +
+
+ASTextNode *textNode = [[ASTextNode alloc] init];
+
+CGFloat padding = (44.0 - button.bounds.size.height)/2.0;
+textNode.hitTestSlop = UIEdgeInsetsMake(-padding, 0, -padding, 0);
+
+ +
+
+ +
+To visualize hitTestSlop, check out the debug tool. +
diff --git a/docs/_docs/image-modification-block.md b/docs/_docs/image-modification-block.md new file mode 100755 index 00000000..3a4e1a44 --- /dev/null +++ b/docs/_docs/image-modification-block.md @@ -0,0 +1,47 @@ +--- +title: Image Modification Blocks +layout: docs +permalink: /docs/image-modification-block.html +prevPage: inversion.html +nextPage: placeholder-fade-duration.html +--- + +Many times, operations that would affect the appearance of an image you're displaying are big sources of main thread work. Naturally, you want to move these to a background thread. + +By assigning an `imageModificationBlock` to your imageNode, you can define a set of transformations that need to happen asynchronously to any image that gets set on the imageNode. + +
+SwiftObjective-C + +
+
+_backgroundImageNode.imageModificationBlock = ^(UIImage *image) {
+	UIImage *newImage = [image applyBlurWithRadius:30 
+										 tintColor:[UIColor colorWithWhite:0.5 alpha:0.3] 
+							 saturationDeltaFactor:1.8 
+							 			 maskImage:nil];
+	return newImage ? newImage : image;
+};
+
+//some time later...
+
+_backgroundImageNode.image = someImage;
+
+ + +
+
+ +The image named "someImage" will now be blurred asynchronously before being assigned to the imageNode to be displayed. + diff --git a/docs/_docs/image-node.md b/docs/_docs/image-node.md new file mode 100755 index 00000000..77b2bdd5 --- /dev/null +++ b/docs/_docs/image-node.md @@ -0,0 +1,121 @@ +--- +title: ASImageNode +layout: docs +permalink: /docs/image-node.html +prevPage: text-node.html +nextPage: network-image-node.html +--- + +`ASImageNode` is the ASDK equivalent to `UIImageView`. The most basic difference is that images are decoded asynchronously by default. Of course, there are more advanced improvments as well such as GIF support and `imageModificationBlock`s. + +### Basic Usage + +Using an image node works exactly like using an image view. + +
+SwiftObjective-C + +
+
+ASImageNode *imageNode = [[ASImageNode alloc] init];
+
+imageNode.image = [UIImage imageNamed:@"someImage"];
+imageNode.contentMode = UIViewContentModeScaleAspectFill;
+
+ + +
+
+ + +### Image Modification Block + +Many times, operations that would affect the appearance of an image you're displaying are big sources of main thread work. Naturally, you want to move these to a background thread. By assigning an `imageModificationBlock` to your `imageNode`, you can define a set of transformations that need to happen asynchronously to any image that gets set on the `imageNode`. + +
+SwiftObjective-C + +
+
+_backgroundImageNode.imageModificationBlock = ^(UIImage *image) {
+	UIImage *newImage = [image applyBlurWithRadius:30 
+										 tintColor:[UIColor colorWithWhite:0.5 alpha:0.3] 
+							 saturationDeltaFactor:1.8 
+							 			 maskImage:nil];
+	return newImage ? newImage : image;
+};
+
+//some time later...
+
+_backgroundImageNode.image = someImage;
+
+ + +
+
+ +The image named "someImage" will now be blurred asynchronously before being assigned to the `imageNode` to be displayed. + +### Image Cropping + +When an `imageNode`'s `contentMode` property is set to `UIViewContentModeScaleAspectFill`, it will automatically expand the image to fill the entire area of the imageNode, and crop any areas that go past the bounds due to scaling the image. + +By default, the expanded image will be centered within the bounds of the view. Take the following cat image. His face gets cut off by default. + + + +That's messed up. To fix it, you can set the `cropRect` property to move the image over. By default it is set to `CGRectMake(0.5, 0.5, 0.0, 0.0)`. + +The rectangle is specified as a "unit rectangle," using percentages of the source image's width and height. To show the image starting at the left side, you can set the `cropRect`'s `x` value to be `0.0`, meaning the image's origin should start at `{0, 0}` as opposed to the default. + +
+SwiftObjective-C + +
+
+self.animalImageNode.cropRect = CGRectMake(0, 0, 0.0, 0.0);
+
+ + +
+
+ +Leaving the width and height values at `0.0` means the image won't be stretched. + + + +Alternatively, you can set the `x` value of the origin to `1.0` to right align the image. + + + +### Forced Upscaling + +By default, an image won't be upscaled on the CPU when it is too small to fit into the bounds of the `imageNode` it has been set on. + +You can set `forceUpscaling` to `YES` if you'd like to change this fact. Doing so means your app will take up more memory any time you use an image that is smaller than its destination. + +### Detecting Image Scaling + +By using the pixel scaling tool, you can easily check each image in your app to see how much it has been scaled up or down. + +If images are too big, you risk rendering excessive amounts of image data, and when they're too small you spend time upscaling a low quality image. + +If you control your API, consider returning correctly scaled images so that this work can be avoided. diff --git a/docs/_docs/index.html b/docs/_docs/index.html new file mode 100755 index 00000000..930d84dd --- /dev/null +++ b/docs/_docs/index.html @@ -0,0 +1,4 @@ +--- +layout: redirect +destination: /docs/getting-started.html +--- diff --git a/docs/_docs/inset-layout-spec.md b/docs/_docs/inset-layout-spec.md new file mode 100755 index 00000000..ad3bd3e5 --- /dev/null +++ b/docs/_docs/inset-layout-spec.md @@ -0,0 +1,7 @@ +--- +title: ASInsetLayoutSpec +layout: docs +permalink: /docs/inset-layout-spec.html +--- + +
😑 This page is coming soon...
\ No newline at end of file diff --git a/docs/_docs/installation.md b/docs/_docs/installation.md new file mode 100755 index 00000000..10f39e8b --- /dev/null +++ b/docs/_docs/installation.md @@ -0,0 +1,114 @@ +--- +title: Installation +layout: docs +permalink: /docs/installation.html +prevPage: resources.html +nextPage: adoption-guide-2-0-beta1.html +--- + +AsyncDisplayKit may be added to your project via CocoaPods or Carthage. Do not forget to import the framework header: + +
+
+
+#import 
+
+
+
+ +or create a Objective-C bridging header (Swift). If you have any problems installing AsyncDisplayKit, please contact us on Github or Slack! + +## CocoaPods + +AsyncDisplayKit is available on CocoaPods. Add the following to your Podfile: + +
+
+
+target 'MyApp' do
+	pod "AsyncDisplayKit"
+end
+
+
+
+ +Quit Xcode completely before running + +
+
+
+> pod install
+
+
+
+ +in the project directory in Terminal. + +To update your version of AsyncDisplayKit, run + +
+
+
+> pod update AsyncDisplayKit
+
+
+
+ +in the project directory in Terminal. + +Don't forget to use the workspace `.xcworkspace` file, _not_ the project `.xcodeproj` file. + +## Carthage (standard build) + +
+The standard way to use Carthage is to have a Cartfile list the dependencies, and then run `carthage update` to download the dependenices into the `Cathage/Checkouts` folder and build each of those into frameworks located in the `Carthage/Build` folder, and finally the developer has to manually integrate in the project. +
+ +AsyncDisplayKit is also available through Carthage. + +Add the following to your Cartfile to get the **latest release** branch: + +
+
+
+github "facebook/AsyncDisplayKit"
+
+
+
+ +
+Or, to get the **master** branch: + +
+
+
+github "facebook/AsyncDisplayKit" "master"
+
+
+
+ +
+AsyncDisplayKit has its own Cartfile which lists its dependencies, so this is the only line you will need to include in your Cartfile. + +Run + +
+
+
+> carthage update
+
+
+
+ +
+in Terminal. This will fetch dependencies into a `Carthage/Checkouts` folder, then build each one. + +Look for terminal output confirming `AsyncDisplayKit`, `PINRemoteImage (3.0.0-beta.2)` and `PINCache` are all fetched and built. The ASDK framework Cartfile should handle the dependencies correctly. + +In Xcode, on your application targets’ **“General”** settings tab, in the **“Linked Frameworks and Libraries”** section, drag and drop each framework you want to use from the `Carthage/Build` folder on disk. + +## Carthage (light) + +AsyncDisplayKit does not yet support the lighter way of using Carthage, in which you manually add the project files. This is because one of its dependencies, `PINCache` (a nested dependency of `PINRemoteImage`) does not yet have a project file. + +Without including `PINRemoteImage` and `PINCache`, you will not get AsyncDisplayKit's full image feature set. diff --git a/docs/_docs/intelligent-preloading.md b/docs/_docs/intelligent-preloading.md new file mode 100755 index 00000000..e5353a59 --- /dev/null +++ b/docs/_docs/intelligent-preloading.md @@ -0,0 +1,95 @@ +--- +title: Intelligent Preloading +layout: docs +permalink: /docs/intelligent-preloading.html +prevPage: upgrading.html +nextPage: containers-overview.html +--- + +While a node's ability to be rendered and measured asynchronously and concurrently makes it quite powerful, another crucially important layer to ASDK is the idea of intelligent preloading. + +As was pointed out in Getting Started, it is rarely advantageous to use a node outside of the context of one of the node containers. This is due to the fact that all nodes have a notion of their current interface state. + +This `interfaceState` property is constantly updated by an `ASRangeController` which all containers create and maintain internally. + +A node used outside of a container won't have its state updated by any range controller. This sometimes results in a flash as nodes are rendered after realizing they're already onscreen without any warning. + +## Interface State Ranges + +When nodes are added to a scrolling or paging interface they are typically in one of the following ranges. This means that as the scrolling view is scrolled, their interface states will be updated as they move through them. + + + +A node will be in one of following ranges: + + + + + + + + + + + + + + + + + + +
Interface StateDescription
PreloadThe furthest range out from being visible. This is where content is gathered from an external source, whether that’s some API or a local disk.
DisplayHere, display tasks such as text rasterization and image decoding take place.
VisibleThe node is onscreen by at least one pixel.
+ +## ASRangeTuningParameters + +The size of each of these ranges is measured in "screenfuls". While the default sizes will work well for many use cases, they can be tweaked quite easily by setting the tuning parameters for range type on your scrolling node. + + + +In the above visualization of a scrolling collection, the user is scrolling down. As you can see, the sizes of the ranges in the leading direction are quite a bit larger than the content the user is moving away from (the trailing direction). If the user were to change directions, the leading and trailing sides would dynamically swap in order to keep memory usage optimal. This allows you to worry about defining the leading and trailing sizes without having to worry about reacting to the changing scroll directions of your user. + +Intelligent preloading also works in multiple dimensions. + +## Interface State Callbacks + +As a user scrolls, nodes move through the ranges and react appropriately by loading data, rendering, etc. Your own node subclasses can easily tap into this mechanism by implementing the corresponding callback methods. + +#### Visible Range + +
+ +
+
+-didEnterVisibleState
+-didExitVisibleState
+
+
+
+ +#### Display Range + +
+ +
+
+-didEnterDisplayState
+-didExitDisplayState
+
+
+
+ +#### Preload Range + +
+ +
+
+-didEnterPreloadState
+-didExitPreloadState
+
+
+
+ +
+Just remember to call super ok? 😉 diff --git a/docs/_docs/inversion.md b/docs/_docs/inversion.md new file mode 100755 index 00000000..d28edb1e --- /dev/null +++ b/docs/_docs/inversion.md @@ -0,0 +1,32 @@ +--- +title: Inversion +layout: docs +permalink: /docs/inversion.html +prevPage: automatic-subnode-mgmt.html +nextPage: image-modification-block.html +--- + +`ASTableNode` and `ASCollectionNode` have a `inverted` property of type `BOOL` that when set to `YES`, will automatically invert the content so that it's layed out bottom to top, that is the 'first' (indexPath 0, 0) node is at the bottom rather than the top as usual. This is extremely covenient for chat/messaging apps, and with AsyncDisplayKit it only takes one property. + +When this is enabled, developers only have to take one more step to have full inversion support and that is to adjust the `contentInset` of their `ASTableNode` or `ASCollectionNode` like so: + +
+ + Swift + Objective-C + + +
+
+ CGFloat inset = [self topBarsHeight];
+ self.tableNode.view.contentInset = UIEdgeInsetsMake(0, 0, inset, 0);
+ self.tableNode.view.scrollIndicatorInsets = UIEdgeInsetsMake(0, 0, inset, 0);
+  
+ + +
+
+ +See the SocialAppLayout-Inverted example project for more details. diff --git a/docs/_docs/layer-backing.md b/docs/_docs/layer-backing.md new file mode 100755 index 00000000..d02a65f9 --- /dev/null +++ b/docs/_docs/layer-backing.md @@ -0,0 +1,29 @@ +--- +title: Layer Backing +layout: docs +permalink: /docs/layer-backing.html +prevPage: accessibility.html +nextPage: subtree-rasterization.html +--- + +In some cases, you can substantially improve your app's performance by using layers instead of views. **We recommend enabling layer-backing in any custom node that doesn't need touch handling**. + +With UIKit, manually converting view-based code to layers is laborious due to the difference in APIs. Worse, if at some point you need to enable touch handling or other view-specific functionality, you have to manually convert everything back (and risk regressions!). + +With all AsyncDisplayKit nodes, converting an entire subtree from views to layers is as simple as: + +
+SwiftObjective-C +
+
+rootNode.layerBacked = YES;
+
+ +
+
+ +...and if you need to go back, it's as simple as deleting one line. + + diff --git a/docs/_docs/layout-api-debugging.md b/docs/_docs/layout-api-debugging.md new file mode 100755 index 00000000..495098d7 --- /dev/null +++ b/docs/_docs/layout-api-debugging.md @@ -0,0 +1,69 @@ +--- +title: Layout Debugging +layout: docs +permalink: /docs/layout-api-debugging.html +prevPage: automatic-layout-containers.html +nextPage: layout-api-sizing.html +--- + +Here are some helpful questions to ask yourself when you encounter any issues composing layoutSpecs. + +## Am I the child of an `ASStackLayoutSpec` or an `ASStaticLayoutSpec`? +
+Certain `ASLayoutable` properties will _only_ apply when the layoutable is a child of a _stack_ spec (the child is called an ASStackLayoutable), while other properties _only_ apply when the layoutable is a child of a _static_ spec (the child is called an ASStaticLayoutable). + +- table of [`ASStackLayoutables` properties](http://asyncdisplaykit.org/docs/automatic-layout-containers.html#asstacklayoutable-properties) +- table of [`ASStaticLayoutable` properties](http://asyncdisplaykit.org/docs/automatic-layout-containers.html#asstaticlayoutable-properties) + +All ASLayoutable properties can be applied to _any_ layoutable (e.g. any node or layout spec), however certain properties will only take effect depending on the type of the parent layout spec they are wrapped in. + +## Have I considered where to set `ASLayoutable` properties? +
+Let's say you have a node (`n1`) and you wrap it in a layout spec (`s1`). If you want to wrap the layout spec (`s1`) in a stack or static spec (`s2`), you will need to set all of the properties on the spec (`s1`) and not the node (`n1`). + +A common examples of this confusion involves flex grow and flex shrink. E.g. a node with `.flexGrow` enabled is wrapped in an inset spec. The inset spec will not grow as we expect. **Solution:** enable `.flexGrow` on the inset spec as well. + +## Have I provided sizes for any node that lacks an intrinsic size? +
+AsyncDisplayKit's layout pass is recursive, starting at the layout spec returned from `-layoutSpecThatFits:` and proceeding down until it reaches the leaf nodes included in any nested layout specs. + +Some leaf nodes have a concept of their own intrinsic size, such as ASTextNode or ASImageNode. A text node knows the length of its formatted string and an ASImageNode knows the size of its static image. Other leaf nodes require an intrinsic size to be set. + +Nodes that require the developer to provide an intrinsic size: + +- `ASNetworkImageNode` or `ASMultiplexImageNode` have no intrinsic size until the image is downloaded. **A size must be provided for either node.** +- `ASVideoNode` or `ASVideoNodePlayer` have no intrinsic size until the video is downloaded. **A size must be provided for either node.** +- `ASDisplayNode` custom subclasses may provide their intrinisc size by implementing `-calculateSizeThatFits:`. + +To provide an intrinisc size for these nodes that lack intrinsic sizes (even if only momentarily), you can set one of the following: + +- set `.preferredFrameSize` on any node. +- set `.sizeRange` for children of **static** specs only. +- implement `-calculateSizeThatFits:` for **custom ASDisplayNode subclasses only**. + +*_Note that .preferredFrameSize is not considered by ASTextNodes. Also, setting .sizeRange on a node will override the node's intrinisic size provided by -calculateSizeThatFits:_ + +## When do I use `.preferredFrameSize` vs `.sizeRange`? +
+Set `.preferredFrameSize` to set a size for any node. Note that setting .preferredFrameSize on an `ASTextNode` will silently fail. We are working on fixing this, but in the meantime, you can wrap the ASTextNode in a static spec and provide it a .sizeRange. + +Set `.sizeRange` to set a size range for any node or layout spec that is the child of a *static* spec consisting. `.sizeRange` is the *only* way to set a size on a layout spec. Again, when using `.sizeRange`, you *must wrap the layoutable in a static layout spec for it to take effect.* + +A `.sizeRange` consists of a minimum and maximum constrained size (these sizes can be a specific point value or a relative value, like 70%). For details on the `.sizeRange` property's custom value type, check out our [Layout API Sizing guide](http://asyncdisplaykit.org/docs/layout-api-sizing.html). + +## `ASRelativeDimension` vs `ASRelativeSize` vs `ASRelativeSizeRange` vs `ASSizeRange` +
+AsyncDisplayKit's Layout API supports configuring node and layout spec sizes with specific point values as well as relative values. Read the [Layout API Sizing guide](http://asyncdisplaykit.org/docs/layout-api-sizing.html) for a helpful chart and documentation on our custom layout value types. + +## Debugging layout specs with ASCII art +
+Calling `-asciiArtString` on any `ASDisplayNode` or `ASLayoutSpec` returns an ascii-art representation of the object and its children. An example of a simple layoutSpec ascii-art console output can be seen below. + +``` +-----------------------ASStackLayoutSpec---------------------- +| -----ASStackLayoutSpec----- -----ASStackLayoutSpec----- | +| | ASImageNode | | ASImageNode | | +| | ASImageNode | | ASImageNode | | +| --------------------------- --------------------------- | +-------------------------------------------------------------- + ``` diff --git a/docs/_docs/layout-api-sizing.md b/docs/_docs/layout-api-sizing.md new file mode 100755 index 00000000..7937793c --- /dev/null +++ b/docs/_docs/layout-api-sizing.md @@ -0,0 +1,171 @@ +--- +title: Layout API Sizing +layout: docs +permalink: /docs/layout-api-sizing.html +prevPage: layout-api-debugging.html +nextPage: layout-transition-api.html +--- + +The easiest way to understand the compound dimension types in the Layout API is to see all the units in relation to one another. + + + +## Values (CGFloat, ASRelativeDimension) +
+`ASRelativeDimension` is essentially a normal **CGFloat with support for representing either a point value, or a % value**. It allows the same API to take in both fixed values, as well as relative ones. + +ASRelativeDimension is used to set the `flexBasis` property on a child of an `ASStackLayoutSpec`. The flexBasis property specifies the initial size in the stack dimension for this object, where the stack dimension is whether it is a horizontal or vertical stack. + +When a relative (%) value is used, it is resolved against the size of the parent. For example, an item with 50% flexBasis will ultimately have a point value set on it at the time that the stack achieves a concrete size. + +
+Note that .flexBasis can be set on any <ASLayoutable> (a node, or a layout spec), but will only take effect if that element is added as a child of a stack layout spec. This container-dependence of layoutable properties is a key area we’re working on clarifying. +
+ +#### Constructing ASRelativeDimensions +
+`ASDimension.h` contains 3 convenience functions to construct an `ASRelativeDimension`. It is easiest to use function that corresponds to the type (top 2 functions). + +
+SwiftObjective-C + +
+
+ASRelativeDimensionMakeWithPoints(CGFloat points);
+ASRelativeDimensionMakeWithPercent(CGFloat percent);
+ASRelativeDimensionMake(ASRelativeDimensionType type, CGFloat value);
+
+ +
+
+ +#### ASRelativeDimension Example +
+`PIPlaceSingleDetailNode` uses flexBasis to set 2 child nodes of a horizontal stack to share the width 40 / 60: + +
+SwiftObjective-C + +
+
+leftSideStack.flexBasis = ASRelativeDimensionMakeWithPercent(0.4f);
+self.detailLabel.flexBasis  = ASRelativeDimensionMakeWithPercent(0.6f);
+[horizontalStack setChildren:@[leftSideStack, self.detailLabel]];
+
+ +
+
+ + + +## Sizes (CGSize, ASRelativeSize) +
+`ASRelativeSize` is **similar to a CGSize, but its width and height may represent either a point or percent value.**  In fact, their unit type may even be different from one another. `ASRelativeSize` doesn't have a direct use in the Layout API, except to construct an `ASRelativeSizeRange`. + +- an `ASRelativeSize` consists of a `.width` and `.height` that are each `ASRelativeDimensions`. + +- the type of the width and height are independent; either one individually, or both, may be a point or percent value. (e.g. you could specify that an ASRelativeSize that has a height in points, but a variable % width) + +#### Constructing ASRelativeSizes +
+`ASRelativeSize.h` contains 2 convenience functions to construct an `ASRelativeSize`. **If you don't need to support relative (%) values, you can construct an `ASRelativeSize` with just a CGSize.** + +
+SwiftObjective-C + +
+
+ASRelativeSizeMake(ASRelativeDimension width, ASRelativeDimension height);
+ASRelativeSizeMakeWithCGSize(CGSize size);
+
+ +
+
+ +## Size Ranges (ASSizeRange, ASRelativeSizeRange) + +Because the layout spec system allows flexibility with elements growing and shrinking, we sometimes need to provide limits / boundaries to its flexibility. + +There are two size range types, but in essence, both contain a minimum and maximum size and that are used to influence the result of layout measurements. + +In the Pinterest code base, the **minimum size seems to be only necessary for stack specs in order to determine how much space to fill in between the children.** For example, with buttons in a nav bar, we don’t want them to stack as closely together as they can fit — rather a minimum width, as wide as the screen, is specified and causes the stack to add spacing to satisfy that constraint. + +**It’s much more common that the “max” constraint is what matters, though.** This is the case when text is wrapping or truncating - it’s encountering the maximum allowed width. Setting a minimum width for text doesn’t actually do anything—the text can’t be made longer—unless it’s in a stack, and spacing is added around it. + +#### ASSizeRange +
+UIKit doesn't provide a structure to bundle a minimum and maximum CGSize. So `ASSizeRange` was created to support **a minimum and maximum CGSize pair**. + +The `constrainedSize` that is passed as an input to `layoutSpecThatFits:` is an `ASSizeRange`. + +
+SwiftObjective-C + +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize;
+
+ +
+
+ +#### ASRelativeSizeRange +
+`ASRelativeSizeRange` is essentially **a minimum and maximum size pair, that are used to constrain the size of a layout object.** The minimum and maximum sizes must **support both point and relative sizes**, which is where our friend the ASRelativeSize comes in. Hence, an ASRelativeSizeRange consists of a minimum and maximum `ASRelativeSize`. + +ASRelativeSizeRange is used to set the `sizeRange` property on a child of an `ASStaticLayoutSpec`. If specified, the child's size is restricted according to this size. + +
+Note that .sizeRange can be set on any <ASLayoutable> (a node, or a layout spec), but will only take effect if that element is added as a child of a static layout spec. This container-dependence of layoutable properties is a key area we’re working on clarifying. +
+ +#### ASSizeRange vs. ASRelativeSizeRange +
+Why do we pass a `ASSizeRange *constrainedSize` to a node's `layoutSpecThatFits:` function, but a `ASRelativeSizeRange` for the `.sizeRange` property on an element provided as a child of a layout spec? + + It’s pretty rare that you need the percent feature for a .sizeRange feature, but it’s there to make the API as flexible as possible. The input value of the constrainedSize that comes into the argument, has already been resolved by the parent’s size. It may have been influenced by a percent type, but has always be converted by that point into points. + +#### Constructing ASRelativeSizeRange +
+`ASRelativeSize.h` contains 4 convenience functions to construct an `ASRelativeSizeRange` from the various smaller units. + +- Percentage and point values can be combined. E.g. you could specify that an object is a certain height in points, but a variable percentage width. + +- If you only care to constrain the min / max or width / height, you can pass in `CGFLOAT_MIN`, `CGFLOAT_MAX`, `constrainedSize.max.width`, etc + +Most of the time, relative values are not needed for a size range _and_ the design requires an object to be forced to a particular size (min size = max size = no range). In this common case, you can use: + +
+SwiftObjective-C + +
+
+ASRelativeSizeRangeMakeWithExactCGSize(CGSize exact);
+
+ +
+
+ +### Sizing Conclusion +
+Here we have our original table, which has been annotated to show the uses of the various units in the Layout API. + + + +It’s worth noting that that there’s a certain flexibility to be able to use so many powerful options with a single API - flexBasis and sizeRange can be used to set points and percentages in different directions. However, since the majority of do not use the full set of options, we should adjust the API so that the powerful capabilities are a slightly more hidden. + diff --git a/docs/_docs/layout-engine.md b/docs/_docs/layout-engine.md new file mode 100755 index 00000000..79af87a4 --- /dev/null +++ b/docs/_docs/layout-engine.md @@ -0,0 +1,87 @@ +--- +title: Layout Engine +layout: docs +permalink: /docs/layout-engine.html +prevPage: subclassing.html +nextPage: containers-overview.html +--- + +AsyncDisplayKit's layout engine is based on the CSS Box Model. While it is the feature of the framework that bears the weakest resemblance to the UIKit equivalent (AutoLayout), it is also among the most useful features once you've gotten used to it. With enough practice, you may just come to prefer creating declarative layouts to the constraint based approach. ;] + +The main way you participate in this system is by implementing `-layoutSpecThatFits:` in a node subclass. Here, you declaratively build up layout specs from the inside out, returning the final spec which will contain the rest. + +
+SwiftObjective-C +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+  ASStackLayoutSpec *verticalStack = [ASStackLayoutSpec verticalStackLayoutSpec];
+  verticalStack.direction          = ASStackLayoutDirectionVertical;
+  verticalStack.spacing            = 4.0;
+  [verticalStack setChildren:_commentNodes];
+
+  return verticalStack;
+}
+  
+ + +
+
+ +Whle this example is extremely simple, it gives you an idea of how to use a layout spec. A stack layout spec, for instance, defines a layout of nodes in which the chlidren will be laid out adjacently, in the direction specified, with the spacing specified. It is very similar to `UIStackView` but with the added benefit of backwards compatibility. + +### ASLayoutable + +Layout spec's children can be any object whose class conforms to the `` protocol. All nodes, as well as all layout specs conform to the `` protocol. This means that your layout can be built up in composable chunks until you have what you want. + +Say you wanted to add 8 pts of padding to the stack you've already set up: + +
+SwiftObjective-C +
+ +
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+  ASStackLayoutSpec *verticalStack = [ASStackLayoutSpec verticalStackLayoutSpec];
+  verticalStack.direction          = ASStackLayoutDirectionVertical;
+  verticalStack.spacing            = 4.0;
+  [verticalStack setChildren:_commentNodes];
+  
+  UIEdgeInsets insets = UIEdgeInsetsMake(8, 8, 8, 8);
+  ASInsetLayoutSpec *insetSpec = [ASInsetLayoutSpec insetLayoutSpecWithInsets:insets 
+                                      child:verticalStack];
+  
+  return insetSpec;
+}
+  
+ + +
+
+ +You can easily do that by making that stack the child of an inset layout spec. + +Naturally, using layout specs takes a bit of practice so to learn more, check out the layout section. diff --git a/docs/_docs/layout-options.md b/docs/_docs/layout-options.md new file mode 100755 index 00000000..cdefd2a6 --- /dev/null +++ b/docs/_docs/layout-options.md @@ -0,0 +1,52 @@ +--- +title: Layout Options +layout: docs +permalink: /docs/layout-options.html +prevPage: automatic-layout-debugging.html +nextPage: layer-backing.html +--- + +When using ASDK, you have three options for layout. Note that UIKit Autolayout is **not** supported by ASDK. +#Manual Sizing & Layout + +This original layout method shipped with ASDK 1.0 and is analogous to UIKit's layout methods. Use this method for ASViewControllers (unless you subclass the node). + +`[ASDisplayNode calculateSizeThatFits:]` **vs.** `[UIView sizeThatFits:]` + +`[ASDisplayNode layout]` **vs.** `[UIView layoutSubviews]` + +###Advantages (over UIKit) +- Eliminates all main thread layout cost +- Results are cached + +###Shortcomings (same as UIKit): +- Code duplication between methods +- Logic is not reusable + +#Unified Sizing & Layout + +This layout method does not have a UIKit analog. It is implemented by calling + +`- (ASLayout *)calculateLayoutThatFits: (ASSizeRange)constraint` + +###Advantages +- zero duplication +- still async, still cached + +###Shortcomings +- logic is not reusable, and is still manual + +# Automatic, Extensible Layout + +This is the reccomended layout method. It does not have a UIKit analog and is implemented by calling + +`- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constraint` +###Advantages +- can reuse even complex, custom layouts +- built-in specs provide automatic layout +- combine to compose new layouts easily +- still async, cached, and zero duplication + +The diagram below shows how options #2 and #3 above both result in an ASLayout, except that in option #3, the ASLayout is produced automatically by the ASLayoutSpec. + + diff --git a/docs/_docs/layout-transition-api.md b/docs/_docs/layout-transition-api.md new file mode 100755 index 00000000..0198f088 --- /dev/null +++ b/docs/_docs/layout-transition-api.md @@ -0,0 +1,259 @@ +--- +title: Layout Transition API +layout: docs +permalink: /docs/layout-transition-api.html +prevPage: layout2-api-sizing.html +nextPage: hit-test-slop.html +--- + +The Layout Transition API was designed to make all animations with AsyncDisplayKit easy - even transforming an entire set of views into a completely different set of views! + +With this system, you simply specify the desired layout and AsyncDisplayKit will do the work to figure out differences from the current layout. It will automatically add new elements, remove unneeded elements after the transiton, and update the position of any existing elements. + +There are also easy to use APIs that allow you to fully customize the starting position of newly introduced elements, as well as the ending position of removed elements. + +
+Use of Automatic Subnode Management is required to use the Layout Transition API. +
+ +## Animating between Layouts +
+The layout Transition API makes it easy to animate between a node's generated layouts in response to some internal state change in a node. + +Imagine you wanted to implement this sign up form and animate in the new field when tapping the next button: + +![Imgur](http://i.imgur.com/Dsf1R72.gif) + +A standard way to implement this would be to create a container node called `SignupNode` that includes two editable text field nodes and a button node as subnodes. We'll include a property on the SignupNode called `fieldState` that will be used to select which editable text field node to show when the node calculates its layout. + +The internal layout spec of the `SignupNode` container would look something like this: + +
+ + Swift + Objective-C + +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+  FieldNode *field;
+  if (self.fieldState == SignupNodeName) {
+    field = self.nameField;
+  } else {
+    field = self.ageField;
+  }
+
+  ASStackLayoutSpec *stack = [[ASStackLayoutSpec alloc] init];
+  [stack setChildren:@[field, self.buttonNode]];
+
+  UIEdgeInsets insets = UIEdgeInsetsMake(15.0, 15.0, 15.0, 15.0);
+  return [ASInsetLayoutSpec insetLayoutSpecWithInsets:insets child:stack];
+}
+
+ +
+
+ +To trigger a transition from the `nameField` to the `ageField` in this example, we'll update the SignupNode's `.fieldState` property and begin the transition with `transitionLayoutWithAnimation:`. + +This method will invalidate the current calculated layout and recompute a new layout with the `ageField` now in the stack. + +
+ + Swift + Objective-C + +
+
+self.signupNode.fieldState = SignupNodeAge;
+
+[self.signupNode transitionLayoutWithAnimation:YES];
+
+ +
+
+ +In the default implementation of this API, the layout will recalculate the new layout and use its sublayouts to size and position the SignupNode's subnodes without animation. Future versions of this API will likely include a default animation between layouts and we're open to feedback on what you'd like to see here. However, we'll need to implement a custom animation block to handle the signup form case. + +The example below represents an override of `animateLayoutTransition:` in the SignupNode. + +This method is called after the new layout has been calculated via `transitionLayoutWithAnimation:` and in the implementation we'll perform a specific animation based upon the fieldState property that was set before the animation was triggered. + +
+ + Swift + Objective-C + +
+
+- (void)animateLayoutTransition:(id<ASContextTransitioning>)context
+{
+  if (self.fieldState == SignupNodeName) {
+    CGRect initialNameFrame = [context initialFrameForNode:self.ageField];
+    initialNameFrame.origin.x += initialNameFrame.size.width;
+    self.nameField.frame = initialNameFrame;
+    self.nameField.alpha = 0.0;
+    CGRect finalAgeFrame = [context finalFrameForNode:self.nameField];
+    finalAgeFrame.origin.x -= finalAgeFrame.size.width;
+    [UIView animateWithDuration:0.4 animations:^{
+      self.nameField.frame = [context finalFrameForNode:self.nameField];
+      self.nameField.alpha = 1.0;
+      self.ageField.frame = finalAgeFrame;
+      self.ageField.alpha = 0.0;
+    } completion:^(BOOL finished) {
+      [context completeTransition:finished];
+    }];
+  } else {
+    CGRect initialAgeFrame = [context initialFrameForNode:self.nameField];
+    initialAgeFrame.origin.x += initialAgeFrame.size.width;
+    self.ageField.frame = initialAgeFrame;
+    self.ageField.alpha = 0.0;
+    CGRect finalNameFrame = [context finalFrameForNode:self.ageField];
+    finalNameFrame.origin.x -= finalNameFrame.size.width;
+    [UIView animateWithDuration:0.4 animations:^{
+      self.ageField.frame = [context finalFrameForNode:self.ageField];
+      self.ageField.alpha = 1.0;
+      self.nameField.frame = finalNameFrame;
+      self.nameField.alpha = 0.0;
+    } completion:^(BOOL finished) {
+      [context completeTransition:finished];
+    }];
+  }
+}
+
+ +
+
+ +The passed `ASContextTransitioning` context object in this method contains relevant information to help you determine the state of the nodes before and after the transition. It includes getters into old and new constrained sizes, inserted and removed nodes, and even the raw old and new `ASLayout` objects. In the `SignupNode` example, we're using it to determine the frame for each of the fields and animate them in an out of place. + +It is imperative to call `completeTransition:` on the context object once your animation has finished, as it will perform the necessary internal steps for the newly calculated layout to become the current `calculatedLayout`. + +Note that there hasn't been a use of `addSubnode:` or `removeFromSupernode` during the transition. AsyncDisplayKit's layout transition API analyzes the differences in the node hierarchy between the old and new layout, implicitly performing node insertions and removals via Automatic Subnode Management. + +Nodes are inserted before your implementation of `animateLayoutTransition:` is called and this is a good place to manually manage the hierarchy before you begin the animation. Removals are preformed in `didCompleteLayoutTransition:` after you call `completeTransition:` on the context object. If you need to manually perform deletions, override `didCompleteLayoutTransition:` and perform your custom operations. Note that this will override the default behavior and it is recommended to either call `super` or walk through the `removedSubnodes` getter in the context object to perform the cleanup. + +Passing `NO` to `transitionLayoutWithAnimation:` will still run through your `animateLayoutTransition:` and `didCompleteLayoutTransition:` implementations with the `[context isAnimated]` property set to `NO`. It is your choice on how to handle this case — if at all. An easy way to provide a default implementation this is to call super: + +
+ + Swift + Objective-C + +
+
+- (void)animateLayoutTransition:(id<ASContextTransitioning>)context
+{
+  if ([context isAnimated]) {
+    // perform animation
+  } else {
+    [super animateLayoutTransition:context];
+  }
+}
+
+ +
+
+ +## Animating constrainedSize Changes +
+There will be times you'll simply want to respond to bounds changes to your node and animate the recalculation of its layout. To handle this case, call `transitionLayoutWithSizeRange:animated:` on your node. + +This method is similar to `transitionLayoutWithAnimation:`, but will not trigger an animation if the passed `ASSizeRange` is equal to the current `constrainedSizeForCalculatedLayout` value. This is great for responding to rotation events and view controller size changes: + +
+ + Swift + Objective-C + +
+
+- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
+{
+  [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
+  [coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext>  _Nonnull context) {
+    [self.node transitionLayoutWithSizeRange:ASSizeRangeMake(size, size) animated:YES];
+  } completion:nil];
+}
+
+ +
+
+ +## Examples that use the Layout Transition API + +- [ASDKLayoutTransition](https://github.com/facebook/AsyncDisplayKit/tree/master/examples/ASDKLayoutTransition) diff --git a/docs/_docs/layout2-api-sizing.md b/docs/_docs/layout2-api-sizing.md new file mode 100755 index 00000000..1a52caf4 --- /dev/null +++ b/docs/_docs/layout2-api-sizing.md @@ -0,0 +1,167 @@ +--- +title: Layout API Sizing +layout: docs +permalink: /docs/layout2-api-sizing.html +nextPage: layout-transition-api.html +--- + +The easiest way to understand the compound dimension types in the Layout API is to see all the units in relation to one another. + + + +## Values (`CGFloat`, `ASDimension`) +
+`ASDimension` is essentially a **normal CGFloat with support for representing either a point value, a relative percentage value, or an auto value**. + +This unit allows the same API to take in both fixed values, as well as relative ones. + +
+ + Swift + Objective-C + +
+
+// dimension returned is relative (%)
+ASDimensionMake(@"50%");  
+ASDimensionMakeWithFraction(0.5);
+
+// dimension returned in points
+ASDimensionMake(@"70pt")
+ASDimensionMake(70);      
+ASDimensionMakeWithPoints(70);
+
+ +
+
+ +### Example using `ASDimension` + +`ASDimension` is used to set the `flexBasis` property on a child of an `ASStackLayoutSpec`. The `flexBasis` property specifies an object's initial size in the stack dimension, where the stack dimension is whether it is a horizontal or vertical stack. + +In the following view, we want the left stack to occupy `40%` of the horizontal width and the right stack to occupy `60%` of the width. + + + +We do this by setting the `.flexBasis` property on the two childen of the horizontal stack: + +
+ + Swift + Objective-C + +
+
+self.leftStack.style.flexBasis = ASDimensionMake(@"40%");
+self.rightStack.style.flexBasis = ASDimensionMake(@"60%");
+
+[horizontalStack setChildren:@[self.leftStack, self.rightStack]];
+
+ +
+
+ +## Sizes (`CGSize`, `ASLayoutSize`) + +`ASLayoutSize` is similar to a `CGSize`, but its **width and height values may represent either a point or percent value**. The type of the width and height are independent; either one may be a point or percent value. + +
+ + Swift + Objective-C + +
+
+ASLayoutSizeMake(ASDimension width, ASDimension height);
+
+ +
+
+ +
+`ASLayoutSize` is used for setting a layout element's `.preferredLayoutSize`, `.minLayoutSize` and `.maxLayoutSize` properties. It allows the same API to take in both fixed sizes, as well as relative ones. + +
+ + Swift + Objective-C + +
+
+// Dimension type "Auto" indicates that the layout element may 
+// be resolved in whatever way makes most sense given the circumstances
+ASDimension width = ASDimensionMake(ASDimensionUnitAuto, 0);  
+ASDimension height = ASDimensionMake(@"50%");
+
+layoutElement.style.preferredLayoutSize = ASLayoutSizeMake(width, height);
+
+ +
+
+ +
+If you do not need relative values, you can set the layout element's `.preferredSize`, `.minSize` and `.maxSize` properties. The properties take regular `CGSize` values. + +
+ + Swift + Objective-C + +
+
+layoutElement.style.preferredSize = CGSizeMake(30, 160);
+
+ +
+
+ +
+Most of the time, you won't want to constrain both width and height. In these cases, you can individually set a layout element's size properties using `ASDimension` values. + +
+ + Swift + Objective-C + +
+
+layoutElement.style.width     = ASDimensionMake(@"50%");
+layoutElement.style.minWidth  = ASDimensionMake(@"50%");
+layoutElement.style.maxWidth  = ASDimensionMake(@"50%");
+
+layoutElement.style.height    = ASDimensionMake(@"50%");
+layoutElement.style.minHeight = ASDimensionMake(@"50%");
+layoutElement.style.maxHeight = ASDimensionMake(@"50%");
+
+ +
+
+ +## Size Range (`ASSizeRange`) + +`UIKit` doesn't provide a structure to bundle a minimum and maximum `CGSize`. So, `ASSizeRange` was created to support **a minimum and maximum CGSize pair**. + +`ASSizeRange` is used mostly in the internals of the layout API. However, the `constrainedSize` value passed as an input to `layoutSpecThatFits:` is an `ASSizeRange`. + +
+ + Swift + Objective-C + +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize;
+
+ +
+
+ +
+The `constrainedSize` passed to an `ASDisplayNode` subclass' `layoutSpecThatFits:` method is the minimum and maximum sizes that the node should fit in. The minimum and maximum `CGSize`s contained in `constrainedSize` can be used to size the node's layout elements. diff --git a/docs/_docs/layout2-conversion-guide.md b/docs/_docs/layout2-conversion-guide.md new file mode 100755 index 00000000..7d120645 --- /dev/null +++ b/docs/_docs/layout2-conversion-guide.md @@ -0,0 +1,507 @@ +--- +title: Upgrading to Layout 2.0 (Beta) +layout: docs +permalink: /docs/layout2-conversion-guide.html +--- + +A list of the changes: + +- Introduction of true flex factors +- `ASStackLayoutSpec` `.alignItems` property default changed to `ASStackLayoutAlignItemsStretch` +- Rename `ASStaticLayoutSpec` to `ASAbsoluteLayoutSpec` +- Rename `ASLayoutable` to `ASLayoutElement` +- Set `ASLayoutElement` properties via `style` property +- Easier way to size of an `ASLayoutElement` +- Deprecation of `-[ASDisplayNode preferredFrameSize]` +- Deprecation of `-[ASLayoutElement measureWithSizeRange:]` +- Deprecation of `-[ASDisplayNode measure:]` +- Removal of `-[ASAbsoluteLayoutElement sizeRange]` +- Rename `ASRelativeDimension` to `ASDimension` +- Introduction of `ASDimensionUnitAuto` + +In addition to the inline examples comparing **1.x** layout code vs **2.0** layout code, the [example projects](https://github.com/facebook/AsyncDisplayKit/tree/master/examples) and layout documentation have been updated to use the new API. + +All other **2.0** changes not related to the Layout API are documented here. + +## Introduction of true flex factors + +With **1.x** the `flexGrow` and `flexShrink` properties were of type `BOOL`. + +With **2.0**, these properties are now type `CGFloat` with default values of `0.0`. + +This behavior is consistent with the Flexbox implementation for web. See [`flexGrow`](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow) and [`flexShrink`](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink) for further information. + +
+SwiftObjective-C + +
+
+id<ASLayoutElement> layoutElement = ...;
+
+// 1.x:
+layoutElement.flexGrow = YES;
+layoutElement.flexShrink = YES;
+
+// 2.0:
+layoutElement.style.flexGrow = 1.0;
+layoutElement.style.flexShrink = 1.0;
+
+ + +
+
+ +## `ASStackLayoutSpec`'s `.alignItems` property default changed + +`ASStackLayoutSpec`'s `.alignItems` property default changed to `ASStackLayoutAlignItemsStretch` instead of `ASStackLayoutAlignItemsStart` to align with the CSS align-items property. + +## Rename `ASStaticLayoutSpec` to `ASAbsoluteLayoutSpec` & behavior change + +`ASStaticLayoutSpec` has been renamed to `ASAbsoluteLayoutSpec`, to be consistent with web terminology and better represent the intended behavior. + +
+SwiftObjective-C + +
+
+// 1.x:
+ASStaticLayoutSpec *layoutSpec = [ASStaticLayoutSpec staticLayoutSpecWithChildren:@[...]];
+
+// 2.0:
+ASAbsoluteLayoutSpec *layoutSpec = [ASAbsoluteLayoutSpec absoluteLayoutSpecWithChildren:@[...]];
+
+ +
+
+ +
+**Please note** that there has also been a behavior change introduced. The following text overlay layout was previously created using a `ASStaticLayoutSpec`, `ASInsetLayoutSpec` and `ASOverlayLayoutSpec` as seen in the code below. + + + +
+Using `INFINITY` for the `top` value in the `UIEdgeInsets` property of the `ASInsetLayoutSpec` allowed the text inset to start at the bottom. This was possible because it would adopt the size of the static layout spec's `_photoNode`. + +
+ + Swift + Objective-C + +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+  _photoNode.preferredFrameSize = CGSizeMake(USER_IMAGE_HEIGHT*2, USER_IMAGE_HEIGHT*2);
+  ASStaticLayoutSpec *backgroundImageStaticSpec = [ASStaticLayoutSpec staticLayoutSpecWithChildren:@[_photoNode]];
+
+  UIEdgeInsets insets = UIEdgeInsetsMake(INFINITY, 12, 12, 12);
+  ASInsetLayoutSpec *textInsetSpec = [ASInsetLayoutSpec insetLayoutSpecWithInsets:insets child:_titleNode];
+
+  ASOverlayLayoutSpec *textOverlaySpec = [ASOverlayLayoutSpec overlayLayoutSpecWithChild:backgroundImageStaticSpec
+                                                                                 overlay:textInsetSpec];
+  
+  return textOverlaySpec;
+}
+  
+ +
+
+ +
+With the new `ASAbsoluteLayoutSpec` and same code above, the layout would now look like the picture below. The text is still there, but at ~900 pts (offscreen). + + + +## Rename `ASLayoutable` to `ASLayoutElement` + +Remember that an `ASLayoutSpec` contains children that conform to the `ASLayoutElement` protocol. Both `ASDisplayNodes` and `ASLayoutSpecs` conform to this protocol. + +The protocol has remained the same as **1.x**, but the name has been changed to be more descriptive. + +## Set `ASLayoutElement` properties via `ASLayoutElementStyle` + +An `ASLayoutElement`'s properties are are now set via it's `ASLayoutElementStyle` object. + +
+SwiftObjective-C + +
+
+id<ASLayoutElement> *layoutElement = ...;
+
+// 1.x:
+layoutElement.spacingBefore = 1.0;
+
+// 2.0:
+layoutElement.style.spacingBefore = 1.0;
+
+ +
+
+ +However, the properties specific to an `ASLayoutSpec` are still set directly on the layout spec. + +
+SwiftObjective-C + +
+
+// 1.x and 2.0
+ASStackLayoutSpec *stackLayoutSpec = ...;
+stackLayoutSpec.direction = ASStackLayoutDirectionVertical;
+stackLayoutSpec.justifyContent = ASStackLayoutJustifyContentStart;
+
+ +
+
+ +## Setting the size of an `ASLayoutElement` + +With **2.0** we introduce a new, easier, way to set the size of an `ASLayoutElement`. These methods replace the deprecated `-preferredFrameSize` and `-sizeRange` **1.x** methods. + +The following **optional** properties are provided via the layout element's `style` property: + +- `-[ASLayoutElementStyle width]`: specifies the width of an ASLayoutElement. The `minWidth` and `maxWidth` properties will override `width`. The height will be set to Auto unless provided. + +- `-[ASLayoutElementStyle minWidth]`: specifies the minimum width of an ASLayoutElement. This prevents the used value of the `width` property from becoming smaller than the specified for `minWidth`. + +- `-[ASLayoutElementStyle maxWidth]`: specifies the maximum width of an ASLayoutElement. It prevents the used value of the `width` property from becoming larger than the specified for `maxWidth`. + +- `-[ASLayoutElementStyle height]`: specifies the height of an ASLayoutElement. The `minHeight` and `maxHeight` properties will override `height`. The width will be set to Auto unless provided. + +- `-[ASLayoutElementStyle minHeight]`: specifies the minimum height of an ASLayoutElement. It prevents the used value of the `height` property from becoming smaller than the specified for `minHeight`. + +- `-[ASLayoutElementStyle maxHeight]`: specifies the maximum height of an ASLayoutElement. It prevents the used value of the `height` property from becoming larger than the specified for `maxHeight`. + +To set both the width and height with a `CGSize` value: + +- `-[ASLayoutElementStyle preferredSize]`: Provides a suggested size for a layout element. If the optional minSize or maxSize are provided, and the preferredSize exceeds these, the minSize or maxSize will be enforced. If this optional value is not provided, the layout element’s size will default to it’s intrinsic content size provided calculateSizeThatFits: + +- `-[ASLayoutElementStyle minSize]`: An optional property that provides a minimum size bound for a layout element. If provided, this restriction will always be enforced. If a parent layout element’s minimum size is smaller than its child’s minimum size, the child’s minimum size will be enforced and its size will extend out of the layout spec’s. + +- `-[ASLayoutElementStyle maxSize]`: An optional property that provides a maximum size bound for a layout element. If provided, this restriction will always be enforced. If a child layout element’s maximum size is smaller than its parent, the child’s maximum size will be enforced and its size will extend out of the layout spec’s. + +To set both the width and height with a relative (%) value (an `ASRelativeSize`): + +- `-[ASLayoutElementStyle preferredRelativeSize]`: Provides a suggested RELATIVE size for a layout element. An ASRelativeSize uses percentages rather than points to specify layout. E.g. width should be 50% of the parent’s width. If the optional minRelativeSize or maxRelativeSize are provided, and the preferredRelativeSize exceeds these, the minRelativeSize or maxRelativeSize will be enforced. If this optional value is not provided, the layout element’s size will default to its intrinsic content size provided calculateSizeThatFits: + +- `-[ASLayoutElementStyle minRelativeSize]`: An optional property that provides a minimum RELATIVE size bound for a layout element. If provided, this restriction will always be enforced. If a parent layout element’s minimum relative size is smaller than its child’s minimum relative size, the child’s minimum relative size will be enforced and its size will extend out of the layout spec’s. + +- `-[ASLayoutElementStyle maxRelativeSize]`: An optional property that provides a maximum RELATIVE size bound for a layout element. If provided, this restriction will always be enforced. If a parent layout element’s maximum relative size is smaller than its child’s maximum relative size, the child’s maximum relative size will be enforced and its size will extend out of the layout spec’s. + +For example, if you want to set a `width` of an `ASDisplayNode`: + +
+SwiftObjective-C + +
+
+// 1.x:
+// no good way to set an intrinsic size
+
+// 2.0:
+ASDisplayNode *ASDisplayNode = ...;
+
+// width 100 points, height: auto
+displayNode.style.width = ASDimensionMakeWithPoints(100);
+
+// width 50%, height: auto
+displayNode.style.width = ASDimensionMakeWithFraction(0.5);
+
+ASLayoutSpec *layoutSpec = ...;
+
+// width 100 points, height 100 points
+layoutSpec.style.preferredSize = CGSizeMake(100, 100);
+
+ +
+
+ +If you previously wrapped an `ASLayoutElement` with an `ASStaticLayoutSpec` just to give it a specific size (without setting the `layoutPosition` property on the element too), you don't have to do that anymore. + +
+SwiftObjective-C + +
+
+ASStackLayoutSpec *stackLayoutSpec = ...;
+id<ASLayoutElement> *layoutElement = ...;
+
+// 1.x:
+layoutElement.sizeRange = ASRelativeSizeRangeMakeWithExactCGSize(CGSizeMake(50, 50));
+ASStaticLayoutSpec *staticLayoutSpec = [ASStaticLayoutSpec staticLayoutSpecWithChildren:@[layoutElement]];
+stackLayoutSpec.children = @[staticLayoutSpec];
+
+// 2.0:
+layoutElement.style.preferredSizeRange = ASRelativeSizeRangeMakeWithExactCGSize(CGSizeMake(50, 50));
+stackLayoutSpec.children = @[layoutElement];
+
+ +
+
+ +If you previously wrapped a `ASLayoutElement` within a `ASStaticLayoutSpec` just to return any layout spec from within `layoutSpecThatFits:` there is a new layout spec now that is called `ASWrapperLayoutSpec`. `ASWrapperLayoutSpec` is an `ASLayoutSpec` subclass that can wrap a `ASLayoutElement` and calculates the layout of the child based on the size given to the `ASLayoutElement`: + +
+SwiftObjective-C + +
+
+// 1.x - ASStaticLayoutSpec used as a "wrapper" to return subnode from layoutSpecThatFits: 
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+  return [ASStaticLayoutSpec staticLayoutSpecWithChildren:@[subnode]];
+}
+
+// 2.0
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+  return [ASWrapperLayoutSpec wrapperWithLayoutElement:subnode];
+}
+
+// 1.x - ASStaticLayoutSpec used to set size (but not position) of subnode
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+  ASDisplayNode *subnode = ...;
+  subnode.preferredSize = ...;
+  return [ASStaticLayoutSpec staticLayoutSpecWithChildren:@[subnode]];
+}
+
+// 2.0
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+  ASDisplayNode *subnode = ...;
+  subnode.style.preferredSize = CGSizeMake(constrainedSize.max.width, constrainedSize.max.height / 2.0);
+  return [ASWrapperLayoutSpec wrapperWithLayoutElement:subnode];
+}
+
+ +
+
+ +## Deprecation of `-[ASDisplayNode preferredFrameSize]` + +With the introduction of new sizing properties there is no need anymore for the `-[ASDisplayNode preferredFrameSize]` property. Therefore it is deprecated in **2.0**. Instead, use the size values on the `style` object of an `ASDisplayNode`: + +
+SwiftObjective-C + +
+
 
+ASDisplayNode *ASDisplayNode = ...;
+
+// 1.x:
+displayNode.preferredFrameSize = CGSize(100, 100);
+
+// 2.0
+displayNode.style.preferredSize = CGSize(100, 100);
+
+ +
+
+ +`-[ASDisplayNode preferredFrameSize]` was not supported properly and was often more confusing than helpful. The new sizing methods should be easier and more clear to implment. + +## Deprecation of `-[ASLayoutElement measureWithSizeRange:]` + +`-[ASLayoutElement measureWithSizeRange:]` is deprecated in **2.0**. + +#### Calling `measureWithSizeRange:` + +If you previously called `-[ASLayoutElement measureWithSizeRange:]` to receive an `ASLayout`, call `-[ASLayoutElement layoutThatFits:]` now instead. + +
+SwiftObjective-C + +
+
+// 1.x:
+ASLayout *layout = [layoutElement measureWithSizeRange:someSizeRange];
+
+// 2.0:
+ASLayout *layout = [layoutElement layoutThatFits:someSizeRange];
+
+ +
+
+ +#### Implementing `measureWithSizeRange:` + +If you are implementing a custom `class` that conforms to `ASLayoutElement` (e.g. creating a custom `ASLayoutSpec`) , replace `-measureWithSizeRange:` with `-calculateLayoutThatFits:` + +
+SwiftObjective-C + +
+
+// 1.x:
+- (ASLayout *)measureWithSizeRange:(ASSizeRange)constrainedSize {}
+
+// 2.0:
+- (ASLayout *)calculateLayoutThatFits:(ASSizeRange)constrainedSize {}
+
+ +
+
+ +`-calculateLayoutThatFits:` takes an `ASSizeRange` that specifies a min size and a max size of type `CGSize`. Choose any size in the given range, to calculate the children's size and position and return a `ASLayout` structure with the layout of child components. + +Besides `-calculateLayoutThatFits:` there are two additional methods on `ASLayoutElement` that you should know about if you are implementing classes that conform to `ASLayoutElement`: + +
+SwiftObjective-C + +
+
+- (ASLayout *)calculateLayoutThatFits:(ASSizeRange)constrainedSize
+                     restrictedToSize:(ASLayoutElementSize)size
+                 relativeToParentSize:(CGSize)parentSize;
+
+ +
+
+ +In certain advanced cases, you may want to override this method. Overriding this method allows you to receive the `layoutElement`'s size, parent size, and constrained size. With these values you could calculate the final constrained size and call `-calculateLayoutThatFits:` with the result. + +
+SwiftObjective-C + +
+
+- (ASLayout *)layoutThatFits:(ASSizeRange)constrainedSize
+                  parentSize:(CGSize)parentSize;
+
+ +
+
+ +Call this on children`layoutElements` to compute their layouts within your implementation of `-calculateLayoutThatFits:`. + +For sample implementations of layout specs and the usage of the `calculateLayoutThatFits:` family of methods, check out the layout specs in AsyncDisplayKit itself! + +## Deprecation of `-[ASDisplayNode measure:]` + +Use `-[ASDisplayNode layoutThatFits:]` instead to get an `ASLayout` and call `size` on the returned `ASLayout`: + +
+SwiftObjective-C + +
+
+// 1.x:
+CGSize size = [displayNode measure:CGSizeMake(100, 100)];
+
+// 2.0:
+ASLayout *layout = [displayNode layoutThatFits:ASSizeMake(CGSizeZero, CGSizeMake(100, 100))];
+CGSize size = layout.size;
+
+ +
+
+ +## Remove of `-[ASAbsoluteLayoutElement sizeRange]` + +The `sizeRange` property was removed from the `ASAbsoluteLayoutElement` protocol. Instead set the one of the following: + +- `-[ASLayoutElement width]` +- `-[ASLayoutElement height]` +- `-[ASLayoutElement minWidth]` +- `-[ASLayoutElement minHeight]` +- `-[ASLayoutElement maxWidth]` +- `-[ASLayoutElement maxHeight]` + +
+SwiftObjective-C + +
+
+id<ASLayoutElement> layoutElement = ...;
+
+// 1.x:
+layoutElement.sizeRange = ASRelativeSizeRangeMakeWithExactCGSize(CGSizeMake(50, 50));
+
+// 2.0:
+layoutElement.style.preferredSizeRange = ASRelativeSizeRangeMakeWithExactCGSize(CGSizeMake(50, 50));
+
+ +
+
+ +Due to the removal of `-[ASAbsoluteLayoutElement sizeRange]`, we also removed the `ASRelativeSizeRange`, as the type was no longer needed. + +## Rename `ASRelativeDimension` to `ASDimension` + +To simplify the naming and support the fact that dimensions are widely used in ASDK now, `ASRelativeDimension` was renamed to `ASDimension`. Having a shorter name and handy functions to create it was an important goal for us. + +`ASRelativeDimensionTypePercent` and associated functions were renamed to use `Fraction` to be consistent with Apple terminology. + +
+SwiftObjective-C + +
+
+// 2.0:
+// Handy functions to create ASDimensions
+ASDimension dimensionInPoints;
+dimensionInPoints = ASDimensionMake(ASDimensionTypePoints, 5.0)
+dimensionInPoints = ASDimensionMake(5.0)
+dimensionInPoints = ASDimensionMakeWithPoints(5.0)
+dimensionInPoints = ASDimensionMake("5.0pt");
+
+ASDimension dimensionInFractions;
+dimensionInFractions = ASDimensionMake(ASDimensionTypeFraction, 0.5)
+dimensionInFractions = ASDimensionMakeWithFraction(0.5)
+dimensionInFractions = ASDimensionMake("50%");
+
+ +
+
+ +## Introduction of `ASDimensionUnitAuto` + +Previously `ASDimensionUnitPoints` and `ASDimensionUnitFraction` were the only two `ASDimensionUnit` enum values available. A new dimension type called `ASDimensionUnitAuto` now exists. All of the ``ASLayoutElementStyle` sizing properties are set to `ASDimensionAuto` by default. + +`ASDimensionUnitAuto` means more or less: *"I have no opinion" and may be resolved in whatever way makes most sense given the circumstances.* + +Most of the time this is the intrinsic content size of the `ASLayoutElement`. + +For example, if an `ASImageNode` has a `width` set to `ASDimensionUnitAuto`, the width of the linked image file will be used. For an `ASTextNode` the intrinsic content size will be calculated based on the text content. If an `ASLayoutElement` cannot provide any intrinsic content size like `ASVideoNode` for example the size needs to set explicitly. + +
+SwiftObjective-C + +
+
+// 2.0:
+// No specific size needs to be set as the imageNode's size 
+// will be calculated from the content (the image in this case)
+ASImageNode *imageNode = [ASImageNode new];
+imageNode.image = ...;
+
+// Specific size must be set for ASLayoutElement objects that
+// do not have an intrinsic content size (ASVideoNode does not
+// have a size until it's video downloads)
+ASVideoNode *videoNode = [ASVideoNode new];
+videoNode.style.preferredSize = CGSizeMake(200, 100);
+
+ +
+
+ diff --git a/docs/_docs/layout2-layout-element-properties.md b/docs/_docs/layout2-layout-element-properties.md new file mode 100755 index 00000000..2efb71be --- /dev/null +++ b/docs/_docs/layout2-layout-element-properties.md @@ -0,0 +1,146 @@ +--- +title: Layout Element Properties +layout: docs +permalink: /docs/layout2-layout-element-properties.html +prevPage: layout2-layoutspec-types.html +nextPage: layout2-api-sizing.html +--- + +- ASStackLayoutElement Properties - will only take effect on a node or layout spec that is the child of a stack spec +- ASAbsoluteLayoutElement Properties - will only take effect on a node or layout spec that is the child of a absolute spec +- ASLayoutElement Properties - applies to all nodes & layout specs + +## ASStackLayoutElement Properties + +
+Please note that the following properties will only take effect if set on the child of an STACK layout spec. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyDescription
`CGFloat .style.spacingBefore`Additional space to place before this object in the stacking direction.
`CGFloat .style.spacingAfter`Additional space to place after this object in the stacking direction.
`BOOL .style.flexGrow`If the sum of childrens' stack dimensions is less than the minimum size, should this object grow?
`BOOL .style.flexShrink`If the sum of childrens' stack dimensions is greater than the maximum size, should this object shrink?
`ASDimension .style.flexBasis`Specifies the initial size for this object, in the stack dimension (horizontal or vertical), before the `flexGrow` / `flexShrink` properties are applied and the remaining space is distributed.
`ASStackLayoutAlignSelf .style.alignSelf`Orientation of the object along cross axis, overriding alignItems. Options include: +
    +
  • `ASStackLayoutAlignSelfAuto`
  • +
  • `ASStackLayoutAlignSelfStart`
  • +
  • `ASStackLayoutAlignSelfEnd`
  • +
  • `ASStackLayoutAlignSelfCenter`
  • +
  • `ASStackLayoutAlignSelfStretch`
  • +
`CGFloat .style.ascender`Used for baseline alignment. The distance from the top of the object to its baseline.
`CGFloat .style.descender`Used for baseline alignment. The distance from the baseline of the object to its bottom.
+ + +## ASAbsoluteLayoutElement Properties + +
+Please note that the following properties will only take effect if set on the child of an ABSOLUTE layout spec. +
+ + + + + + + + + + +
PropertyDescription
`CGPoint .style.layoutPosition`The `CGPoint` position of this object within its `ASAbsoluteLayoutSpec` parent spec.
+ +## ASLayoutElement Properties + +
+Please note that the following properties apply to ALL layout elements. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyDescription
`ASDimension .style.width`The `width` property specifies the width of the content area of an `ASLayoutElement`. The `minWidth` and `maxWidth` properties override `width`. Defaults to `ASDimensionAuto`.
`ASDimension .style.height`The `height` property specifies the height of the content area of an `ASLayoutElement`. The `minHeight` and `maxHeight` properties override `height`. Defaults to `ASDimensionAuto`.
`ASDimension .style.minWidth`The `minWidth` property is used to set the minimum width of a given element. It prevents the used value of the `width` property from becoming smaller than the value specified for `minWidth`. The value of `minWidth` overrides both `maxWidth` and `width`. Defaults to `ASDimensionAuto`.
`ASDimension .style.maxWidth`The `maxWidth` property is used to set the maximum width of a given element. It prevents the used value of the `width` property from becoming larger than the value specified for `maxWidth`. The value of `maxWidth` overrides `width`, but `minWidth` overrides `maxWidth`. Defaults to `ASDimensionAuto`.
`ASDimension .style.minHeight`The `minHeight` property is used to set the minimum height of a given element. It prevents the used value of the `height` property from becoming smaller than the value specified for `minHeight`. The value of `minHeight` overrides both `maxHeight` and `height`. Defaults to `ASDimensionAuto`.
`ASDimension .style.maxHeight`The `maxHeight` property is used to set the maximum height of a given element. It prevents the used value of the `height` property from becoming larger than the value specified for `maxHeight`. The value of `maxHeight` overrides `height`, but `minHeight` overrides `maxHeight`. Defaults to `ASDimensionAuto`
`CGSize .style.preferredSize`

Provides a suggested size for a layout element. If the optional minSize or maxSize are provided, and the preferredSize exceeds these, the minSize or maxSize will be enforced. If this optional value is not provided, the layout element’s size will default to it’s intrinsic content size provided calculateSizeThatFits:

+

This method is optional, but one of either preferredSize or preferredLayoutSize is required for nodes that either have no intrinsic content size or should be laid out at a different size than its intrinsic content size. For example, this property could be set on an ASImageNode to display at a size different from the underlying image size.

+

Warning: calling the getter when the size's width or height are relative will cause an assert.

`CGSize .style.minSize`

An optional property that provides a minimum size bound for a layout element. If provided, this restriction will always be enforced. If a parent layout element’s minimum size is smaller than its child’s minimum size, the child’s minimum size will be enforced and its size will extend out of the layout spec’s.

+

For example, if you set a preferred relative width of 50% and a minimum width of 200 points on an element in a full screen container, this would result in a width of 160 points on an iPhone screen. However, since 160 pts is lower than the minimum width of 200 pts, the minimum width would be used.

`CGSize .style.maxSize`

An optional property that provides a maximum size bound for a layout element. If provided, this restriction will always be enforced. If a child layout element’s maximum size is smaller than its parent, the child’s maximum size will be enforced and its size will extend out of the layout spec’s.

+

For example, if you set a preferred relative width of 50% and a maximum width of 120 points on an element in a full screen container, this would result in a width of 160 points on an iPhone screen. However, since 160 pts is higher than the maximum width of 120 pts, the maximum width would be used.

`ASLayoutSize .style.preferredLayoutSize`Provides a suggested RELATIVE size for a layout element. An ASLayoutSize uses percentages rather than points to specify layout. E.g. width should be 50% of the parent’s width. If the optional minLayoutSize or maxLayoutSize are provided, and the preferredLayoutSize exceeds these, the minLayoutSize or maxLayoutSize will be enforced. If this optional value is not provided, the layout element’s size will default to its intrinsic content size provided `calculateSizeThatFits:`
`ASLayoutSize .style.minLayoutSize`An optional property that provides a minimum RELATIVE size bound for a layout element. If provided, this restriction will always be enforced. If a parent layout element’s minimum relative size is smaller than its child’s minimum relative size, the child’s minimum relative size will be enforced and its size will extend out of the layout spec’s.
`ASLayoutSize .style.maxLayoutSize`An optional property that provides a maximum RELATIVE size bound for a layout element. If provided, this restriction will always be enforced. If a parent layout element’s maximum relative size is smaller than its child’s maximum relative size, the child’s maximum relative size will be enforced and its size will extend out of the layout spec’s.
diff --git a/docs/_docs/layout2-layoutSpecThatFits.md b/docs/_docs/layout2-layoutSpecThatFits.md new file mode 100755 index 00000000..cd3e3097 --- /dev/null +++ b/docs/_docs/layout2-layoutSpecThatFits.md @@ -0,0 +1,120 @@ +--- +title: Composing Layout Specs +layout: docs +permalink: /docs/layout2-layoutSpecThatFits.html +--- + +The composing of layout specs and layoutables are happening within the `layoutSpecThatFits:` method. This is where you will put the majority of your layout code. It defines the layout and does the heavy calculation on a background thread. + +Every `ASDisplayNode` that would like to layout it's subnodes should should do this by implementing the `layoutSpecThatFits:` method. This method is where you build out a layout spec object that will produce the size of the node, as well as the size and position of all subnodes. + +The following `layoutSpecThatFits:` implementation is from the Kittens example and will implement an easy stack layout with an image with a constrained size on the left and a text to the right. The great thing is, by using a `ASStackLayoutSpec` the height is dynamically calculated based on the image height and the height of the text. + +
+ + Swift + Objective-C + + +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+  // Set an intrinsic size for the image node
+  CGSize imageSize = _isImageEnlarged ? CGSizeMake(2.0 * kImageSize, 2.0 * kImageSize)
+                                      : CGSizeMake(kImageSize, kImageSize);
+  [_imageNode setSizeFromCGSize:imageSize];
+
+  // Shrink the text node in case the image + text gonna be too wide
+  _textNode.flexShrink = YES;
+
+  // Configure stack
+  ASStackLayoutSpec *stackLayoutSpec =
+  [ASStackLayoutSpec
+   stackLayoutSpecWithDirection:ASStackLayoutDirectionHorizontal
+   spacing:kInnerPadding
+   justifyContent:ASStackLayoutJustifyContentStart
+   alignItems:ASStackLayoutAlignItemsStart
+   children:_swappedTextAndImage ? @[_textNode, _imageNode] : @[_imageNode, _textNode]];
+
+  // Add inset
+  return [ASInsetLayoutSpec
+          insetLayoutSpecWithInsets:UIEdgeInsetsMake(kOuterPadding, kOuterPadding, kOuterPadding, kOuterPadding)
+          child:stackLayoutSpec];
+}
+  
+ + +
+
+ + +The result looks like the following: +![Kittens Node](https://d3vv6lp55qjaqc.cloudfront.net/items/2l133Y2B3r1F231a310q/Screen%20Shot%202016-08-23%20at%202.29.12%20PM.png) + +Let's look at some more advanced composition of layout spec and layoutable implementation from the `ASDKGram` example that should give you a feel how layout specs and layoutables can be combined to compose a difficult layout. You can also find this code in the `examples/ASDKGram` folder. + +
+ + Swift + Objective-C + + +
+
+  
+ + +
+
+ +After the layout pass happened the result will look like the following: +![ASDKGram](https://d3vv6lp55qjaqc.cloudfront.net/items/1l0t352p441K3k0C3y1l/layout-example-2.png) + +The layout spec object that you create in `layoutSpecThatFits:` is mutable up until the point that it is return in this method. After this point, it will be immutable. It's important to remember not to cache layout specs for use later but instead to recreate them when necessary. + +Note: Because it is run on a background thread, you should not set any node.view or node.layer properties here. Also, unless you know what you are doing, do not create any nodes in this method. Additionally, it is not necessary to begin this method with a call to super, unlike other method overrides. \ No newline at end of file diff --git a/docs/_docs/layout2-layoutspec-types-examples.md b/docs/_docs/layout2-layoutspec-types-examples.md new file mode 100755 index 00000000..6b851879 --- /dev/null +++ b/docs/_docs/layout2-layoutspec-types-examples.md @@ -0,0 +1,26 @@ +--- +title: Layout Spec Composition Examples +layout: docs +permalink: /docs/layout2-layoutspec-types-examples.html +--- + +## Text Overlaid on an Image + + +
+SwiftObjective-C + +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+  ...
+  UIEdgeInsets *insets = UIEdgeInsetsMake(0, HORIZONTAL_BUFFER, 0, HORIZONTAL_BUFFER);
+  ASInsetLayoutSpec *headerWithInset = [ASInsetLayoutSpec alloc] initWithInsets:insets child:textNode];
+  ...
+}
+
+ +
+
\ No newline at end of file diff --git a/docs/_docs/layout2-layoutspec-types.md b/docs/_docs/layout2-layoutspec-types.md new file mode 100755 index 00000000..3e3281c1 --- /dev/null +++ b/docs/_docs/layout2-layoutspec-types.md @@ -0,0 +1,473 @@ +--- +title: Layout Specs +layout: docs +permalink: /docs/layout2-layoutspec-types.html +prevPage: automatic-layout-examples-2.html +nextPage: layout2-layout-element-properties.html +--- + +The following `ASLayoutSpec` subclasses can be used to compose simple or very complex layouts. + + + +You may also subclass `ASLayoutSpec` in order to make your own, custom layout specs. + +## ASWrapperLayoutSpec + +`ASWrapperLayoutSpec` is a simple `ASLayoutSpec` subclass that can wrap a `ASLayoutElement` and calculate the layout of the child based on the size set on the layout element. + +`ASWrapperLayoutSpec` is ideal for easily returning a single subnode from `-layoutSpecThatFits:`. Optionally, this subnode can have sizing information set on it. However, if you need to set a position in addition to a size, use `ASAbsoluteLayoutSpec` instead. + +
+ + Swift + Objective-C + + +
+
+// return a single subnode from layoutSpecThatFits: 
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+  return [ASWrapperLayoutSpec wrapperWithLayoutElement:_subnode];
+}
+
+// set a size (but not position)
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+  _subnode.style.preferredSize = CGSizeMake(constrainedSize.max.width,
+                                            constrainedSize.max.height / 2.0);
+  return [ASWrapperLayoutSpec wrapperWithLayoutElement:subnode];
+}
+
+ + +
+
+ +## ASStackLayoutSpec (Flexbox Container) +Of all the layoutSpecs in ASDK, `ASStackLayoutSpec` is the most useful and powerful. `ASStackLayoutSpec` uses the flexbox algorithm to determine the position and size of its children. Flexbox is designed to provide a consistent layout on different screen sizes. In a stack layout you align items in either a vertical or horizontal stack. A stack layout can be a child of another stack layout, which makes it possible to create almost any layout using a stack layout spec. + +`ASStackLayoutSpec` has 7 properties in addition to its `` properties: + +- `direction`. Specifies the direction children are stacked in. If horizontalAlignment and verticalAlignment were set, +they will be resolved again, causing justifyContent and alignItems to be updated accordingly. +- `spacing`. The amount of space between each child. +- `horizontalAlignment`. Specifies how children are aligned horizontally. Depends on the stack direction, setting the alignment causes either + justifyContent or alignItems to be updated. The alignment will remain valid after future direction changes. + Thus, it is preferred to those properties. +- `verticalAlignment`. Specifies how children are aligned vertically. Depends on the stack direction, setting the alignment causes either + justifyContent or alignItems to be updated. The alignment will remain valid after future direction changes. + Thus, it is preferred to those properties. +- `justifyContent`. The amount of space between each child. +- `alignItems`. Orientation of children along cross axis. +- `baselineRelativeArrangement`. If `YES` the vertical spacing between two views is measured from the last baseline of the top view to the top of the bottom view. + +
+ + Swift + Objective-C + + +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+  ASStackLayoutSpec *mainStack = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionHorizontal
+                       spacing:6.0
+                justifyContent:ASStackLayoutJustifyContentStart
+                    alignItems:ASStackLayoutAlignItemsCenter
+                      children:@[_iconNode, _countNode]];
+
+  // Set some constrained size to the stack
+  mainStack.style.minWidth = ASDimensionMakeWithPoints(60.0);
+  mainStack.style.maxHeight = ASDimensionMakeWithPoints(40.0);
+
+  return mainStack;
+}
+
+ + +
+
+ +Flexbox works the same way in AsyncDisplayKit as it does in CSS on the web, with a few exceptions. The defaults are different, there is no `flex` parameter and `flexGrow` and `flexShrink` only supports a boolean value. + +
+ +## ASInsetLayoutSpec +During the layout pass, the `ASInsetLayoutSpec` passes its `constrainedSize.max` `CGSize` to its child, after subtracting its insets. Once the child determines it's final size, the inset spec passes its final size up as the size of its child plus its inset margin. Since the inset layout spec is sized based on the size of it's child, the child **must** have an instrinsic size or explicitly set its size. + + + +If you set `INFINITY` as a value in the `UIEdgeInsets`, the inset spec will just use the intrinisic size of the child. See an example of this. + +
+ + Swift + Objective-C + + +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+  ...
+  UIEdgeInsets *insets = UIEdgeInsetsMake(10, 10, 10, 10);
+  ASInsetLayoutSpec *headerWithInset = insetLayoutSpecWithInsets:insets child:textNode];
+  ...
+}
+
+ + +
+
+ +## ASOverlayLayoutSpec +`ASOverlayLayoutSpec` lays out its child (blue), stretching another component on top of it as an overlay (red). + + + +The overlay spec's size is calculated from the child's size. In the diagram below, the child is the blue layer. The child's size is then passed as the `constrainedSize` to the overlay layout element (red layer). Thus, it is important that the child (blue layer) **must** have an intrinsic size or a size set on it. + +
+When using Automatic Subnode Management with the ASOverlayLayoutSpec, the nodes may sometimes appear in the wrong order. This is a known issue that will be fixed soon. The current workaround is to add the nodes manually, with the overlay layout element (red) must added as a subnode to the parent node after the child layout element (blue). +
+ +
+ + Swift + Objective-C + + +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+  ASDisplayNode *backgroundNode = ASDisplayNodeWithBackgroundColor([UIColor blueColor]);
+  ASDisplayNode *foregroundNode = ASDisplayNodeWithBackgroundColor([UIColor redColor]);
+  return [ASOverlayLayoutSpec overlayLayoutSpecWithChild:backgroundNode overlay:foregroundNode];
+}
+
+ + +
+
+ +## ASBackgroundLayoutSpec +`ASBackgroundLayoutSpec` lays out a component (blue), stretching another component behind it as a backdrop (red). + + + +The background spec's size is calculated from the child's size. In the diagram below, the child is the blue layer. The child's size is then passed as the `constrainedSize` to the background layout element (red layer). Thus, it is important that the child (blue layer) **must** have an intrinsic size or a size set on it. + +
+When using Automatic Subnode Management with the ASOverlayLayoutSpec, the nodes may sometimes appear in the wrong order. This is a known issue that will be fixed soon. The current workaround is to add the nodes manually, with the child layout element (blue) must added as a subnode to the parent node after the child background element (red). +
+ +
+ + Swift + Objective-C + + +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+  ASDisplayNode *backgroundNode = ASDisplayNodeWithBackgroundColor([UIColor redColor]);
+  ASDisplayNode *foregroundNode = ASDisplayNodeWithBackgroundColor([UIColor blueColor]);
+
+  return [ASBackgroundLayoutSpec backgroundLayoutSpecWithChild:foregroundNode background:backgroundNode];
+}
+
+ + +
+
+ +Note: The order in which subnodes are added matters for this layout spec; the background object must be added as a subnode to the parent node before the foreground object. Using ASM does not currently guarantee this order! + +## ASCenterLayoutSpec +`ASCenterLayoutSpec` centers its child within its max `constrainedSize`. + + + +If the center spec's width or height is unconstrained, it shrinks to the size of the child. + +`ASCenterLayoutSpec` has two properties: + +- `centeringOptions`. Determines how the child is centered within the center spec. Options include: None, X, Y, XY. +- `sizingOptions`. Determines how much space the center spec will take up. Options include: Default, minimum X, minimum Y, minimum XY. + +
+ + Swift + Objective-C + + +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+  ASStaticSizeDisplayNode *subnode = ASDisplayNodeWithBackgroundColor([UIColor greenColor], CGSizeMake(70, 100));
+  return [ASCenterLayoutSpec centerLayoutSpecWithCenteringOptions:ASCenterLayoutSpecCenteringXY
+                                                    sizingOptions:ASRelativeLayoutSpecSizingOptionDefault
+                                                            child:subnode]
+}
+
+ + +
+
+ +## ASRatioLayoutSpec +`ASRatioLayoutSpec` lays out a component at a fixed aspect ratio which can scale. This spec **must** have a width or a height passed to it as a constrainedSize as it uses this value to scale itself. + + + +It is very common to use a ratio spec to provide an intrinsic size for `ASNetworkImageNode` or `ASVideoNode`, as both do not have an intrinsic size until the content returns from the server. + +
+ + Swift + Objective-C + + +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+  // Half Ratio
+  ASStaticSizeDisplayNode *subnode = ASDisplayNodeWithBackgroundColor([UIColor greenColor], CGSizeMake(100, 100));
+  return [ASRatioLayoutSpec ratioLayoutSpecWithRatio:0.5 child:subnode];
+}
+
+ + +
+
+ +## ASRelativeLayoutSpec +Lays out a component and positions it within the layout bounds according to vertical and horizontal positional specifiers. Similar to the “9-part” image areas, a child can be positioned at any of the 4 corners, or the middle of any of the 4 edges, as well as the center. + +This is a very powerful class, but too complex to cover in this overview. For more information, look into `ASRelativeLayoutSpec`'s `-calculateLayoutThatFits:` method + properties. + +
+ + Swift + Objective-C + + +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+  ...
+  ASDisplayNode *backgroundNode = ASDisplayNodeWithBackgroundColor([UIColor redColor]);
+  ASStaticSizeDisplayNode *foregroundNode = ASDisplayNodeWithBackgroundColor([UIColor greenColor], CGSizeMake(70, 100));
+
+  ASRelativeLayoutSpec *relativeSpec = [ASRelativeLayoutSpec relativePositionLayoutSpecWithHorizontalPosition:ASRelativeLayoutSpecPositionStart
+                                  verticalPosition:ASRelativeLayoutSpecPositionStart
+                                      sizingOption:ASRelativeLayoutSpecSizingOptionDefault
+                                             child:foregroundNode]
+
+  ASBackgroundLayoutSpec *backgroundSpec = [ASBackgroundLayoutSpec backgroundLayoutSpecWithChild:relativeSpec background:backgroundNode];
+  ...
+}
+
+ + +
+
+ +## ASAbsoluteLayoutSpec +Within `ASAbsoluteLayoutSpec` you can specify exact locations (x/y coordinates) of its children by setting their `layoutPosition` property. Absolute layouts are less flexible and harder to maintain than other types of layouts. + +`ASAbsoluteLayoutSpec` has one property: + +- `sizing`. Determines how much space the absolute spec will take up. Options include: Default, and Size to Fit. *Note* that the Size to Fit option will replicate the behavior of the old `ASStaticLayoutSpec`. + +
+ + Swift + Objective-C + + +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+  CGSize maxConstrainedSize = constrainedSize.max;
+
+  // Layout all nodes absolute in a static layout spec
+  guitarVideoNode.layoutPosition = CGPointMake(0, 0);
+  guitarVideoNode.size = ASSizeMakeFromCGSize(CGSizeMake(maxConstrainedSize.width, maxConstrainedSize.height / 3.0));
+
+  nicCageVideoNode.layoutPosition = CGPointMake(maxConstrainedSize.width / 2.0, maxConstrainedSize.height / 3.0);
+  nicCageVideoNode.size = ASSizeMakeFromCGSize(CGSizeMake(maxConstrainedSize.width / 2.0, maxConstrainedSize.height / 3.0));
+
+  simonVideoNode.layoutPosition = CGPointMake(0.0, maxConstrainedSize.height - (maxConstrainedSize.height / 3.0));
+  simonVideoNode.size = ASSizeMakeFromCGSize(CGSizeMake(maxConstrainedSize.width/2, maxConstrainedSize.height / 3.0));
+
+  hlsVideoNode.layoutPosition = CGPointMake(0.0, maxConstrainedSize.height / 3.0);
+  hlsVideoNode.size = ASSizeMakeFromCGSize(CGSizeMake(maxConstrainedSize.width / 2.0, maxConstrainedSize.height / 3.0));
+
+  return [ASAbsoluteLayoutSpec absoluteLayoutSpecWithChildren:@[guitarVideoNode, nicCageVideoNode, simonVideoNode, hlsVideoNode]];
+}
+
+ + +
+
+ +## ASLayoutSpec +`ASLayoutSpec` is the main class from that all layout spec's are subclassed. It's main job is to handle all the children management, but it also can be used to create custom layout specs. Only the super advanced should want / need to create a custom subclasses of `ASLayoutSpec` though. Instead try to use provided layout specs and compose them together to create more advanced layouts. + +Another use of `ASLayoutSpec` is to be used as a spacer in a `ASStackLayoutSpec` with other children, when `.flexGrow` and/or `.flexShrink` is applied. + +
+ + Swift + Objective-C + + +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+{
+  ...
+  // ASLayoutSpec as spacer
+  ASLayoutSpec *spacer = [[ASLayoutSpec alloc] init];
+  spacer.flexGrow = true;
+
+  stack.children = @[imageNode, spacer, textNode];
+  ...
+}
+
+ + +
+
diff --git a/docs/_docs/layout2-manual-layout.md b/docs/_docs/layout2-manual-layout.md new file mode 100755 index 00000000..2d4a16ce --- /dev/null +++ b/docs/_docs/layout2-manual-layout.md @@ -0,0 +1,174 @@ +--- +title: Manual Layout +layout: docs +permalink: /docs/layout2-manual-layout.html +--- + +## Manual Layout +After diving in to the automatic way for layout in ASDK there is still the _old_ way to layout manually available. For the sake of completness here is a short description how to accomplish that within ASDK. + +### Manual Layout UIKit + +Sizing and layout of custom view hierarchies are typically done all at once on the main thread. For example, a custom UIView that minimally encloses a text view and an image view might look like this: + +
+ + Swift + Objective-C + + +
+
+- (CGSize)sizeThatFits:(CGSize)size
+{
+  // size the image
+  CGSize imageSize = [_imageView sizeThatFits:size];
+
+  // size the text view
+  CGSize maxTextSize = CGSizeMake(size.width - imageSize.width, size.height);
+  CGSize textSize = [_textView sizeThatFits:maxTextSize];
+
+  // make sure everything fits
+  CGFloat minHeight = MAX(imageSize.height, textSize.height);
+  return CGSizeMake(size.width, minHeight);
+}
+
+- (void)layoutSubviews
+{
+  CGSize size = self.bounds.size; // convenience
+
+  // size and layout the image
+  CGSize imageSize = [_imageView sizeThatFits:size];
+  _imageView.frame = CGRectMake(size.width - imageSize.width, 0.0f,
+                                imageSize.width, imageSize.height);
+
+  // size and layout the text view
+  CGSize maxTextSize = CGSizeMake(size.width - imageSize.width, size.height);
+  CGSize textSize = [_textView sizeThatFits:maxTextSize];
+  _textView.frame = (CGRect){ CGPointZero, textSize };
+}
+  
+ + +
+
+ +This isn't ideal. We're sizing our subviews twice — once to figure out how big our view needs to be and once when laying it out — and while our layout arithmetic is cheap and quick, we're also blocking the main thread on expensive text sizing. + +We could improve the situation by manually cacheing our subviews' sizes, but that solution comes with its own set of problems. Just adding `_imageSize` and `_textSize` ivars wouldn't be enough: for example, if the text were to change, we'd need to recompute its size. The boilerplate would quickly become untenable. + +Further, even with a cache, we'll still be blocking the main thread on sizing *sometimes*. We could try to shift sizing to a background thread with `dispatch_async()`, but even if our own code is thread-safe, UIView methods are documented to [only work on the main thread](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIView_Class/index.html): + +> Manipulations to your application’s user interface must occur on the main +> thread. Thus, you should always call the methods of the UIView class from +> code running in the main thread of your application. The only time this may +> not be strictly necessary is when creating the view object itself but all +> other manipulations should occur on the main thread. + +This is a pretty deep rabbit hole. We could attempt to work around the fact that UILabels and UITextViews cannot safely be sized on background threads by manually creating a TextKit stack and sizing the text ourselves... but that's a laborious duplication of work. Further, if UITextView's layout behaviour changes in an iOS update, our sizing code will break. (And did we mention that TextKit isn't thread-safe either?) + +### Manual Layout ASDK + +Manual layout within ASDK are realized within two methods: + +#### `calculateSizeThatFits` and `layout` + +Within `calculateSizeThatFits:` you should provide a intrinsic content size for the node based on the given `constrainedSize`. This method is called on a background thread so perform expensive sizing operations within it. + +
+ + Swift + Objective-C + + +
+
+- [ASDisplayNode calculateSizeThatFits:]
+  
+ + +
+
+ +After measurement and layout pass happens further layout can be done in `layout`. This method is called on the main thread. In there, layout operations can be done for nodes that are not playing within the automatic layout system and are referenced within `layoutSpecThatFits:`. + +
+ + Swift + Objective-C + + +
+
+- [ASDisplayNode layout]
+  
+ + +
+
+ +#### Example +Our custom node looks like this: + +
+ + Swift + Objective-C + + +
+
+#import 
+
+...
+
+// perform expensive sizing operations on a background thread
+- (CGSize)calculateSizeThatFits:(CGSize)constrainedSize
+{
+  // size the image
+  CGSize imageSize = [_imageNode layoutThatFits:ASSizeRangeMake(CGSizeZero, constrainedSize)].size;
+
+  // size the text node
+  CGSize maxTextSize = CGSizeMake(constrainedSize.width - imageSize.width,
+                                  constrainedSize.height);
+
+  CGSize textSize = [_textNode layoutThatFits:ASSizeRangeMake(CGSizeZero, maxTextSize)].size;
+
+  // make sure everything fits
+  CGFloat minHeight = MAX(imageSize.height, textSize.height);
+  return CGSizeMake(constrainedSize.width, minHeight);
+}
+
+// do as little work as possible in main-thread layout
+- (void)layout
+{
+  // layout the image using its cached size
+  CGSize imageSize = _imageNode.calculatedSize;
+  _imageNode.frame = CGRectMake(self.bounds.size.width - imageSize.width, 0.0f,
+                                imageSize.width, imageSize.height);
+
+  // layout the text view using its cached size
+  CGSize textSize = _textNode.calculatedSize;
+  _textNode.frame = (CGRect){ CGPointZero, textSize };
+}
+  
+ + +
+
+ +`ASImageNode` and `ASTextNode`, like the rest of AsyncDisplayKit, are thread-safe, so we can size them on background threads. The `-layoutThatFits:` method is like `-sizeThatFits:`, but with side effects: it caches the (`calculatedSize`) for quick access later on — like in our now-snappy `-layout` implementation. + +As you can see, node hierarchies are sized and laid out in much the same way as their view counterparts. Manually layed out nodes do need to be written with a few things in mind: + +* Nodes must recursively measure all of their subnodes in their `-calculateSizeThatFits:` implementations. Note that the `-layoutThatFits:` machinery will only call `-calculateSizeThatFits:` if a new measurement pass is needed (e.g., if the constrained size has changed) and `layoutSpecThatFits:` is *not* implemented. + +* Nodes should perform any other expensive pre-layout calculations in `-calculateSizeThatFits:`, caching useful intermediate results in ivars as appropriate. + +* Nodes should call `[self invalidateCalculatedSize]` when necessary. For example, `ASTextNode` invalidates its calculated size when its `attributedString` property is changed. + +As already mentioned, automatic layout is preferred over manual layout and should be the way to go in most cases. \ No newline at end of file diff --git a/docs/_docs/layout2-quickstart.md b/docs/_docs/layout2-quickstart.md new file mode 100755 index 00000000..11f6a1f1 --- /dev/null +++ b/docs/_docs/layout2-quickstart.md @@ -0,0 +1,100 @@ +--- +title: Quickstart +layout: docs +permalink: /docs/layout2-quickstart.html +prevPage: multiplex-image-node.html +nextPage: automatic-layout-examples-2.html +--- + +## Motivation & Benefits + +The Layout API was created as a performant alternative to UIKit's Auto Layout, which becomes exponentially expensive for complicated view hierarchies. AsyncDisplayKit's Layout API has many benefits over using UIKit's Auto Layout: + +- **Fast**: As fast as manual layout code and significantly faster than Auto Layout +- **Asynchronous & Concurrent:** Layouts can be computed on background threads so user interactions are not interrupted. +- **Declarative**: Layouts are declared with immutable data structures. This makes layout code easier to develop, document, code review, test, debug, profile, and maintain. +- **Cacheable**: Layout results are immutable data structures so they can be precomputed in the background and cached to increase user perceived performance. +- **Extensible**: Easy to share code between classes. + +## Inspired by CSS Flexbox + +Those who are familiar with Flexbox will notice many similarities in the two systems. However, AsyncDisplayKit's Layout API does not re-implement all of CSS. + +## Basic Concepts + +AsyncDisplayKit's layout system is centered around two basic concepts: + +1. Layout Specs +2. Layout Elements + + +### Layout Specs + +A layout spec, short for "layout specification", has no physical presence. Instead, layout specs act as containers for other layout elements by understanding how these children layout elments relate to each other. + +AsyncDisplayKit provides several subclasses of `ASLayoutSpec`, from a simple layout specification that insets a single child, to a more complex layout specification that arranges multiple children in varying stack configurations. + +### Layout Elements + +Layout specs contain and arrange layout elements. + +All `ASDisplayNode`s and `ASLayoutSpec`s conform to the `` protocol. This means that you can compose layout specs from both nodes and other layout specs. Cool! + +The `ASLayoutElement` protocol has several properties that can be used to create very complex layouts. In addition, layout specs have their own set of properties that can be used to adjust the arrangment of the layout elements. + +### Combine Layout Specs & Layout Elements to Make Complex UI + +Here you can see how `ASTextNode`s (highlighted in yellow), an `ASVideoNode` (top image) and an `ASStackLayoutSpec` ("stack layout spec") can be combined to create a complex layout. + + + +The play button on top of the `ASVideoNode` (top image) is placed using an `ASCenterLayoutSpec` ("center layout spec") and an `ASOverlayLayoutSpec` ("overlay layout spec"). + + + +### Some nodes need Sizes Set + + + +Some elements have an "intrinsic size" based on their immediately available content. For example, ASTextNode can calculate its size based on its attributed string. Other nodes that have an intrinsic size include + +- `ASImageNode` +- `ASTextNode` +- `ASButtonNode` + +All other nodes either do not have an intrinsic size or lack an intrinsic size until their external resource is loaded. For example, an `ASNetworkImageNode` does not know its size until the image has been downloaded from the URL. These sorts of elments inlcude + +- `ASVideoNode` +- `ASVideoPlayerNode` +- `ASNetworkImageNode` +- `ASEditableTextNode` + +These nodes that lack an initial intrinsic size must have an initial size set for them using an `ASRatioLayoutSpec`, an `ASAbsoluteLayoutSpec` or the size properties on the style object. + +### Layout Debugging + +Calling `-asciiArtString` on any `ASDisplayNode` or `ASLayoutSpec` returns an ascii-art representation of the object and its children. Optionally, if you set the `.debugName` on any node or layout spec, that will also included in the ascii art. An example is seen below. + +
+
+
+-----------------------ASStackLayoutSpec----------------------
+|  -----ASStackLayoutSpec-----  -----ASStackLayoutSpec-----  |
+|  |       ASImageNode       |  |       ASImageNode       |  |
+|  |       ASImageNode       |  |       ASImageNode       |  |
+|  ---------------------------  ---------------------------  |
+--------------------------------------------------------------
+
+
+
+ +You can also print out the style object on any `ASLayoutElement` (node or layout spec). This is especially useful when debugging the sizing properties. + +
+
+
+(lldb) po _photoImageNode.style
+Layout Size = min {414pt, 414pt} <= preferred {20%, 50%} <= max {414pt, 414pt}
+
+
+
diff --git a/docs/_docs/layout2-web-flexbox-differences.md b/docs/_docs/layout2-web-flexbox-differences.md new file mode 100755 index 00000000..641e5953 --- /dev/null +++ b/docs/_docs/layout2-web-flexbox-differences.md @@ -0,0 +1,21 @@ +--- +title: Web Flexbox Differences +layout: docs +permalink: /docs/layout2-web-flexbox-differences.html +--- + +The goal of AsyncDisplayKit's Layout API is *not* to re-implement all of CSS. It only targets a subset of CSS and Flexbox container, and there are no plans to implement support for tables, floats, or any other CSS concepts. The AsyncDisplayKit Layout API also does not plan to support styling properties which do not affect layout such as color or background properties. + +The layout system tries to stay as close as possible to CSS. There are, however, certain cases where it differs from the web, these include: + +### Naming properties + +Certain properties have a different naming as on the web. For example `min-height` equivalent is the `minHeight` property. The full list of properties that control layout is documented in the Layout Properties section. + +### No margin / padding properties + +Layoutables don't have a padding or margin property. Instead wrapping a layoutable within an `ASInsetLayoutSpec` to apply padding or margin to the layoutable is the recommended way. See `ASInsetLayout` section for more information. + +### Missing features + +Certain features like `flexWrap` on a `ASStackLayoutSpec` are not supported currently. See Layout Properties for the full list of properties that are supported. \ No newline at end of file diff --git a/docs/_docs/map-node.md b/docs/_docs/map-node.md new file mode 100755 index 00000000..6ea77387 --- /dev/null +++ b/docs/_docs/map-node.md @@ -0,0 +1,146 @@ +--- +title: ASMapNode +layout: docs +permalink: /docs/map-node.html +prevPage: video-node.html +nextPage: control-node.html +--- + +`ASMapNode` allows you to easily specify a geographic region to show to your users. + +### Basic Usage + +Let's say you'd like to show a snapshot of San Francisco. All you need are the coordinates. + +
+SwiftObjective-C + +
+
+ASMapNode *mapNode = [[ASMapNode alloc] init];
+mapNode.preferredFrameSize = CGSizeMake(300.0, 300.0);
+
+// San Francisco
+CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(37.7749, -122.4194);
+
+// show 20,000 square meters
+mapNode.region = MKCoordinateRegionMakeWithDistance(coord, 20000, 20000);
+
+ + +
+
+ + + +The region value is actually just one piece of a property called `options` of type `MKMapSnapshotOptions`. + + +### MKMapSnapshotOptions + +A map node's main components can be defined directly through its `options` property. The snapshot options object contains the following: + +
    +
  • An MKMapCamera: used to configure altitude and pitch of the camera
  • +
  • An MKMapRect: basically a CGRect
  • +
  • An MKMapRegion: Controls the coordinate of focus, and the size around that focus to show
  • +
  • An MKMapType: Can be set to Standard, Satellite, etc.
  • +
+ +To do something like changing your map to a satellite map, you just need to create an options object and set its properties accordingly. + +
+SwiftObjective-C + +
+
+MKMapSnapshotOptions *options = [[MKMapSnapshotOptions alloc] init];
+options.mapType = MKMapTypeSatellite;
+options.region = MKCoordinateRegionMakeWithDistance(coord, 20000, 20000);
+
+mapNode.options = options;
+
+ +
+
+ +Results in: + + + +One thing to note is that setting the options value will overwrite a previously set region. + +### Annotations + +To set annotations, all you need to do is assign an array of annotations to your `ASMapNode`. + +Say you want to show a pin directly in the middle of your map of San Francisco. + +
+SwiftObjective-C + +
+
+MKPointAnnotation *annotation = [[MKPointAnnotation alloc] init];
+annotation.coordinate = CLLocationCoordinate2DMake(37.7749, -122.4194);
+
+mapNode.annotations = @[annotation];
+
+ +
+
+ + + +No problem. + +### Live Map Mode + +Chaning your map node from a static view of some region, into a fully interactable cartographic playground is as easy as: + +
+SwiftObjective-C + +
+
+mapNode.liveMap = YES;
+
+ +
+
+ +This enables "live map mode" in which the node will use an MKMapView to render an interactive version of your map. + + + +As with UIKit views, the `MKMapView` used in live map mode is not thread-safe. + +### MKMapView Delegate + +If live map mode has been enabled and you need to react to any events associated with the map node, you can set the `mapDelegate` property. This delegate should conform to the MKMapViewDelegate protocol. + + + + diff --git a/docs/_docs/multiplex-image-node.md b/docs/_docs/multiplex-image-node.md new file mode 100755 index 00000000..16beda7a --- /dev/null +++ b/docs/_docs/multiplex-image-node.md @@ -0,0 +1,109 @@ +--- +title: ASMultiplexImageNode +layout: docs +permalink: /docs/multiplex-image-node.html +prevPage: editable-text-node.html +--- + +Let's say your API is out of your control and the images in your app can't be progressive jpegs but you can retrieve a few different sizes of the image asset you want to display. This is where you would use an `ASMultiplexImageNode` instead of an ASNetworkImageNode. + +In the following example, you're using a multiplex image node in an `ASCellNode` subclass. After initialization, you typically need to do two things. First, make sure to set `downloadsIntermediateImages` to `YES` so that the lesser quality images will be downloaded. + +Then, assign an array of keys to the property `imageIdentifiers`. This list should be in descending order of image quality and will be used by the node to determine what URL to call for each image it will try to load. + +
+SwiftObjective-C + +
+
+- (instancetype)initWithURLs:(NSDictionary *)urls
+{
+    ...
+     _imageURLs = urls;          // something like @{@"thumb": "/smallImageUrl", @"medium": ...}
+
+    _multiplexImageNode = [[ASMultiplexImageNode alloc] initWithCache:nil 
+                                                           downloader:[ASBasicImageDownloader sharedImageDownloader]];
+    _multiplexImageNode.downloadsIntermediateImages = YES;
+    _multiplexImageNode.imageIdentifiers = @[ @"original", @"medium", @"thumb" ];
+
+    _multiplexImageNode.dataSource = self;
+    _multiplexImageNode.delegate   = self;
+    ...
+}
+    
+ + +
+
+ + +Then, if you've set up a simple dictionary that holds the keys you provided earlier pointing to URLs of the various versions of your image, you can simply return the URL for the given key in: + +
+SwiftObjective-C + +
+
+#pragma mark Multiplex Image Node Datasource
+
+- (NSURL *)multiplexImageNode:(ASMultiplexImageNode *)imageNode 
+        URLForImageIdentifier:(id)imageIdentifier
+{
+    return _imageURLs[imageIdentifier];
+}
+
+ + +
+
+ +There are also delegate methods provided to update you on things such as the progress of an image's download, when it has finished displaying etc. They're all optional so feel free to use them as necessary. + +For example, in the case that you want to react to the fact that a new image arrived, you can use the following delegate callback. + +
+SwiftObjective-C + +
+
+#pragma mark Multiplex Image Node Delegate
+
+- (void)multiplexImageNode:(ASMultiplexImageNode *)imageNode 
+            didUpdateImage:(UIImage *)image 
+            withIdentifier:(id)imageIdentifier 
+                 fromImage:(UIImage *)previousImage 
+            withIdentifier:(id)previousImageIdentifier;
+{    
+        // this is optional, in case you want to react to the fact that a new image came in
+}
+
+ + +
+
+ diff --git a/docs/_docs/network-image-node.md b/docs/_docs/network-image-node.md new file mode 100755 index 00000000..46427d64 --- /dev/null +++ b/docs/_docs/network-image-node.md @@ -0,0 +1,119 @@ +--- +title: ASNetworkImageNode +layout: docs +permalink: /docs/network-image-node.html +prevPage: image-node.html +nextPage: video-node.html +--- + +`ASNetworkImageNode` can be used any time you need to display an image that is being hosted remotely. All you have to do is set the `.URL` property with the appropriate `NSURL` instance and the image will be asynchonously loaded and concurrently rendered for you. + +
+SwiftObjective-C + +
+
+ASNetworkImageNode *imageNode = [[ASNetworkImageNode alloc] init];
+imageNode.URL = [NSURL URLWithString:@"https://someurl.com/image_uri"];
+	
+ + +
+
+ +### Laying Out a Network Image Node + +Since an `ASNetworkImageNode` has no intrinsic content size when it is created, it is necessary for you to explicitly specify how they should be laid out. + +

Option 1: .style.preferredSize

+ +If you have a standard size you want the image node's frame size to be you can use the `.style.preferredSize` property. + +
+SwiftObjective-C + +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constraint
+{
+	imageNode.preferredFrameSize = CGSizeMake(100, 200);
+	...
+	return finalLayoutSpec;
+}
+
+ + +
+
+ +

Option 2: ASRatioLayoutSpec

+ +This is also a perfect place to use `ASRatioLayoutSpec`. Instead of assigning a static size for the image, you can assign a ratio and the image will maintain that ratio when it has finished loading and is displayed. + +
+SwiftObjective-C + +
+
+- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constraint
+{
+	CGFloat ratio = 3.0/1.0;
+	ASRatioLayoutSpec *imageRatioSpec = [ASRatioLayoutSpec ratioLayoutSpecWithRatio:ratio child:self.imageNode];
+	...
+	return finalLayoutSpec;
+}
+
+ + +
+
+ +### Under the Hood + +
If you choose not to include the PINRemoteImage and PINCache dependencies you will lose progressive jpeg support and be required to include your own custom cache that conforms to ASImageCacheProtocol.
+ +#### Progressive JPEG Support + +Thanks to the inclusion of PINRemoteImage, network image nodes now offer full support for loading progressive JPEGs. This means that if your server provides them, your images will display quickly at a lower quality that will scale up as more data is loaded. + +To enable progressive loading, just set `shouldRenderProgressImages` to `YES` like so: + +
+SwiftObjective-C + +
+
+networkImageNode.shouldRenderProgressImages = YES;
+
+ + +
+
+ +It's important to remember that this is using one image that is progressively loaded. If your server is constrained to using regular JPEGs, but provides you with multiple versions of increasing quality, you should check out ASMultiplexImageNode instead. + +#### Automatic Caching + +`ASNetworkImageNode` now uses PINCache under the hood by default to cache network images automatically. + +#### GIF Support + +`ASNetworkImageNode` provides GIF support through `PINRemoteImage`'s beta `PINAnimatedImage`. Of note! This support will not work for local files unless `shouldCacheImage` is set to `NO`. diff --git a/docs/_docs/node-overview.md b/docs/_docs/node-overview.md new file mode 100755 index 00000000..4b0a5182 --- /dev/null +++ b/docs/_docs/node-overview.md @@ -0,0 +1,81 @@ +--- +title: Node Subclasses +layout: docs +permalink: /docs/node-overview.html +prevPage: containers-overview.html +nextPage: subclassing.html +--- + +AsyncDisplayKit offers the following nodes. + +A key advantage of using nodes over UIKit components is that **all nodes preform layout and display off of the main thread**, so that the main thread is available to immediately respond to user interaction events. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ASDK NodeUIKit Equivalent
ASDisplayNodein place of UIKit's UIView
+ The root AsyncDisplayKit node, from which all other nodes inherit.
ASCellNodein place of UIKit's UITableViewCell & UICollectionViewCell
+ ASCellNodes are used in ASTableNode, ASCollectionNode and ASPagerNode.
ASScrollNodein place of UIKit's UIScrollView +

This node is useful for creating a customized scrollable region that contains other nodes.

ASEditableTextNode
+ ASTextNode
in place of UIKit's UITextView
+ in place of UIKit's UILabel
ASImageNode
+ ASNetworkImageNode
+ ASMultiplexImageNode
in place of UIKit's UIImage
ASVideoNode
+ ASVideoPlayerNode
in place of UIKit's AVPlayerLayer
+ in place of UIKit's UIMoviePlayer
ASControlNodein place of UIKit's UIControl
ASButtonNodein place of UIKit's UIButton
ASMapNodein place of UIKit's MKMapView
+ +
+Despite having rough equivalencies to UIKit components, in general, AsyncDisplayKit nodes offer more advanced features and conveniences. For example, an `ASNetworkImageNode` does automatic loading and cache management, and even supports progressive jpeg and animated gifs. + +The `AsyncDisplayKitOverview` example app gives basic implementations of each of the nodes listed above. + + +# Node Inheritance Hierarchy + +All AsyncDisplayKit nodes inherit from `ASDisplayNode`. + +node inheritance flowchart + +The nodes highlighted in blue are synchronous wrappers of UIKit elements. For example, `ASScrollNode` wraps a `UIScrollView`, and `ASCollectionNode` wraps a `UICollectionView`. An `ASMapNode` in `liveMapMode` is a synchronous wrapper of `UIMapView`. + + + + diff --git a/docs/_docs/overlay-layout-spec.md b/docs/_docs/overlay-layout-spec.md new file mode 100755 index 00000000..3ddbe823 --- /dev/null +++ b/docs/_docs/overlay-layout-spec.md @@ -0,0 +1,7 @@ +--- +title: ASOverlayLayoutSpec +layout: docs +permalink: /docs/overlay-layout-spec.html +--- + +
😑 This page is coming soon...
\ No newline at end of file diff --git a/docs/_docs/philosophy.md b/docs/_docs/philosophy.md new file mode 100755 index 00000000..fc16f1a0 --- /dev/null +++ b/docs/_docs/philosophy.md @@ -0,0 +1,47 @@ +--- +title: Philosophy +layout: docs +permalink: /docs/philosophy.html +prevPage: getting-started.html +nextPage: installation.html +--- + +#Asynchronous Performance Gains + +AsyncDisplayKit is a UI framework that was originally born from Facebook’s Paper app. It came as an answer to one of the core questions the Paper team faced. **How can you keep the main thread as clear as possible?** + +Nowadays, many apps have a user experience that relies heavily upon continuous gestures and physics based animations. At the very least, your UI is probably dependent on some form of scroll view. These types of user interfaces depend entirely on the main thread and are extremely sensitive to main thread stalls. **A clogged main thread means dropped frames and an unpleasant user experience.** + +AsyncDisplayKit Nodes are a thread-safe abstraction layer over UIViews and CALayers: + +logo + +You can access most view and layer properties when using nodes, the difference is that nodes are rendered concurrently by default, and measured and laid out asynchronously when used correctly! + +Too see asynchronous performance gains in action, check out the `examples/ASDKgram` app which compares a UIKit-implemented social media feed with an ASDK-implemented social media feed! + +On an iPhone 6+, the performance may not be radically different, but on a 4S, the difference is dramatic! Which leads us to ASDK's next priority... + +#A Great App Experience for All Users + +ASDK's performance gains allow you to easily design a great experience for every app user - across all devices, on all network connections. + +##A Great Developer Experience + +ASDK also strives to make the developer experience great +- platform compatability: iOS & tvOS +- language compatability: Objective-C & Swift +- requires fewer lines of code to build advanced apps (see `examples/ASDKgram` for a direct comparison of a UIKit implemention of an app vs. an equivalent ASDK implementation) +- cleaner architecture patterns +- robust code (some really brilliant minds have worked on this for 3+ years). + +#Advanced Developer Tools + +As ASDK has grown, some of the brightest iOS engineers have contributed advanced technologies that will save you, as a developer using ASDK, development time. + +###Advanced Technology +- ASRunLoopQueue +- ASRangeController with Intelligent Preloading + +###Network Code Savings +- automatic batch fetching (e.g. JSON payloads) diff --git a/docs/_docs/placeholder-fade-duration.md b/docs/_docs/placeholder-fade-duration.md new file mode 100755 index 00000000..f236f6a7 --- /dev/null +++ b/docs/_docs/placeholder-fade-duration.md @@ -0,0 +1,32 @@ +--- +title: Placeholders +layout: docs +permalink: /docs/placeholder-fade-duration.html +prevPage: image-modification-block.html +nextPage: accessibility.html +--- + +## ASDisplayNodes may Implement Placeholders + +Any `ASDisplayNode` subclass may implement the `-placeholderImage` method to provide a placeholder that covers content until a node's contents are finished displaying. To use placeholders, set `.placeholderEnabled = YES` and optionally set a `.placeholderFadeDuration`; + +For image drawing, use the node's `.calculatedSize` property. + +
+The `-placeholderImage` function may be called on a background thread, so it is important that this function is thread safe. Note that `-[UIImage imageNamed:]` is not thread safe when using image assets. Instead use `-[UIImage imageWithContentsOfFile:]`. +
+ + +An ideal resource for creating placeholder images, including rounded rect solid colored ones or simple square corner ones is the `UIImage+ASConvenience` category methods in ASDK. + +See our ancient Placeholders sample app to see this concept, first invented by the Facebook Paper team, in action. + +## `.neverShowPlaceholders` + +Hear Scott Goodson explain placeholders, `.neverShowPlaceholders` and why UIKit doesn't have them. + +## ASNetworkImageNode also have Default Images + +In _addition_ to placeholders, `ASNetworkImageNode`s also have a `.defaultImage` property. While placeholders are meant to be transient, default images will persist if the image node's `.URL` property is `nil` or if the URL fails to load. + +We suggest using default images for avatars, while using placeholder images for photos. diff --git a/docs/_docs/principles.md b/docs/_docs/principles.md new file mode 100755 index 00000000..8815a402 --- /dev/null +++ b/docs/_docs/principles.md @@ -0,0 +1,33 @@ +--- +title: Principles +layout: docs +permalink: /docs/principles.html +--- + +The following principles guide the design and development of the AsyncDisplayKit framework. + +## 1. Reliable + +- **What:** Behavior should match the documentation. The framework shouldn't crash in production, even when used incorrectly. +- **Why:** If the framework is not reliable, then it cannot be used in production apps. More importantly, it will drain the morale of the engineers working on it. +- **How:** Meaningful, stable unit tests. We will devote a significant chunk of our resources to build unit tests. + +## 2. Familiar + +- **What:** Interfaces should match industry standards such as UIKit and CSS when possible. When we diverge from these standards, the interfaces should as be intuitive and direct as possible. +- **Why:** If the framework is not familiar, then companies will be wary about adopting it. Engineers trained in UIKit, especially junior ones, will be frustrated and unproductive. +- **How:** Compare API to other mature frameworks, reach out to users when developing new API to get feedback. Be generous with abstraction layers – as long as we don't sacrifice Reliable. + +## 3. Lean + +- **What:** Speed and memory conservation should be industry-leading, the API should be concise, and implementation code should be short and organized. +- **Why:** Performance is at the heart of AsyncDisplayKit. It's what we do and we do it better than anyone else. In addition, a concise codebase and API are easier to maintain and learn. Plus it's just the right thing to do. +- **How:** Look for opportunities to improve performance. Think about the performance implications of each line of code. Dedicate resources to refactoring. Build tools to gather and expose performance metrics. + +## 4. Bold + +- **What:** Ambitious features, such as animated layout transitioning or our visibility-depth system, should be added from time to time. +- **Why:** Cutting-edge, never-before-seen tech gets people excited about the framework, and can raise the bar for the entire industry. They really move the needle on the user experience in subtle ways. Plus it's fun! +- **How:** Propose crazy ideas. See them through – ensure they get into the workflow and get resources allocated for them. + + \ No newline at end of file diff --git a/docs/_docs/relative-layout-spec.md b/docs/_docs/relative-layout-spec.md new file mode 100755 index 00000000..a9e6a157 --- /dev/null +++ b/docs/_docs/relative-layout-spec.md @@ -0,0 +1,7 @@ +--- +title: ASRelativeLayoutSpec +layout: docs +permalink: /docs/relative-layout-spec.html +--- + +
😑 This page is coming soon...
\ No newline at end of file diff --git a/docs/_docs/resources.md b/docs/_docs/resources.md new file mode 100755 index 00000000..503e556d --- /dev/null +++ b/docs/_docs/resources.md @@ -0,0 +1,49 @@ +--- +title: Resources +layout: docs +permalink: /docs/resources.html +prevPage: getting-started.html +nextPage: installation.html +--- + +### Slack + +Join 700+ AsyncDisplayKit developers and the AsyncDisplayKit core team on Slack for real-time debugging, the latest updates, and asynchronous banter. Signup here. + +### Examples +Browse through our many example projects. + +If you are new to AsyncDisplayKit, we recommend that you start with the ASDKgram example app which compares a photo feed implemented with UIKit to an identical feed implemented with AsyncDisplayKit. The app features: +
    +
  1. An infinitely scrolling home feed that demonstrates ASDK's smoother scrolling performance.
  2. +
  3. A significantly sized code base to demonstrate how much less code it takes to design apps using AsyncDisplayKit.
  4. +
+ +### Videos + + +### Tutorials / Articles + + + +### Layout Resources +AsyncDisplayKit's powerful layout system is based on the CSS FlexBox model. These sites are useful for learning the basics of this system. + diff --git a/docs/_docs/roadmap.md b/docs/_docs/roadmap.md new file mode 100755 index 00000000..569f2126 --- /dev/null +++ b/docs/_docs/roadmap.md @@ -0,0 +1,49 @@ +--- +title: Roadmap +layout: docs +permalink: /docs/roadmap.html +--- + +This document outlines some of the upcoming plans for AsyncDisplayKit. Since AsyncDisplayKit is a fast-moving project with a small core team, this roadmap will change over time. + +The AsyncDisplayKit roadmap is driven by the framework's four key qualities. You can read read more about the principles here. + +## 2.1 Release + +#### Familiar + +- Increase investment in Swift over time. +- Adopt a more regular release cadence. +- Reversible 0-100% transitions for our Layout Transition API. + +#### Bold + +- Declarative collection node API. [Try it out]() and give us feedback! + +## 2.5+ Release + +#### Reliable + +- Audit typography features. + +#### Familiar + +- Better supplementary node support. + +#### Lean + +- True asynchronous layout. + +#### Bold + +- First class transitions with the Layout Transition API. +- Extreme debuggability. +- AsyncKit? + +## Ways to Get Involved + +- Connect on GitHub, Slack and Twitter. +- Vet our documentation. Submit or suggest ways to improve. +- Share your experience using AsyncDisplayKit. Thanks Buffer! +- Contribute layout examples. +- Contribute code. Try to implement one of our "Needs Volunteer" issues. diff --git a/docs/_docs/scroll-node.md b/docs/_docs/scroll-node.md new file mode 100755 index 00000000..344faebc --- /dev/null +++ b/docs/_docs/scroll-node.md @@ -0,0 +1,81 @@ +--- +title: ASScrollNode +layout: docs +permalink: /docs/scroll-node.html +prevPage: control-node.html +nextPage: editable-text-node.html +--- + +`ASScrollNode` is an `ASDisplayNode` whose underlying view is an `UIScrollView`. This class offers the ability to automatically adopt its `ASLayoutSpec`'s size as the scrollable `contentSize`. + +### automaticallyManagesContentSize + +When enabled, the size calculated by the `ASScrolNode`'s layout spec defines the `.contentSize` of the scroll view. This is in contrast to most nodes, where the `layoutSpec` size is applied to the bounds (and in turn, frame). In this mode, the bounds of the scroll view always fills the parent's size. + +`automaticallyManagesContentSize` is useful both for subclasses of `ASScrollNode` implementing `layoutSpecThatFits:` or may also be used as the base class with `.layoutSpecBlock` set. In both cases, it is common use `.automaticallyManagesSubnodes` so that the nodes in the layout spec are added to the scrollable area automatically. + +With this approach there is no need to capture the layout size, use an absolute layout spec as a wrapper, or set `contentSize` anywhere in the code and it will update as the layout changes! Instead, it is very common and useful to simply return an `ASStackLayoutSpec` and the scrollable area will allow you to see all of it. + +### scrollableDirections + +This option is useful when using `automaticallyManagesContentSize`, especially if you want horizontal content (because the default is vertical). + +This property controls how the `constrainedSize` is interpreted when sizing the content. Options include: + + + + + + + + + + + + + + +
VerticalThe `constrainedSize` is interpreted as having unbounded `.height` (`CGFLOAT_MAX`), allowing stacks and other content in the layout spec to expand and result in scrollable content.
HorizontalThe `constrainedSize` is interpreted as having unbounded `.width` (`CGFLOAT_MAX`).
Vertical & HorizontalThe `constrainedSize` is interpreted as unbounded in both directions.
+ +### Example + +In case you're not familiar with scroll views, they are basically windows into content that would take up more space than can fit in that area. + +Say you have a giant image, but you only want to take up 200x200 pts on the screen. + +
+SwiftObjective-C + +
+
+// NOTE: If you are using a horizontal stack, set scrollNode.scrollableDirections.
+ASScrollNode *scrollNode = [[ASScrollNode alloc] init];
+scrollNode.automaticallyManagesSubnodes = YES;
+scrollNode.automaticallyManagesContentSize = YES;
+
+scrollNode.layoutSpecBlock = ^(ASDisplayNode *node, ASSizeRange constrainedSize){
+  ASStackLayoutSpec *stack = [ASStackLayoutSpec verticalStackLayoutSpec];
+  // Add children to the stack.
+  return stack;
+};
+
+
+ +
+
+ +As you can see, the `scrollNode`'s underlying view is a `ASScrollNode`. + diff --git a/docs/_docs/static-layout-spec.md b/docs/_docs/static-layout-spec.md new file mode 100755 index 00000000..01318bf4 --- /dev/null +++ b/docs/_docs/static-layout-spec.md @@ -0,0 +1,7 @@ +--- +title: ASStaticLayoutSpec +layout: docs +permalink: /docs/static-layout-spec.html +--- + +
😑 This page is coming soon...
\ No newline at end of file diff --git a/docs/_docs/subclassing.md b/docs/_docs/subclassing.md new file mode 100755 index 00000000..e284f252 --- /dev/null +++ b/docs/_docs/subclassing.md @@ -0,0 +1,110 @@ +--- +title: Subclassing +layout: docs +permalink: /docs/subclassing.html +prevPage: containers-overview.html +nextPage: faq.html +--- +The most important distinction when creating a subclass is whether you writing an ASViewController or an ASDisplayNode. This sounds obvious, but because some of these differences are subtle, it is important to keep this top of mind. + +## ASDisplayNode +
+While subclassing nodes is similar to writing a UIView subclass, there are a few guidelines to follow to ensure that both that you're utilizing the framework to its full potential and that your nodes behave as expected. + +### `-init` + +This method is called on a **background thread** when using nodeBlocks. However, because no other method can run until -init is finished, it should never be necessary to have a lock in this method. + +The most important thing to remember is that your init method must be capable of being called on any queue. Most notably, this means you should never initialize any UIKit objects, touch the view or layer of a node (e.g. `node.layer.X` or `node.view.X`) or add any gesture recognizers in your initializer. Instead, do these things in `-didLoad`. + +### `-didLoad` + +This method is conceptually similar to UIViewController's `-viewDidLoad` method and is the point where the backing view has been loaded. It is guaranteed to be called on the **main thread** and is the appropriate place to do any UIKit things (such as adding gesture recognizers, touching the view / layer, initializing UIKIt objects). + +### `-layoutSpecThatFits:` + +This method defines the layout and does the heavy calculation on a **background thread**. This method is where you build out a layout spec object that will produce the size of the node, as well as the size and position of all subnodes. This is where you will put the majority of your layout code. + +The layout spec object that you create is malleable up until the point that it is return in this method. After this point, it will be immutable. It's important to remember not to cache layout specs for use later but instead to recreate them when necessary. + +Because it is run on a background thread, you should not set any `node.view` or `node.layer` properties here. Also, unless you know what you are doing, do not create any nodes in this method. Additionally, it is not neccessary to begin this method with a call to super, unlike other method overrides. + +### `-layout` + +The call to super in this method is where the results of the layoutSpec are applied; Right after the call to super in this method, the layout spec will have been calculated and all subnodes will have been measured and positioned. + +`-layout` is conceptually similar to UIViewController's `-viewWillLayoutSubviews`. This is a good spot to change the hidden property, set view based properties if needed (not layoutable properties) or set background colors. You could put background color setting in -layoutSpecThatFits:, but there may be timing problems. If you happen to be using any UIViews, you can set their frames here. However, you can always create a node wrapper with `-initWithViewBlock:` and then size this on the background thread elsewhere. + +This method is called on the **main thread**. However, if you are using layout Specs, you shouldn't rely on this method too much, as it is much preferable to do layout off the main thread. Less than 1 in 10 subclasses will need this. + +One great use of `-layout` is for the specific case in which you want a subnode to be your exact size. E.g. when you want a collectionNode to take up the full screen. This case is not supported well by layout specs and it is often easiest to set the frame manually with a single line in this method: + +``` +subnode.frame = self.bounds; +``` + +If you desire the same effect in a ASViewController, you can do the same thing in -viewWillLayoutSubviews, unless your node is the node in initWithNode: and in that case it will do this automatically. + +## ASViewController +
+An `ASViewController` is a regular `UIViewController` subclass that has special features to manage nodes. Since it is a UIViewController subclass, all methods are called on the **main thread** (and you should always create an ASViewController on the main thread). + +### `-init` + +This method is called once, at the very begining of an ASViewController's lifecycle. As with UIViewController initialization, it is best practice to **never access** `self.view` or `self.node.view` in this method as it will force the view to be created early. Instead, do any view access in -viewDidLoad. + +ASViewController's designated initializer is `initWithNode:`. A typical initializer will look something like the code below. Note how the ASViewController's node is created _before_ calling super. An ASViewController manages a node similarly to how a UIViewController manages a view, but the initialization is slightly different. + + +
+SwiftObjective-C + +
+
+- (instancetype)init
+{
+  _pagerNode = [[ASPagerNode alloc] init];
+  self = [super initWithNode:_pagerNode];
+  
+  // setup any instance variables or properties here
+  if (self) {
+    _pagerNode.dataSource = self;
+    _pagerNode.delegate = self;
+  }
+  
+  return self;
+}
+
+ +
+
+ +### `-loadView` + +We recommend that you do not use this method because it is has no particular advantages over `-viewDidLoad` and has some disadvantages. However, it is safe to use as long as you do not set the `self.view` property to a different value. The call to [super loadView] will set it to the `node.view` for you. + +### `-viewDidLoad` + +This method is called once in a ASViewController's lifecycle, immediately after `-loadView`. This is the earliest time at which you should access the node's view. It is a great spot to put any **setup code that should only be run once and requires access to the view/layer**, such as adding a gesture recognizer. + +Layout code should never be put in this method, because it will not be called again when geometry changes. Note this is equally true for UIViewController; it is bad practice to put layout code in this method even if you don't currently expect geometry changes. + +### `-viewWillLayoutSubviews` + +This method is called at the exact same time as a node's `-layout` method and it may be called multiple times in a ASViewController's lifecycle; it will be called whenever the bounds of the ASViewController's node are changed (including rotation, split screen, keyboard presentation) as well as when there are changes to the hierarchy (children being added, removed, or changed in size). + +For consistency, it is best practice to put all layout code in this method. Because it is not called very frequently, even code that does not directly depend on the size belongs here. + +### `-viewWillAppear:` / `-viewDidDisappear:` + +These methods are called just before the ASViewController's node appears on screen (the earliest time that it is visible) and just after it is removed from the view hierarchy (the earliest time that it is no longer visible). These methods provide a good opportunity to start or stop animations related to the presentation or dismissal of your controller. This is also a good place to make a log of a user action. + +Although these methods may be called multiple times and geometry information is available, they are not called for all geometry changes and so should not be used for core layout code (beyond setup required for specific animations). diff --git a/docs/_docs/subtree-rasterization.md b/docs/_docs/subtree-rasterization.md new file mode 100755 index 00000000..a086cea3 --- /dev/null +++ b/docs/_docs/subtree-rasterization.md @@ -0,0 +1,26 @@ +--- +title: Subtree Rasterization +layout: docs +permalink: /docs/subtree-rasterization.html +prevPage: layer-backing.html +nextPage: synchronous-concurrency.html +--- + +Flattening an entire view hierarchy into a single layer improves performance, but with UIKit, comes with a hit to maintainability and hierarchy-based reasoning. + +With all AsyncDisplayKit nodes, enabling precompositing is as simple as: + +
+SwiftObjective-C +
+
+rootNode.shouldRasterizeDescendants = YES;
+
+ +
+
+
+ +This line will cause the entire node hierarchy from that point on to be rendered into one layer. diff --git a/docs/_docs/synchronous-concurrency.md b/docs/_docs/synchronous-concurrency.md new file mode 100755 index 00000000..e0d9053d --- /dev/null +++ b/docs/_docs/synchronous-concurrency.md @@ -0,0 +1,28 @@ +--- +title: Synchronous Concurrency +layout: docs +permalink: /docs/synchronous-concurrency.html +prevPage: subtree-rasterization.html +nextPage: corner-rounding.html +--- + +Both `ASViewController` and `ASCellNode` have a property called `neverShowPlaceholders`. + +By setting this property to YES, the main thread will be blocked until display has completed for the cell or view controller's view. + +Using this option does not eliminate all of the performance advantages of AsyncDisplayKit. Normally, a given node has been preloading and is almost done when it reaches the screen, so the blocking time is very short. Even if the rangeTuningParameters are set to 0 this option outperforms UIKit. While the main thread is waiting, all subnode display executes concurrently, thus synchronous concurrency. + +
+SwiftObjective-C +
+
+node.neverShowPlaceholders = YES;
+
+ +
+
+
+ +Usually, if a cell hasn't finished its display pass before it has reached the screen it will show placeholders until it has drawing its content. Setting this option to YES makes your scrolling node or ASViewController act more like UIKit, and in fact makes AsyncDisplayKit scrolling visually indistinguishable from UIKit's, except that it's faster. diff --git a/docs/_docs/team.md b/docs/_docs/team.md new file mode 100755 index 00000000..b4351ed8 --- /dev/null +++ b/docs/_docs/team.md @@ -0,0 +1,44 @@ +--- +title: Pinterest Team +layout: docs +permalink: /docs/team.html +--- + + + + + + + + + + + + + + + + + + + + + + +

Scott Goodson (@appleguy) is an original author of AsyncDisplayKit and, most recently, a driving force behind making Pinterest's design vision a reality with the recent rewrite of the iOS app.

+

Previously, Scott managed the Facebook Paper and Instagram iOS engineering teams, and helped lead the native code rewrite of the core Facebook iOS app. He also spent four years at Apple where he was one of the first ten engineers to work on iPhone OS 1.0, and developed apps like Stocks and Calculator.

+

Scott is deeply passionate about building AsyncDisplayKit into a framework that allows effortless development of polished and performant apps that serve all users, regardless of device age, internet connection, or language.

Michael Schneider (@maicki) is especially passionate about API design and recently led the re-architecture of the layout API for the 2.0 release. As our resident layout expert, Michael volunteers much of his own time to help developers on ASDK's public slack channel. Previous, Michael worked on Pocket for iOS, Mac and Chrome and the Instapaper Mac app.

Huy Nguyen (@nguyenhuy ) joined the Pinterest team after authoring AsyncDisplayKit's automatic layout feature, which has become the foundation for the AsyncDisplayKit's 2.0 release. To date, the Layout API has been the largest contribution to the framework by a community member!

Garrett Moon (@garrettmoon ) is the fearless leader of Pinterest's framework team. He also authored PINRemoteImage - a threadsafe, performant, feature rich image fetcher, and PINCache, a non-deadlocking fork of TMCache. Both are used as the backing store for ASNetworkImageNode.

Adlai ("Ad-lee") Holler (@adlai-holler) joined the Pinterest team after making major contributions to the framework while writing Tripstr in Swift with AsyncDisplayKit.

+
+ +# Join us! + +We are looking for senior developers familiar with AsyncDisplayKit to join our team! + +We have an exciting roadmap that we believe will continue to push the boundaries of what is possible on the iOS platform, while making the framework easier to use than ever before. + +As part of the team, you would work on AsyncDisplayKit, [PINRemoteImage](https://github.com/pinterest/PINRemoteImage), and [PINCache](https://github.com/pinterest/PINCache) (the backing store for ASNetworkImageNode), while using all three in Pinterest's [app](https://itunes.apple.com/us/app/pinterest/id429047995). + +One interesting thing to note is that Pinterest does not have an internal fork of AsyncDisplayKit. Everything is developed on master, with release branches cut from master only a few weeks before our public application launches. This allows us to move exceptionally quickly in developing and launching improvements to millions of users. + +Sound interesting? +Send us an email at AsyncDisplayKit(at)gmail.com. diff --git a/docs/_docs/text-cell-node.md b/docs/_docs/text-cell-node.md new file mode 100755 index 00000000..e9d0438b --- /dev/null +++ b/docs/_docs/text-cell-node.md @@ -0,0 +1,45 @@ +--- +title: ASTextCellNode +layout: docs +permalink: /docs/text-cell-node.html +prevPage: cell-node.html +nextPage: control-node.html +--- + +ASTextCellNode is a simple ASCellNode subclass you can use when all you need is a cell with styled text. + +
+SwiftObjective-C +
+
+ASTextCellNode *textCell = [[ASTextCellNode alloc]
+            initWithAttributes:@{NSFontAttributeName: [UIFont fontWithName:@"SomeFont" size:16.0]} 												  insets:UIEdgeInsetsMake(8, 16, 8, 16)];
+  
+ +
+
+ +The text can be configured on initialization or after the fact. + +
+SwiftObjective-C +
+
+ASTextCellNode *textCell = [[ASTextCellNode alloc] init];
+
+textCellNode.text         = @"Some dang ol' text";
+textCellNode.attributes   = @{NSFontAttributeName: [UIFont fontWithName:@"SomeFont" size:16.0]};
+textCellNode.insets       = UIEdgeInsetsMake(8, 16, 8, 16);
+  
+ +
+
\ No newline at end of file diff --git a/docs/_docs/text-node.md b/docs/_docs/text-node.md new file mode 100755 index 00000000..1210a512 --- /dev/null +++ b/docs/_docs/text-node.md @@ -0,0 +1,147 @@ +--- +title: ASTextNode +layout: docs +permalink: /docs/text-node.html +prevPage: button-node.html +nextPage: image-node.html +--- + +`ASTextNode` is AsyncDisplayKit's main text node and can be used any time you would normally use a `UILabel`. It includes full rich text support and is a subclass of `ASControlNode` meaning it can be used any time you would normally create a UIButton with just its titleLabel set. + +### Basic Usage +`ASTextNode`'s interface should be familiar to anyone who's used a `UILabel`. The first difference you may notice, is that text node's only use attributed strings instead of having the option of using a plain string. + +
+SwiftObjective-C + +
+
+NSDictionary *attrs = @{ NSFontAttributeName: [UIFont fontWithName:@"HelveticaNeue" size:12.0f] };
+NSAttributedString *string = [[NSAttributedString alloc] initWithString:@"Hey, here's some text." attributes:attrs];
+
+_node = [[ASTextNode alloc] init];
+_node.attributedString = string;
+
+ + +
+
+ +As you can see, to create a basic text node, all you need to do is use a standard alloc-init and then set up the attributed string for the text you wish to display. + +### Truncation + +In any case where you need your text node to fit into a space that is smaller than what would be necessary to display all the text it contains, as much as possible will be shown, and whatever is cut off will be replaced with a truncation string. + + +
+SwiftObjective-C + +
+
+_textNode = [[ASTextNode alloc] init];
+_textNode.attributedString = string;
+_textNode.truncationAttributedString = [[NSAttributedString alloc] 
+												initWithString:@"¶¶¶"];
+
+ + +
+
+ +This results in something like: + + + +By default, the truncation string will be "…" so you don't need to set it if that's all you need. + + +### Link Attributes + +In order to designate chunks of your text as a link, you first need to set the `linkAttributes` array to an array of strings which will be used as keys of links in your attributed string. Then, when setting up the attributes of your string, you can use these keys to point to appropriate `NSURL`s. + +
+SwiftObjective-C + +
+
+_textNode.linkAttributeNames = @[ kLinkAttributeName ];
+
+NSString *blurb = @"kittens courtesy placekitten.com \U0001F638";
+NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:blurb];
+[string addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"HelveticaNeue-Light" size:16.0f] range:NSMakeRange(0, blurb.length)];
+[string addAttributes:@{
+                      kLinkAttributeName: [NSURL URLWithString:@"http://placekitten.com/"],
+                      NSForegroundColorAttributeName: [UIColor grayColor],
+                      NSUnderlineStyleAttributeName: @(NSUnderlineStyleSingle | NSUnderlinePatternDot),
+                      }
+              range:[blurb rangeOfString:@"placekitten.com"]];
+_textNode.attributedString = string;
+
+ + +
+
+ +Which results in a light gray link with a dash-dot style underline! + + + +As you can see, it's relatively convenient to apply various styles to each link given its range in the attributed string. + +### ASTextNodeDelegate + +Conforming to `ASTextNodeDelegate` allows your class to react to various events associated with a text node. For example, if you want to react to one of your links being tapped: + +
+SwiftObjective-C + +
+
+- (void)textNode:(ASTextNode *)richTextNode tappedLinkAttribute:(NSString *)attribute value:(NSURL *)URL atPoint:(CGPoint)point textRange:(NSRange)textRange
+{
+  // the link was tapped, open it
+  [[UIApplication sharedApplication] openURL:URL];
+}
+
+ + +
+
+ +In a similar way, you can react to long presses and highlighting with the following methods: + +`– textNode:longPressedLinkAttribute:value:atPoint:textRange:` + +`– textNode:shouldHighlightLinkAttribute:value:atPoint:` + +`– textNode:shouldLongPressLinkAttribute:value:atPoint:` + + diff --git a/docs/_docs/tip-1-nodeBlocks.md b/docs/_docs/tip-1-nodeBlocks.md new file mode 100755 index 00000000..5f30316e --- /dev/null +++ b/docs/_docs/tip-1-nodeBlocks.md @@ -0,0 +1,133 @@ +--- +title: Prefer `nodeBlocks` for Performance +layout: docs +permalink: /docs/tip-1-nodeBlocks.html +--- + +AsyncDisplayKit’s `ASCollectionNode` replaces `UICollectionView`’s required method + +
+ + Swift + Objective-C + + +
+
+collectionNode:cellForItemAtIndexPath:
+  
+ + +
+
+ +
+with your choice of **one** of the two following methods + +
+ + Swift + Objective-C + + +
+
+// called on main thread, ASCellNode initialized on main and then returned 
+collectionNode:nodeForItemAtIndexPath: 
+
+OR
+
+// called on main thread, ASCellNodeBlock returned, then
+// ASCellNode initialized in background when block is called by system
+collectionNode:nodeBlockForItemAtIndexPath: 
+  
+ + +
+
+ +
+`ASTableNode` has the same options: + +
+ + Swift + Objective-C + + +
+
+`tableNode:nodeForRow:`
+`tableNode:nodeBlockforRow:`    // preferred
+  
+ + +
+
+ +`ASPagerNode` does as well: + +
+ + Swift + Objective-C + + +
+
+`pagerNode:nodeAtIndex:`
+`pagerNode:nodeBlockAtIndex:`   // preferred
+  
+ + +
+
+ + +We reccommend that you use nodeBlocks. Using the nodeBlock method allows table and collections to request blocks for each cell node, and execute them **concurrently** across multiple threads, which allows us to **parallelize the allocation costs** (in addition to layout measurement). + +This leaves our main thread more free to handle touch events and other time sensitive work, keeping our user's taps happy and responsive. + +### Access your data source outside of the nodeBlock + +Because nodeBlocks are executed on a background thread, it is very important they be thread-safe. + +The most important aspect to consider is accessing properties on self that may change, such as an array of data models. This can be handled safely by ensuring that any immutable state is collected above the node block. + +**Using the indexPath parameter to access a mutable collection inside the node block is not safe.** This is because by the time the block runs, the dataSource may have changed. + +Here's an example of a simple nodeBlock: + +
+ + Swift + Objective-C + + +
+
+- (ASCellNodeBlock)collectionNode:(ASCollectionNode *)collectionNode nodeBlockForItemAtIndexPath:(NSIndexPath *)indexPath
+{
+    // data model is accessed outside of the node block
+    Board *board = [self.boards objectAtIndex:indexPath.item];
+    return ^{
+        BoardScrubberCellNode *node = [[BoardScrubberCellNode alloc] initWithBoard:board];
+        return node;
+    };
+}
+  
+ +
+
+ +
+Note that it is okay to use the indexPath if it is used strictly for its integer values and not to index a value from a mutable data source. + +## Do not return nil from a nodeBlock + +Just as when UIKit requests a cell, returning `nil` will crash the app, so it is important to ensure a valid ASCellNode is returned for either the node or nodeBlock method. Your code should ensure that at least a blank ASCellNode is returned, but ideally the number of items reported to the collection would prevent the method from being called when there is no data to display. \ No newline at end of file diff --git a/docs/_docs/uicollectionview-challenges.md b/docs/_docs/uicollectionview-challenges.md new file mode 100755 index 00000000..9f554df2 --- /dev/null +++ b/docs/_docs/uicollectionview-challenges.md @@ -0,0 +1,160 @@ +--- +title: UICollectionView Challenges +layout: docs +permalink: /docs/uicollectionview-challenges.html +--- + +`UICollectionView` is one of the most commonly used classes and many challenges with iOS development are related to its architecture. + +## How `UICollectionView` Works + +There are two important methods that `UICollectionView` requires. + +

Cell Measurement

+ +For each item in the data source, the collection must know its size to understand which items should be visible at a given momement. This is provided by: + +
+SwiftObjective-C +
+
+- (CGSize)collectionView:(UICollectionView *)collectionView 
+                  layout:(UICollectionViewLayout *)collectionViewLayout 
+  sizeForItemAtIndexPath:(NSIndexPath *)indexPath;
+
+ +
+
+ +Although not formally named by Apple, we refer to this process as "measuring". Implementing this method is always difficult, because the view that implements the cell layout is never available at the time of this method call. + +This means that logic must be duplicated between the implementation of this method and the `-layoutSubviews` implementation of the cell subclass. This presents a tremendous maintainence burden, as the implementations must always match their behavior for any combination of content displayed. + +Additionally, once measurement is complete, there's no easy way to cache that information to use it during the layout process. As a result, expensive text measurements must be repeated. + +

Cell Allocation

+ +Once an item reaches the screen, a view representing it is requested: + +
+SwiftObjective-C +
+
+- (UICollectionViewCell *)cellForItemAtIndexPath:(NSIndexPath *)indexPath;
+
+ +
+
+ +In order to provide a cell, all subviews must be configured with the data that they are intended to display. Immediately afterwards, the layout of the cell is calculated, and finally the display (rendering) of the individual elements (text, images) contained within. + +
+For those who are curious, this extremely detailed diagram shows the full process of UICollectionView communicating with its data source and delegate to display itself. +
+ +

Limitations in `UICollectionView`'s Architecture

+ +There are several issues with the architecture outlined above: + +Lots of main thread work, which may degrade the user's experience, including + +
    +
  • cell measurement
  • +
  • cell creation + setup / reuse
  • +
  • layout
  • +
  • display (rendering)
+ +Duplicated layout logic + +You must have duplicate copies of your cell sizing logic for the cell measurement and cell layout stages. For example, if you want to add a price tag to your cell, both -sizeForItemAtIndexPath and the cell's own -layoutSubviews must be aware of how to size the tag. + +No automatic content loading + +There is no easy, universal way to handle loading content such as: +
    +
  • data pages - such as JSON fetching
  • +
  • other info - such as images or secondary JSON requests
  • +
+ +## How `ASCollectionNode` works + +

Unified Cell Measurement & Allocation

+ +AsyncDisplayKit takes both of the important collection methods explained above: + +
+SwiftObjective-C +
+
+- (UICollectionViewCell *)cellForItemAtIndexPath:(NSIndexPath *)indexPath;
+
+- (CGSize)collectionView:(UICollectionView *)collectionView 
+                  layout:(UICollectionViewLayout *)collectionViewLayout 
+  sizeForItemAtIndexPath:(NSIndexPath *)indexPath;
+
+ +
+
+ +and replaces them with a single method*: + +
+SwiftObjective-C +
+
+- (ASCellNode *)collectionNode:(ASCollectionNode *)collectionNode nodeForItemAtIndexPath:(NSIndexPath *)indexPath;
+
+ +
+
+ +or with the asynchronous versions + +
+SwiftObjective-C +
+
+- (ASCellNodeBlock)collectionNode:(ASCollectionNode *)collectionNode nodeBlockForItemAtIndexPath:(NSIndexPath *)indexPath;
+
+ +
+
+ +*Note that there is an optional method to provide a constrained size for the cell, but it is not needed by most apps. + +ASCellNode, is AsyncDisplayKit's universal cell class. They are light-weight enough to be created an an earlier time in the program (concurrently in the background) and they understand how to calculate their own size. `ASCellNode` automatically caches its measurement so that it can be quickly applied during the layout pass. + +
+As a comparison to the diagram above, this detailed diagram shows the full process of an ASCollectionView communicating with its data source and delegate to display itself.. Note that ASCollectionView is ASCollectionNode's underlying UICollectionView subclass. +
+ +

Benefits of AsyncDisplayKit's Architecture

+ +Elimination of all of the types of main thread work described above (cell allocation, measurement, layout, display)! In addition, all of this work is preformed concurrently on multiple threads. + +Because `ASCollectionNode` is aware of the position of all of its nodes, it can automatically determine when content loading is needed. The Batch Fetching API handles loading of data pages (like JSON) and Intelligent Preloading automatically manages the loading of images and text. Additionally, convenient callbacks allow implementing accurate visibility logging and secondary data model requests. + +Lastly, almost all of the concepts we've discussed here apply to `UITableView` / `ASTableNode` and `UIPageViewController` / `ASPagerNode`. + +## iOS 10 Cell Pre-fetching +Inspired by ASDK, iOS 10 introduced a cell pre-fetching. This API increases the number of cells that the collection tracks at any given time, which helps, but isn't anywhere as performance centric as being aware of all cells in the data source. + +Additionally, iOS9 still constitutes a substantial precentage of most app's userbase and will not reduce in number anywhere close to as quickly as the sunset trajectory of iOS 7 and iOS 8 devices. Whereas iOS 9 is the last supported version for about a half-dozen devices, there were zero devices that were deprecated on iOS 8 and only one deivce deprecated on iOS 7. + +Unfortunately, these iOS 9 devices are the ones in which performance is most key! diff --git a/docs/_docs/uicollectionviewinterop.md b/docs/_docs/uicollectionviewinterop.md new file mode 100755 index 00000000..6f39fa15 --- /dev/null +++ b/docs/_docs/uicollectionviewinterop.md @@ -0,0 +1,81 @@ +--- +title: UICollectionViewCell Interoperability +layout: docs +permalink: /docs/uicollectionviewinterop.html +prevPage: placeholder-fade-duration.html +nextPage: accessibility.html +--- + +AsyncDisplayKit's `ASCollectionNode` offers compatibility with synchronous, standard `UICollectionViewCell` objects alongside native `ASCellNodes`. + +Note that these UIKit cells will **not** have the performance benefits of `ASCellNodes` (like preloading, async layout, and async drawing), even when mixed within the same `ASCollectionNode`. + +However, this interoperability allows developers the flexibility to test out the framework without needing to convert all of their cells at once. + +## Implementing Interoperability + +In order to use this feature, you must: + +
    +
  1. Conform to ASCollectionDataSourceInterop and, optionally, ASCollectionDelegateInterop.
  2. +
  3. Call registerCellClass: on the collectionNode.view (in viewDidLoad, or register an onDidLoad: block).
  4. +
  5. Return nil from the nodeBlockForItem...: or nodeForItem...: method. Note: it is an error to return nil from within a nodeBlock, if you have returned a nodeBlock object.
  6. +
  7. Lastly, you must implement a method to provide the size for the cell. There are two ways this is done:
  8. +
      +
    1. UICollectionViewFlowLayout (incl. ASPagerNode). Implement + collectionNode:constrainedSizeForItemAtIndexPath:.
    2. +
    3. Custom collection layouts. Set .view.layoutInspector and have it implement + collectionView:constrainedSizeForNodeAtIndexPath:.
    4. +
    +
+ +By default, the interop data source will only be consulted in cases where no `ASCellNode` is provided to AsyncDisplayKit. However, if .dequeuesCellsForNodeBackedItems is enabled, then the interop data source will always be consulted to dequeue cells, and will be expected to return _ASCollectionViewCells in cases where a node was provided. + +## CustomCollectionView Example App + +The [CustomCollectionView](https://github.com/facebook/AsyncDisplayKit/tree/master/examples/CustomCollectionView) example project demonstrates how to use raw `UIKit` cells alongside native `ASCellNodes`. + +Open the app and verify that `kShowUICollectionViewCells` is enabled in `Sample/ViewController.m`. + +For this example, the data source method `collectionNode:nodeBlockForItemAtIndexPath:` is setup to return nil for every third cell. When nil is returned, `ASCollectionNode` will automatically query the `cellForItemAtIndexPath:` data source method. + +
+ + Swift + Objective-C + + +
+
+- (ASCellNodeBlock)collectionNode:(ASCollectionNode *)collectionNode 
+      nodeBlockForItemAtIndexPath:(NSIndexPath *)indexPath
+{
+  if (kShowUICollectionViewCells && indexPath.item % 3 == 1) {
+    // When enabled, return nil for every third cell and then 
+    // cellForItemAtIndexPath: will be called.
+    return nil;
+  }
+  
+  UIImage *image = _sections[indexPath.section][indexPath.item];
+  return ^{
+    return [[ImageCellNode alloc] initWithImage:image];
+  };
+}
+
+- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView 
+                  cellForItemAtIndexPath:(NSIndexPath *)indexPath
+{
+  return [_collectionNode.view dequeueReusableCellWithReuseIdentifier:kReuseIdentifier 
+                                                         forIndexPath:indexPath];
+}
+  
+ + +
+
+ +Run the app to see the orange `UICollectionViewCells` interspersed every 3rd cell among the `ASCellNodes` containing images. + diff --git a/docs/_docs/video-node.md b/docs/_docs/video-node.md new file mode 100755 index 00000000..699952d1 --- /dev/null +++ b/docs/_docs/video-node.md @@ -0,0 +1,87 @@ +--- +title: ASVideoNode +layout: docs +permalink: /docs/video-node.html +prevPage: network-image-node.html +nextPage: map-node.html +--- + +`ASVideoNode` provides a convenient and performant way to display videos in your app. + +
Note: If you use `ASVideoNode` in your application, you must link `AVFoundation` since it uses `AVPlayerLayer` and other `AVFoundation` classes under the hood.
+ +### Basic Usage + +The easiest way to use `ASVideoNode` is to assign it an `AVAsset`. + +
+SwiftObjective-C + +
+
+ASVideoNode *videoNode = [[ASVideoNode alloc] init];
+
+AVAsset *asset = [AVAsset assetWithURL:[NSURL URLWithString:@"http://www.w3schools.com/html/mov_bbb.mp4"]];
+videoNode.asset = asset;
+
+ + +
+
+ +### Autoplay, Autorepeat, and Muting + +You can configure the way your video node reacts to various events with a few simple `BOOL`s. + +If you'd like your video to automaticaly play when it enters the visible range, set the `shouldAutoplay` property to `YES`. Setting `shouldAutoRepeat` to `YES` will cause the video to loop indefinitely, and, of course, setting `muted` to `YES` will turn the video's sound off. + +To set up a node that automatically plays once silently, you would just do the following. + +
+SwiftObjective-C + +
+
+videoNode.shouldAutoplay = YES;
+videoNode.shouldAutorepeat = NO;
+videoNode.muted = YES;
+
+ +
+
+ +### Placeholder Image + +Since video nodes inherit from `ASNetworkImageNode`, you can use the `URL` property to assign a placeholder image. If you decide not to, the first frame of your video will automatically decoded and used as the placeholder instead. + + + + +### ASVideoNode Delegate + +There are a ton of delegate methods available to you that allow you to react to what's happening with your video. For example, if you want to react to the player's state changing, you can use: + +
+SwiftObjective-C + +
+
+- (void)videoNode:(ASVideoNode *)videoNode willChangePlayerState:(ASVideoNodePlayerState)state toState:(ASVideoNodePlayerState)toState;
+
+ +
+
+ +The easiest way to see them all is to take a look at the `ASVideoNode` header file. + diff --git a/docs/_includes/analytics.html b/docs/_includes/analytics.html new file mode 100755 index 00000000..71dbfbce --- /dev/null +++ b/docs/_includes/analytics.html @@ -0,0 +1,10 @@ + diff --git a/docs/_includes/footer.html b/docs/_includes/footer.html new file mode 100755 index 00000000..5a2e8997 --- /dev/null +++ b/docs/_includes/footer.html @@ -0,0 +1,19 @@ +
+
+

a Facebook & Pinterest collaboration ♥

+
+
+ + + + + diff --git a/docs/_includes/header.html b/docs/_includes/header.html new file mode 100755 index 00000000..cd54d0a3 --- /dev/null +++ b/docs/_includes/header.html @@ -0,0 +1,56 @@ + + + + + AsyncDisplayKit | {{ page.title }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {% if jekyll.environment == 'production' %} + {% include analytics.html %} + {% endif %} + + +
+
+

AsyncDisplayKit

+ +
+
+
diff --git a/docs/_includes/hero.html b/docs/_includes/hero.html new file mode 100755 index 00000000..d9e64e8c --- /dev/null +++ b/docs/_includes/hero.html @@ -0,0 +1,9 @@ +
+
+
+

AsyncDisplayKit

+ +
+
diff --git a/docs/_includes/nav_docs.html b/docs/_includes/nav_docs.html new file mode 100755 index 00000000..4248dd36 --- /dev/null +++ b/docs/_includes/nav_docs.html @@ -0,0 +1,21 @@ + diff --git a/docs/_layouts/apidiff.html b/docs/_layouts/apidiff.html new file mode 100755 index 00000000..8b404ac0 --- /dev/null +++ b/docs/_layouts/apidiff.html @@ -0,0 +1,14 @@ +--- +sectionid: appledocs +--- + +{% include header.html %} + +
+
+ +
+ {{ content }} +
+
+
\ No newline at end of file diff --git a/docs/_layouts/appledocs.html b/docs/_layouts/appledocs.html new file mode 100755 index 00000000..25b9391d --- /dev/null +++ b/docs/_layouts/appledocs.html @@ -0,0 +1,15 @@ +--- +sectionid: appledocs +--- + +{% include header.html %} + +
+
+ +
+ {{ content }} +
+
+
+{% include footer.html %} diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html new file mode 100755 index 00000000..c9b8ad18 --- /dev/null +++ b/docs/_layouts/default.html @@ -0,0 +1,16 @@ +{% include header.html %} + +{% if page.hero %} + {% include hero.html %} +{% endif %} + +
+
+
+ +{{ content }} + +
+
+
+{% include footer.html %} diff --git a/docs/_layouts/docs.html b/docs/_layouts/docs.html new file mode 100755 index 00000000..ce329be7 --- /dev/null +++ b/docs/_layouts/docs.html @@ -0,0 +1,39 @@ +--- +sectionid: docs +--- + +{% include header.html %} + +
+ + + +
+

+ {{ page.title }} +

+

{{ page.description }}

+ + {{ content }} + +

Edit on GitHub

+ + +
+ {% if page.prevPage %} + ← Prev + {% endif %} + {% if page.nextPage %} + Next → + {% endif %} +
+ + +
+ +
+
+ +{% include footer.html %} diff --git a/docs/_layouts/redirect.html b/docs/_layouts/redirect.html new file mode 100755 index 00000000..c24f8174 --- /dev/null +++ b/docs/_layouts/redirect.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/docs/_layouts/slack.html b/docs/_layouts/slack.html new file mode 100755 index 00000000..95d73c34 --- /dev/null +++ b/docs/_layouts/slack.html @@ -0,0 +1,14 @@ +--- +sectionid: slack +--- + +{% include header.html %} + +
+
+ +
+ {{ content }} +
+
+
diff --git a/docs/apidiff/ASDK_API_Diff_1.9.92_to_2.0.html b/docs/apidiff/ASDK_API_Diff_1.9.92_to_2.0.html new file mode 100755 index 00000000..991484bb --- /dev/null +++ b/docs/apidiff/ASDK_API_Diff_1.9.92_to_2.0.html @@ -0,0 +1,2224 @@ + + + + + + +
+
ASAbsoluteLayoutElement.h
+ +
+
Added ASAbsoluteLayoutElement
+
Added ASAbsoluteLayoutElement.layoutPosition
+
Added ASAbsoluteLayoutElement.sizeRange
+
+ +
+ +
+
ASAbsoluteLayoutSpec.h
+ +
+
Added ASAbsoluteLayoutSpecSizing
+
Added ASAbsoluteLayoutSpecSizingDefault
+
Added ASAbsoluteLayoutSpecSizingSizeToFit
+
Added ASAbsoluteLayoutSpec
+
Added ASAbsoluteLayoutSpec.sizing
+
Added +[ASAbsoluteLayoutSpec absoluteLayoutSpecWithSizing:children:]
+
Added +[ASAbsoluteLayoutSpec absoluteLayoutSpecWithChildren:]
+
+ + +
+
Modified ASStaticLayoutSpec
+ + + + +
HeaderSuperclass
FromASStaticLayoutSpec.hASLayoutSpec
ToASAbsoluteLayoutSpec.hASAbsoluteLayoutSpec
+
+
Modified +[ASStaticLayoutSpec staticLayoutSpecWithChildren:]
+ + + + +
Availability
FromAvailable
ToDeprecated
+
+
+ +
+ +
+
ASAbstractLayoutController.h
+ +
+
Added ASAbstractLayoutController (Unavailable)
+
+ +
+ +
+
ASAsciiArtBoxCreator.h
+ +
+
Removed ASLayoutableAsciiArtProtocol
+
Removed -[ASLayoutableAsciiArtProtocol asciiArtString]
+
Removed -[ASLayoutableAsciiArtProtocol asciiArtName]
+
+ + +
+
Added ASLayoutElementAsciiArtProtocol
+
Added -[ASLayoutElementAsciiArtProtocol asciiArtString]
+
Added -[ASLayoutElementAsciiArtProtocol asciiArtName]
+
+ +
+ +
+
ASAvailability.h
+ +
+
Added #def kCFCoreFoundationVersionNumber_iOS_10_0
+
Added #def AS_AT_LEAST_IOS10
+
+ +
+ +
+
ASBaseDefines.h
+ +
+
Added #def ASDISPLAYNODE_DEPRECATED_MSG
+
Added #def AS_UNAVAILABLE
+
Added #def AS_WARN_UNUSED_RESULT
+
Added #def ASOVERLOADABLE
+
+ +
+ +
+
ASBasicImageDownloader.h
+ +
+
Modified ASBasicImageDownloader
+ + + + +
Protocols
FromASImageDownloaderProtocolDeprecated, ASImageDownloaderProtocol
ToASImageDownloaderProtocol
+
+
+ +
+ +
+
ASButtonNode.h
+ +
+
Added ASButtonNodeImageAlignment
+
Added ASButtonNodeImageAlignmentBeginning
+
Added ASButtonNodeImageAlignmentEnd
+
Added ASButtonNode.imageAlignment
+
+ +
+ +
+
ASCellNode.h
+ +
+
Added ASCellNode.supplementaryElementKind
+
Added ASCellNode.layoutAttributes
+
Added ASCellNode.indexPath
+
Added ASCellNode.owningNode
+
Added ASCellNode (Unavailable)
+
+ +
+ +
+
ASCollectionNode.h
+ +
+
Added ASCollectionNode.allowsSelection
+
Added ASCollectionNode.allowsMultipleSelection
+
Added -[ASCollectionNode scrollToItemAtIndexPath:atScrollPosition:animated:]
+
Added -[ASCollectionNode registerSupplementaryNodeOfKind:]
+
Added -[ASCollectionNode performBatchAnimated:updates:completion:]
+
Added -[ASCollectionNode performBatchUpdates:completion:]
+
Added -[ASCollectionNode waitUntilAllUpdatesAreCommitted]
+
Added -[ASCollectionNode insertSections:]
+
Added -[ASCollectionNode deleteSections:]
+
Added -[ASCollectionNode reloadSections:]
+
Added -[ASCollectionNode moveSection:toSection:]
+
Added -[ASCollectionNode insertItemsAtIndexPaths:]
+
Added -[ASCollectionNode deleteItemsAtIndexPaths:]
+
Added -[ASCollectionNode reloadItemsAtIndexPaths:]
+
Added -[ASCollectionNode moveItemAtIndexPath:toIndexPath:]
+
Added -[ASCollectionNode relayoutItems]
+
Added ASCollectionNode.indexPathsForSelectedItems
+
Added -[ASCollectionNode selectItemAtIndexPath:animated:scrollPosition:]
+
Added -[ASCollectionNode deselectItemAtIndexPath:animated:]
+
Added -[ASCollectionNode numberOfItemsInSection:]
+
Added ASCollectionNode.numberOfSections
+
Added ASCollectionNode.visibleNodes
+
Added -[ASCollectionNode nodeForItemAtIndexPath:]
+
Added -[ASCollectionNode indexPathForNode:]
+
Added ASCollectionNode.indexPathsForVisibleItems
+
Added -[ASCollectionNode indexPathForItemAtPoint:]
+
Added -[ASCollectionNode cellForItemAtIndexPath:]
+
Added -[ASCollectionNode contextForSection:]
+
Added ASCollectionNode (Deprecated)
+
Added -[ASCollectionDataSource collectionNode:numberOfItemsInSection:]
+
Added -[ASCollectionDataSource numberOfSectionsInCollectionNode:]
+
Added -[ASCollectionDataSource collectionNode:nodeBlockForItemAtIndexPath:]
+
Added -[ASCollectionDataSource collectionNode:nodeForItemAtIndexPath:]
+
Added -[ASCollectionDataSource collectionNode:nodeForSupplementaryElementOfKind:atIndexPath:]
+
Added -[ASCollectionDataSource collectionNode:contextForSection:]
+
Added -[ASCollectionDelegate collectionNode:constrainedSizeForItemAtIndexPath:]
+
Added -[ASCollectionDelegate collectionNode:willDisplayItemWithNode:]
+
Added -[ASCollectionDelegate collectionNode:didEndDisplayingItemWithNode:]
+
Added -[ASCollectionDelegate collectionNode:willDisplaySupplementaryElementWithNode:]
+
Added -[ASCollectionDelegate collectionNode:didEndDisplayingSupplementaryElementWithNode:]
+
Added -[ASCollectionDelegate collectionNode:shouldHighlightItemAtIndexPath:]
+
Added -[ASCollectionDelegate collectionNode:didHighlightItemAtIndexPath:]
+
Added -[ASCollectionDelegate collectionNode:didUnhighlightItemAtIndexPath:]
+
Added -[ASCollectionDelegate collectionNode:shouldSelectItemAtIndexPath:]
+
Added -[ASCollectionDelegate collectionNode:shouldDeselectItemAtIndexPath:]
+
Added -[ASCollectionDelegate collectionNode:didSelectItemAtIndexPath:]
+
Added -[ASCollectionDelegate collectionNode:didDeselectItemAtIndexPath:]
+
Added -[ASCollectionDelegate collectionNode:shouldShowMenuForItemAtIndexPath:]
+
Added -[ASCollectionDelegate collectionNode:canPerformAction:forItemAtIndexPath:sender:]
+
Added -[ASCollectionDelegate collectionNode:performAction:forItemAtIndexPath:sender:]
+
Added -[ASCollectionDelegate collectionNode:willBeginBatchFetchWithContext:]
+
Added -[ASCollectionDelegate shouldBatchFetchForCollectionNode:]
+
Added -[ASCollectionDelegate collectionView:constrainedSizeForNodeAtIndexPath:]
+
Added -[ASCollectionDelegate collectionView:willDisplayNode:forItemAtIndexPath:]
+
+ + +
+
Modified -[ASCollectionNode reloadDataImmediately]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse -reloadData / -reloadDataWithCompletion: followed by -waitUntilAllUpdatesAreCommitted instead.
+
+
Modified ASCollectionDataSource
+ + + + +
HeaderProtocols
FromASCollectionView.hASCommonCollectionViewDataSource
ToASCollectionNode.hASCommonCollectionDataSource
+
+
Modified -[ASCollectionDataSource collectionView:nodeForItemAtIndexPath:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode's method instead.
+
+
Modified -[ASCollectionDataSource collectionView:nodeBlockForItemAtIndexPath:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode's method instead.
+
+
Modified -[ASCollectionDataSource collectionView:nodeForSupplementaryElementOfKind:atIndexPath:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode's method instead.
+
+
Modified ASCollectionDelegate
+ + + + +
HeaderProtocols
FromASCollectionView.hASCommonCollectionViewDelegate, NSObject
ToASCollectionNode.hASCommonCollectionDelegate, NSObject
+
+
Modified -[ASCollectionDelegate collectionView:didEndDisplayingNode:forItemAtIndexPath:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode's method instead.
+
+
Modified -[ASCollectionDelegate collectionView:willBeginBatchFetchWithContext:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode's method instead.
+
+
Modified -[ASCollectionDelegate shouldBatchFetchForCollectionView:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode's method instead.
+
+
Modified -[ASCollectionDelegate collectionView:willDisplayNodeForItemAtIndexPath:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode's method instead.
+
+
+ +
+ +
+
ASCollectionNode+Beta.h
+ +
+
Modified -[ASCollectionNode beginUpdates]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse -performBatchUpdates:completion: instead.
+
+
Modified -[ASCollectionNode endUpdatesAnimated:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse -performBatchUpdates:completion: instead.
+
+
Modified -[ASCollectionNode endUpdatesAnimated:completion:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse -performBatchUpdates:completion: instead.
+
+
+ +
+ +
+
ASCollectionView.h
+ +
+
Removed -[ASCollectionView clearContents]
+
Removed -[ASCollectionView clearFetchedData]
+
Removed #def ASCollectionViewDataSource
+
Removed -[ASCollectionDataSource collectionView:constrainedSizeForNodeAtIndexPath:]
+
Removed #def ASCollectionViewDelegate
+
Removed -[ASCollectionDelegate collectionView:didEndDisplayingNodeForItemAtIndexPath:]
+
Removed -[ASCollectionView initWithFrame:collectionViewLayout:asyncDataFetching:]
+
+ + +
+
Added -[ASCollectionView contextForSection:]
+
Added -[ASCollectionView cellForItemAtIndexPath:]
+
Added -[ASCollectionView scrollToItemAtIndexPath:atScrollPosition:animated:]
+
Added -[ASCollectionView selectItemAtIndexPath:animated:scrollPosition:]
+
Added ASCollectionView.indexPathsForVisibleItems
+
Added ASCollectionView.indexPathsForSelectedItems
+
Added ASCollectionViewDataSource
+
Added ASCollectionViewDelegate
+
+ + +
+
Modified -[ASCollectionView initWithCollectionViewLayout:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedPlease use ASCollectionNode instead of ASCollectionView.
+
+
Modified -[ASCollectionView initWithFrame:collectionViewLayout:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedPlease use ASCollectionNode instead of ASCollectionView.
+
+
Modified -[ASCollectionView tuningParametersForRangeType:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode method instead.
+
+
Modified -[ASCollectionView setTuningParameters:forRangeType:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode method instead.
+
+
Modified -[ASCollectionView tuningParametersForRangeMode:rangeType:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode method instead.
+
+
Modified -[ASCollectionView setTuningParameters:forRangeMode:rangeType:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode method instead.
+
+
Modified -[ASCollectionView performBatchAnimated:updates:completion:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode method instead.
+
+
Modified -[ASCollectionView performBatchUpdates:completion:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode method instead.
+
+
Modified -[ASCollectionView reloadDataWithCompletion:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode method instead.
+
+
Modified -[ASCollectionView reloadData]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode method instead.
+
+
Modified -[ASCollectionView reloadDataImmediately]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode's -reloadDataWithCompletion: followed by -waitUntilAllUpdatesAreCommitted instead.
+
+
Modified -[ASCollectionView relayoutItems]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode method instead.
+
+
Modified -[ASCollectionView waitUntilAllUpdatesAreCommitted]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode method instead.
+
+
Modified -[ASCollectionView registerSupplementaryNodeOfKind:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode method instead.
+
+
Modified -[ASCollectionView insertSections:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode method instead.
+
+
Modified -[ASCollectionView deleteSections:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode method instead.
+
+
Modified -[ASCollectionView reloadSections:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode method instead.
+
+
Modified -[ASCollectionView moveSection:toSection:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode method instead.
+
+
Modified -[ASCollectionView insertItemsAtIndexPaths:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode method instead.
+
+
Modified -[ASCollectionView deleteItemsAtIndexPaths:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode method instead.
+
+
Modified -[ASCollectionView reloadItemsAtIndexPaths:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode method instead.
+
+
Modified ASCollectionDataSource
+ + + + +
HeaderProtocols
FromASCollectionView.hASCommonCollectionViewDataSource
ToASCollectionNode.hASCommonCollectionDataSource
+
+
Modified -[ASCollectionView moveItemAtIndexPath:toIndexPath:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode method instead.
+
+
Modified -[ASCollectionView calculatedSizeForNodeAtIndexPath:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedCall -calculatedSize on the node of interest instead.
+
+
Modified -[ASCollectionView visibleNodes]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode method instead.
+
+
Modified -[ASCollectionView indexPathForNode:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode method instead.
+
+
Modified ASCollectionDelegate
+ + + + +
HeaderProtocols
FromASCollectionView.hASCommonCollectionViewDelegate, NSObject
ToASCollectionNode.hASCommonCollectionDelegate, NSObject
+
+
+ +
+ +
+
ASCollectionViewFlowLayoutInspector.h
+ +
+
Added -[ASCollectionViewLayoutInspecting scrollableDirections]
+
+ + +
+
Modified -[ASCollectionViewLayoutInspecting collectionView:numberOfSectionsForSupplementaryNodeOfKind:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASCollectionNode's method instead.
+
+
+ +
+ +
+
ASCollectionViewProtocols.h
+ +
+
Removed ASCommonCollectionViewDataSource
+
Removed -[ASCommonCollectionViewDataSource collectionView:numberOfItemsInSection:]
+
Removed -[ASCommonCollectionViewDataSource numberOfSectionsInCollectionView:]
+
Removed -[ASCommonCollectionViewDataSource collectionView:viewForSupplementaryElementOfKind:atIndexPath:]
+
Removed ASCommonCollectionViewDelegate
+
Removed -[ASCommonCollectionViewDelegate collectionView:transitionLayoutForOldLayout:newLayout:]
+
Removed -[ASCommonCollectionViewDelegate collectionView:willDisplaySupplementaryView:forElementKind:atIndexPath:]
+
Removed -[ASCommonCollectionViewDelegate collectionView:didEndDisplayingSupplementaryView:forElementOfKind:atIndexPath:]
+
Removed -[ASCommonCollectionViewDelegate collectionView:shouldHighlightItemAtIndexPath:]
+
Removed -[ASCommonCollectionViewDelegate collectionView:didHighlightItemAtIndexPath:]
+
Removed -[ASCommonCollectionViewDelegate collectionView:didUnhighlightItemAtIndexPath:]
+
Removed -[ASCommonCollectionViewDelegate collectionView:shouldSelectItemAtIndexPath:]
+
Removed -[ASCommonCollectionViewDelegate collectionView:didSelectItemAtIndexPath:]
+
Removed -[ASCommonCollectionViewDelegate collectionView:shouldDeselectItemAtIndexPath:]
+
Removed -[ASCommonCollectionViewDelegate collectionView:didDeselectItemAtIndexPath:]
+
Removed -[ASCommonCollectionViewDelegate collectionView:shouldShowMenuForItemAtIndexPath:]
+
Removed -[ASCommonCollectionViewDelegate collectionView:canPerformAction:forItemAtIndexPath:withSender:]
+
Removed -[ASCommonCollectionViewDelegate collectionView:performAction:forItemAtIndexPath:withSender:]
+
+ + +
+
Added ASCommonCollectionDataSource
+
Added -[ASCommonCollectionDataSource collectionView:numberOfItemsInSection:]
+
Added -[ASCommonCollectionDataSource numberOfSectionsInCollectionView:]
+
Added -[ASCommonCollectionDataSource collectionView:viewForSupplementaryElementOfKind:atIndexPath:]
+
Added ASCommonCollectionDelegate
+
Added -[ASCommonCollectionDelegate collectionView:transitionLayoutForOldLayout:newLayout:]
+
Added -[ASCommonCollectionDelegate collectionView:willDisplaySupplementaryView:forElementKind:atIndexPath:]
+
Added -[ASCommonCollectionDelegate collectionView:didEndDisplayingSupplementaryView:forElementOfKind:atIndexPath:]
+
Added -[ASCommonCollectionDelegate collectionView:shouldHighlightItemAtIndexPath:]
+
Added -[ASCommonCollectionDelegate collectionView:didHighlightItemAtIndexPath:]
+
Added -[ASCommonCollectionDelegate collectionView:didUnhighlightItemAtIndexPath:]
+
Added -[ASCommonCollectionDelegate collectionView:shouldSelectItemAtIndexPath:]
+
Added -[ASCommonCollectionDelegate collectionView:didSelectItemAtIndexPath:]
+
Added -[ASCommonCollectionDelegate collectionView:shouldDeselectItemAtIndexPath:]
+
Added -[ASCommonCollectionDelegate collectionView:didDeselectItemAtIndexPath:]
+
Added -[ASCommonCollectionDelegate collectionView:shouldShowMenuForItemAtIndexPath:]
+
Added -[ASCommonCollectionDelegate collectionView:canPerformAction:forItemAtIndexPath:withSender:]
+
Added -[ASCommonCollectionDelegate collectionView:performAction:forItemAtIndexPath:withSender:]
+
+ +
+ +
+
ASDataController.h
+ +
+
Added -[ASDataController initWithDataSource:]
+
Added -[ASDataController completedNumberOfSections]
+
Added -[ASDataController completedNumberOfRowsInSection:]
+
Added -[ASDataController nodeAtCompletedIndexPath:]
+
Added -[ASDataController completedIndexPathForNode:]
+
Added -[ASDataController moveCompletedNodeAtIndexPath:toIndexPath:]
+
+ +
+ +
+
ASDimension.h
+ +
+
Removed ASRelativeDimensionTypePercent
+
Removed ASRelativeDimension
+
Removed ASRelativeDimensionUnconstrained
+
Removed #def isValidForLayout
+
Removed ASRelativeDimensionMakeWithPoints()
+
Removed ASRelativeDimensionMakeWithPercent()
+
Removed ASRelativeDimensionCopy()
+
Removed ASRelativeDimensionEqualToRelativeDimension()
+
Removed NSStringFromASRelativeDimension()
+
Removed ASRelativeDimensionResolve()
+
+ + +
+
Added ASPointsValidForLayout()
+
Added ASIsCGSizeValidForLayout()
+
Added ASPointsValidForSize()
+
Added ASIsCGSizeValidForSize()
+
Added ASDimensionUnit
+
Added ASDimensionUnitAuto
+
Added ASDimensionUnitPoints
+
Added ASDimensionUnitFraction
+
Added ASDimension
+
Added ASLayoutElementSize
+
Added ASDimensionAuto
+
Added ASDimensionMake()
+
Added ASDimensionMakeWithPoints()
+
Added ASDimensionMakeWithFraction()
+
Added ASDimensionEqualToDimension()
+
Added NSStringFromASDimension()
+
Added ASDimensionResolve()
+
Added NSNumber (ASDimension)
+
Added NSNumber.as_pointDimension
+
Added NSNumber.as_fractionDimension
+
Added ASLayoutSize
+
Added ASLayoutSizeAuto
+
Added ASLayoutSizeMake()
+
Added NSStringFromASLayoutSize()
+
Added ASLayoutElementSizeMake()
+
Added ASLayoutElementSizeMakeFromCGSize()
+
Added ASLayoutElementSizeEqualToLayoutElementSize()
+
Added NSStringFromASLayoutElementSize()
+
Added ASLayoutElementSizeResolveAutoSize()
+
Added ASLayoutElementSizeResolve()
+
Added ASRelativeDimensionTypeAuto
+
Added ASRelativeDimensionTypeFraction
+
Added #def ASRelativeDimension
+
Added #def ASRelativeSize
+
Added #def ASRelativeDimensionMakeWithPoints
+
Added #def ASRelativeDimensionMakeWithFraction
+
Added ASRelativeSizeMakeWithFraction()
+
Added ASRelativeSizeRangeMakeWithExactFraction()
+
+ + +
+
Modified ASSizeRangeMakeExactSize()
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASSizeRangeMake instead.
+
+
Modified ASRelativeSizeRange
+ + + + +
Header
FromASRelativeSize.h
ToASDimension.h
+
+
Modified ASRelativeSizeRangeUnconstrained
+ + + + +
Header
FromASRelativeSize.h
ToASDimension.h
+
+
Modified ASRelativeDimensionMake()
+ + + + +
Availability
FromAvailable
ToDeprecated
+
+
Modified ASRelativeSizeMake()
+ + + + +
HeaderAvailability
FromASRelativeSize.hAvailable
ToASDimension.hDeprecated
+
+
Modified ASRelativeSizeMakeWithCGSize()
+ + + + +
HeaderAvailability
FromASRelativeSize.hAvailable
ToASDimension.hDeprecated
+
+
Modified ASRelativeSizeEqualToRelativeSize()
+ + + + +
HeaderAvailability
FromASRelativeSize.hAvailable
ToASDimension.hDeprecated
+
+
Modified NSStringFromASRelativeSize()
+ + + + +
HeaderAvailability
FromASRelativeSize.hAvailable
ToASDimension.hDeprecated
+
+
Modified ASRelativeSizeRangeMake()
+ + + + +
HeaderAvailability
FromASRelativeSize.hAvailable
ToASDimension.hDeprecated
+
+
Modified ASRelativeSizeRangeMakeWithExactRelativeSize()
+ + + + +
HeaderAvailability
FromASRelativeSize.hAvailable
ToASDimension.hDeprecated
+
+
Modified ASRelativeSizeRangeMakeWithExactCGSize()
+ + + + +
HeaderAvailability
FromASRelativeSize.hAvailable
ToASDimension.hDeprecated
+
+
Modified ASRelativeSizeRangeMakeWithExactRelativeDimensions()
+ + + + +
HeaderAvailability
FromASRelativeSize.hAvailable
ToASDimension.hDeprecated
+
+
Modified ASRelativeSizeRangeEqualToRelativeSizeRange()
+ + + + +
HeaderAvailability
FromASRelativeSize.hAvailable
ToASDimension.hDeprecated
+
+
Modified ASRelativeSizeRangeResolve()
+ + + + +
HeaderAvailability
FromASRelativeSize.hAvailable
ToASDimension.hDeprecated
+
+
+ +
+ +
+
ASDisplayNode.h
+ +
+
Removed ASInterfaceStateFetchData
+
Removed -[ASDisplayNode measureWithSizeRange:]
+
Removed ASDisplayNode (ASDisplayNodeAsyncTransactionContainer)
+
Removed -[ASDisplayNode reclaimMemory]
+
Removed -[ASDisplayNode recursivelyReclaimMemory]
+
Removed ASDisplayNode.placeholderFadesOut
+
+ + +
+
Added ASInterfaceStatePreload
+
Added -[ASDisplayNode onDidLoad:]
+
Added ASDisplayNode.visible
+
Added ASDisplayNode.inPreloadState
+
Added ASDisplayNode.inDisplayState
+
Added -[ASDisplayNode layoutThatFits:]
+
Added ASDisplayNode.allowsGroupOpacity
+
Added ASDisplayNode (LayoutTransitioning)
+
Added ASDisplayNode.defaultLayoutTransitionDuration
+
Added ASDisplayNode.defaultLayoutTransitionDelay
+
Added ASDisplayNode.defaultLayoutTransitionOptions
+
Added -[ASDisplayNode cancelLayoutTransition]
+
Added ASDisplayNode (AutomaticSubnodeManagement)
+
Added ASDisplayNode.automaticallyManagesSubnodes
+
Added ASDisplayNode (ASAsyncTransactionContainer)
+
+ + +
+
Modified ASDisplayNode
+ + + + +
Protocols
FromASLayoutable
ToASLayoutElement
+
+
Modified ASDisplayNode (Debugging)
+ + + + +
Protocols
FromASLayoutableAsciiArtProtocol
ToASLayoutElementAsciiArtProtocol
+
+
Modified ASDisplayNode (Deprecated)
+ + + + +
Header
FromASDisplayNode.h
ToASDisplayNode+Deprecated.h
+
+
+ +
+ +
+
ASDisplayNode+Beta.h
+ +
+
Removed +[ASDisplayNode usesImplicitHierarchyManagement]
+
Removed +[ASDisplayNode setUsesImplicitHierarchyManagement:]
+
+ + +
+
Added #def ASDISPLAYNODE_EVENTLOG_CAPACITY
+
Added #def ASDISPLAYNODE_EVENTLOG_ENABLE
+
Added #def ASDisplayNodeLogEvent
+
Added ASDisplayNodePerformanceMeasurementOptions
+
Added ASDisplayNodePerformanceMeasurementOptionLayoutSpec
+
Added ASDisplayNodePerformanceMeasurementOptionLayoutComputation
+
Added ASDisplayNodePerformanceMeasurements
+
Added ASDisplayNode.measurementOptions
+
Added ASDisplayNode.performanceMeasurements
+
+ +
+ +
+
ASDisplayNode+Deprecated.h
+ +
+
Added ASDisplayNode.alignSelf
+
Added ASDisplayNode.ascender
+
Added ASDisplayNode.descender
+
Added ASDisplayNode.flexBasis
+
Added ASDisplayNode.flexGrow
+
Added ASDisplayNode.flexShrink
+
Added ASDisplayNode.layoutPosition
+
Added ASDisplayNode.sizeRange
+
Added ASDisplayNode.spacingAfter
+
Added ASDisplayNode.spacingBefore
+
+ + +
+
Modified ASDisplayNode (Deprecated)
+ + + + +
Header
FromASDisplayNode.h
ToASDisplayNode+Deprecated.h
+
+
Modified ASDisplayNode.name
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse .debugName instead.
+
+
Modified ASDisplayNode.preferredFrameSize
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse .style.preferredSize instead OR set individual values with .style.height and .style.width.
+
+
Modified -[ASDisplayNode measure:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse layoutThatFits: with a constrained size of (CGSizeZero, constrainedSize) and call size on the returned ASLayout.
+
+
Modified -[ASDisplayNode visibilityDidChange:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse -didEnterVisibleState / -didExitVisibleState instead.
+
+
Modified -[ASDisplayNode visibleStateDidChange:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse -didEnterVisibleState / -didExitVisibleState instead.
+
+
Modified -[ASDisplayNode displayStateDidChange:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse -didEnterDisplayState / -didExitDisplayState instead.
+
+
Modified -[ASDisplayNode loadStateDidChange:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse -didEnterPreloadState / -didExitPreloadState instead.
+
+
Modified -[ASDisplayNode cancelLayoutTransitionsInProgress]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse -cancelLayoutTransition instead.
+
+
Modified ASDisplayNode.usesImplicitHierarchyManagement
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedSet .automaticallyManagesSubnodes instead.
+
+
+ +
+ +
+
ASDisplayNode+Subclasses.h
+ +
+
Added -[ASDisplayNode calculateLayoutThatFits:restrictedToSize:relativeToParentSize:]
+
Added -[ASDisplayNode displayWillStartAsynchronously:]
+
Added -[ASDisplayNode didEnterVisibleState]
+
Added -[ASDisplayNode didExitVisibleState]
+
Added -[ASDisplayNode didEnterDisplayState]
+
Added -[ASDisplayNode didExitDisplayState]
+
Added -[ASDisplayNode didEnterPreloadState]
+
Added -[ASDisplayNode didExitPreloadState]
+
+ +
+ +
+
ASDisplayNodeExtras.h
+ +
+
Removed ASInterfaceStateIncludesFetchData()
+
+ + +
+
Added ASInterfaceStateIncludesPreload()
+
+ +
+ +
+
ASEditableTextNode.h
+ +
+
Added ASEditableTextNode (Unavailable)
+
+ +
+ +
+
ASEnvironment.h
+ +
+
Removed -[ASEnvironment supportsUpwardPropagation]
+
+ + +
+
Added NSStringFromASEnvironmentTraitCollection()
+
+ +
+ +
+
ASImageNode.h
+ +
+
Added ASImageNode.forcedSize
+
Added ASImageNode (Unavailable)
+
+ +
+ +
+
ASImageProtocols.h
+ +
+
Removed ASImageDownloaderProtocolDeprecated
+
Removed -[ASImageDownloaderProtocolDeprecated downloadImageWithURL:callbackQueue:downloadProgressBlock:completion:]
+
Removed ASImageCacheProtocolDeprecated
+
Removed -[ASImageCacheProtocolDeprecated fetchCachedImageWithURL:callbackQueue:completion:]
+
+ +
+ +
+
ASLayout.h
+ +
+
Removed ASLayout.constrainedSizeRange
+
Removed ASLayout.dirty
+
Removed -[ASLayout initWithLayoutableObject:constrainedSizeRange:size:position:sublayouts:]
+
Removed +[ASLayout layoutWithLayoutableObject:constrainedSizeRange:size:position:sublayouts:]
+
Removed +[ASLayout flattenedLayoutWithLayoutableObject:constrainedSizeRange:size:sublayouts:]
+
+ + +
+
Added ASCalculateRootLayout()
+
Added ASCalculateLayout()
+
Added ASLayout.layoutElement
+
Added -[ASLayout initWithLayoutElement:size:position:sublayouts:]
+
Added +[ASLayout layoutWithLayoutElement:size:position:sublayouts:]
+
Added +[ASLayout layoutWithLayoutElement:size:sublayouts:]
+
Added +[ASLayout layoutWithLayoutElement:size:]
+
Added ASLayout (Unavailable)
+
Added ASLayout (Deprecated)
+
+ + +
+
Modified -[ASLayout layoutableObject]
+ + + + +
Availability
FromAvailable
ToDeprecated
+
+
Modified +[ASLayout layoutWithLayoutableObject:constrainedSizeRange:size:]
+ + + + +
Availability
FromAvailable
ToDeprecated
+
+
Modified +[ASLayout layoutWithLayoutableObject:constrainedSizeRange:size:sublayouts:]
+ + + + +
Availability
FromAvailable
ToDeprecated
+
+
+ +
+ +
+
ASLayoutable.h
+ +
+
Removed ASLayoutableType
+
Removed ASLayoutableTypeLayoutSpec
+
Removed ASLayoutableTypeDisplayNode
+
Removed ASLayoutable
+
Removed ASLayoutable.layoutableType
+
Removed ASLayoutable.canLayoutAsynchronous
+
Removed -[ASLayoutable measureWithSizeRange:]
+
Removed ASLayoutable.spacingBefore
+
Removed ASLayoutable.spacingAfter
+
Removed ASLayoutable.flexGrow
+
Removed ASLayoutable.flexShrink
+
Removed ASLayoutable.flexBasis
+
Removed ASLayoutable.alignSelf
+
Removed ASLayoutable.ascender
+
Removed ASLayoutable.descender
+
Removed ASLayoutable.sizeRange
+
Removed ASLayoutable.layoutPosition
+
+ +
+ +
+
ASLayoutableExtensibility.h
+ +
+
Removed ASLayoutableExtensibility
+
Removed -[ASLayoutableExtensibility setLayoutOptionExtensionBool:atIndex:]
+
Removed -[ASLayoutableExtensibility layoutOptionExtensionBoolAtIndex:]
+
Removed -[ASLayoutableExtensibility setLayoutOptionExtensionInteger:atIndex:]
+
Removed -[ASLayoutableExtensibility layoutOptionExtensionIntegerAtIndex:]
+
Removed -[ASLayoutableExtensibility setLayoutOptionExtensionEdgeInsets:atIndex:]
+
Removed -[ASLayoutableExtensibility layoutOptionExtensionEdgeInsetsAtIndex:]
+
+ +
+ +
+
ASLayoutablePrivate.h
+ +
+
Removed ASLayoutableContextInvalidTransitionID
+
Removed ASLayoutableContextDefaultTransitionID
+
Removed ASLayoutableContextNull
+
Removed ASLayoutableContextIsNull()
+
Removed ASLayoutableContextMake()
+
Removed ASLayoutableSetCurrentContext()
+
Removed ASLayoutableGetCurrentContext()
+
Removed ASLayoutableClearCurrentContext()
+
Removed ASLayoutablePrivate
+
Removed -[ASLayoutablePrivate finalLayoutable]
+
Removed ASLayoutablePrivate.isFinalLayoutable
+
Removed #def ASEnvironmentLayoutOptionsForwarding
+
+ + +
+
Modified #def ASEnvironmentLayoutExtensibilityForwarding
+ + + + +
Header
FromASLayoutablePrivate.h
ToASLayoutElementPrivate.h
+
+
+ +
+ +
+
ASLayoutElement.h
+ +
+
Added ASLayoutElementParentDimensionUndefined
+
Added ASLayoutElementParentSizeUndefined
+
Added ASLayoutElementType
+
Added ASLayoutElementTypeLayoutSpec
+
Added ASLayoutElementTypeDisplayNode
+
Added ASLayoutElement
+
Added ASLayoutElement.layoutElementType
+
Added ASLayoutElement.canLayoutAsynchronous
+
Added ASLayoutElement.style
+
Added ASLayoutElement.debugName
+
Added -[ASLayoutElement layoutThatFits:]
+
Added -[ASLayoutElement layoutThatFits:parentSize:]
+
Added -[ASLayoutElement calculateLayoutThatFits:]
+
Added -[ASLayoutElement calculateLayoutThatFits:restrictedToSize:relativeToParentSize:]
+
Added -[ASLayoutElement measureWithSizeRange:]
+
Added ASLayoutElementStyleWidthProperty
+
Added ASLayoutElementStyleMinWidthProperty
+
Added ASLayoutElementStyleMaxWidthProperty
+
Added ASLayoutElementStyleHeightProperty
+
Added ASLayoutElementStyleMinHeightProperty
+
Added ASLayoutElementStyleMaxHeightProperty
+
Added ASLayoutElementStyleSpacingBeforeProperty
+
Added ASLayoutElementStyleSpacingAfterProperty
+
Added ASLayoutElementStyleFlexGrowProperty
+
Added ASLayoutElementStyleFlexShrinkProperty
+
Added ASLayoutElementStyleFlexBasisProperty
+
Added ASLayoutElementStyleAlignSelfProperty
+
Added ASLayoutElementStyleAscenderProperty
+
Added ASLayoutElementStyleDescenderProperty
+
Added ASLayoutElementStyleLayoutPositionProperty
+
Added ASLayoutElementStyleDelegate
+
Added -[ASLayoutElementStyleDelegate style:propertyDidChange:]
+
Added ASLayoutElementStyle
+
Added -[ASLayoutElementStyle initWithDelegate:]
+
Added ASLayoutElementStyle.delegate
+
Added ASLayoutElementStyle.width
+
Added ASLayoutElementStyle.height
+
Added ASLayoutElementStyle.minHeight
+
Added ASLayoutElementStyle.maxHeight
+
Added ASLayoutElementStyle.minWidth
+
Added ASLayoutElementStyle.maxWidth
+
Added ASLayoutElementStyle.preferredSize
+
Added ASLayoutElementStyle.minSize
+
Added ASLayoutElementStyle.maxSize
+
Added ASLayoutElementStyle.preferredLayoutSize
+
Added ASLayoutElementStyle.minLayoutSize
+
Added ASLayoutElementStyle.maxLayoutSize
+
Added ASLayoutElementStylability
+
Added -[ASLayoutElementStylability styledWithBlock:]
+
+ +
+ +
+
ASLayoutElementExtensibility.h
+ +
+
Added ASLayoutElementExtensibility
+
Added -[ASLayoutElementExtensibility setLayoutOptionExtensionBool:atIndex:]
+
Added -[ASLayoutElementExtensibility layoutOptionExtensionBoolAtIndex:]
+
Added -[ASLayoutElementExtensibility setLayoutOptionExtensionInteger:atIndex:]
+
Added -[ASLayoutElementExtensibility layoutOptionExtensionIntegerAtIndex:]
+
Added -[ASLayoutElementExtensibility setLayoutOptionExtensionEdgeInsets:atIndex:]
+
Added -[ASLayoutElementExtensibility layoutOptionExtensionEdgeInsetsAtIndex:]
+
+ +
+ +
+
ASLayoutElementPrivate.h
+ +
+
Added ASLayoutElementContextInvalidTransitionID
+
Added ASLayoutElementContextDefaultTransitionID
+
Added ASLayoutElementContextNull
+
Added ASLayoutElementContextIsNull()
+
Added ASLayoutElementContextMake()
+
Added ASLayoutElementSetCurrentContext()
+
Added ASLayoutElementGetCurrentContext()
+
Added ASLayoutElementClearCurrentContext()
+
Added ASLayoutElementPrivate
+
Added -[ASLayoutElementPrivate finalLayoutElement]
+
Added ASLayoutElementPrivate.isFinalLayoutElement
+
Added #def ASLayoutElementStyleForwardingDeclaration
+
Added #def ASLayoutElementStyleForwarding
+
+ + +
+
Modified #def ASEnvironmentLayoutExtensibilityForwarding
+ + + + +
Header
FromASLayoutablePrivate.h
ToASLayoutElementPrivate.h
+
+
+ +
+ +
+
ASLayoutRangeType.h
+ +
+
Removed ASLayoutRangeTypeFetchData
+
+ + +
+
Added ASLayoutRangeTypePreload
+
+ +
+ +
+
ASLayoutSpec.h
+ +
+
Removed -[ASLayoutSpec init]
+
Removed -[ASLayoutSpec setChild:forIndex:]
+
Removed -[ASLayoutSpec childForIndex:]
+
+ + +
+
Added ASWrapperLayoutSpec
+
Added +[ASWrapperLayoutSpec wrapperWithLayoutElement:]
+
Added +[ASWrapperLayoutSpec wrapperWithLayoutElements:]
+
Added -[ASWrapperLayoutSpec initWithLayoutElement:]
+
Added -[ASWrapperLayoutSpec initWithLayoutElements:]
+
Added ASLayoutSpec (Deprecated)
+
Added ASLayoutSpec.alignSelf
+
Added ASLayoutSpec.ascender
+
Added ASLayoutSpec.descender
+
Added ASLayoutSpec.flexBasis
+
Added ASLayoutSpec.flexGrow
+
Added ASLayoutSpec.flexShrink
+
Added ASLayoutSpec.layoutPosition
+
Added ASLayoutSpec.sizeRange
+
Added ASLayoutSpec.spacingAfter
+
Added ASLayoutSpec.spacingBefore
+
+ + +
+
Modified ASLayoutSpec
+ + + + +
Protocols
FromASLayoutable
ToASLayoutElement
+
+
Modified ASLayoutSpec (Debugging)
+ + + + +
Protocols
FromASLayoutableAsciiArtProtocol
ToASLayoutElementAsciiArtProtocol
+
+
+ +
+ +
+
ASLog.h
+ +
+
Added #def ASProfilingSignpost
+
Added #def ASProfilingSignpostStart
+
Added #def ASProfilingSignpostEnd
+
+ +
+ +
+
ASMapNode.h
+ +
+
Added ASMapNode.imageForStaticMapAnnotationBlock
+
+ +
+ +
+
ASObjectDescriptionHelpers.h
+ +
+
Added ASDebugDescriptionProvider
+
Added -[ASDebugDescriptionProvider propertiesForDebugDescription]
+
Added ASDescriptionProvider
+
Added -[ASDescriptionProvider propertiesForDescription]
+
Added ASObjectDescriptionMakeWithoutObject()
+
Added ASObjectDescriptionMake()
+
Added ASObjectDescriptionMakeTiny()
+
Added ASStringWithQuotesIfMultiword()
+
+ +
+ +
+
ASPagerNode.h
+ +
+
Removed -[ASPagerDataSource pagerNode:constrainedSizeForNodeAtIndexPath:]
+
+ + +
+
Added -[ASPagerDelegate pagerNode:constrainedSizeForNodeAtIndex:]
+
+ +
+ +
+
ASRangeController.h
+ +
+
Added -[ASRangeControllerDataSource nameForRangeControllerDataSource]
+
+ +
+ +
+
ASRelativeLayoutSpec.h
+ +
+
Added ASRelativeLayoutSpecPositionNone
+
+ +
+ +
+
ASRelativeSize.h
+ +
+
Removed ASRelativeSize
+
Removed ASRelativeSizeMakeWithPercent()
+
Removed ASRelativeSizeResolveSize()
+
Removed ASRelativeSizeRangeMakeWithExactPercent()
+
+ + +
+
Modified ASRelativeSizeRange
+ + + + +
Header
FromASRelativeSize.h
ToASDimension.h
+
+
Modified ASRelativeSizeRangeUnconstrained
+ + + + +
Header
FromASRelativeSize.h
ToASDimension.h
+
+
Modified ASRelativeSizeMake()
+ + + + +
HeaderAvailability
FromASRelativeSize.hAvailable
ToASDimension.hDeprecated
+
+
Modified ASRelativeSizeMakeWithCGSize()
+ + + + +
HeaderAvailability
FromASRelativeSize.hAvailable
ToASDimension.hDeprecated
+
+
Modified ASRelativeSizeEqualToRelativeSize()
+ + + + +
HeaderAvailability
FromASRelativeSize.hAvailable
ToASDimension.hDeprecated
+
+
Modified NSStringFromASRelativeSize()
+ + + + +
HeaderAvailability
FromASRelativeSize.hAvailable
ToASDimension.hDeprecated
+
+
Modified ASRelativeSizeRangeMake()
+ + + + +
HeaderAvailability
FromASRelativeSize.hAvailable
ToASDimension.hDeprecated
+
+
Modified ASRelativeSizeRangeMakeWithExactRelativeSize()
+ + + + +
HeaderAvailability
FromASRelativeSize.hAvailable
ToASDimension.hDeprecated
+
+
Modified ASRelativeSizeRangeMakeWithExactCGSize()
+ + + + +
HeaderAvailability
FromASRelativeSize.hAvailable
ToASDimension.hDeprecated
+
+
Modified ASRelativeSizeRangeMakeWithExactRelativeDimensions()
+ + + + +
HeaderAvailability
FromASRelativeSize.hAvailable
ToASDimension.hDeprecated
+
+
Modified ASRelativeSizeRangeEqualToRelativeSizeRange()
+ + + + +
HeaderAvailability
FromASRelativeSize.hAvailable
ToASDimension.hDeprecated
+
+
Modified ASRelativeSizeRangeResolve()
+ + + + +
HeaderAvailability
FromASRelativeSize.hAvailable
ToASDimension.hDeprecated
+
+
+ +
+ +
+
ASRunLoopQueue.h
+ +
+
Added ASRunLoopQueue.ensureExclusiveMembership
+
Added ASDeallocQueue
+
Added +[ASDeallocQueue sharedDeallocationQueue]
+
Added -[ASDeallocQueue releaseObjectInBackground:]
+
+ +
+ +
+
ASSectionContext.h
+ +
+
Added ASSectionContext
+
Added ASSectionContext.sectionName
+
Added ASSectionContext.collectionView
+
+ +
+ +
+
ASStackLayoutable.h
+ +
+
Removed ASStackLayoutable
+
Removed ASStackLayoutable.spacingBefore
+
Removed ASStackLayoutable.spacingAfter
+
Removed ASStackLayoutable.flexGrow
+
Removed ASStackLayoutable.flexShrink
+
Removed ASStackLayoutable.flexBasis
+
Removed ASStackLayoutable.alignSelf
+
Removed ASStackLayoutable.ascender
+
Removed ASStackLayoutable.descender
+
+ +
+ +
+
ASStackLayoutElement.h
+ +
+
Added ASStackLayoutElement
+
Added ASStackLayoutElement.spacingBefore
+
Added ASStackLayoutElement.spacingAfter
+
Added ASStackLayoutElement.flexGrow
+
Added ASStackLayoutElement.flexShrink
+
Added ASStackLayoutElement.flexBasis
+
Added ASStackLayoutElement.alignSelf
+
Added ASStackLayoutElement.ascender
+
Added ASStackLayoutElement.descender
+
+ +
+ +
+
ASStaticLayoutable.h
+ +
+
Removed ASStaticLayoutable
+
Removed ASStaticLayoutable.sizeRange
+
Removed ASStaticLayoutable.layoutPosition
+
+ +
+ +
+
ASStaticLayoutSpec.h
+ +
+
Modified ASStaticLayoutSpec
+ + + + +
HeaderSuperclass
FromASStaticLayoutSpec.hASLayoutSpec
ToASAbsoluteLayoutSpec.hASAbsoluteLayoutSpec
+
+
+ +
+ +
+
ASTableNode.h
+ +
+
Added ASTableNode.allowsSelection
+
Added ASTableNode.allowsSelectionDuringEditing
+
Added ASTableNode.allowsMultipleSelection
+
Added ASTableNode.allowsMultipleSelectionDuringEditing
+
Added -[ASTableNode tuningParametersForRangeType:]
+
Added -[ASTableNode setTuningParameters:forRangeType:]
+
Added -[ASTableNode tuningParametersForRangeMode:rangeType:]
+
Added -[ASTableNode setTuningParameters:forRangeMode:rangeType:]
+
Added -[ASTableNode scrollToRowAtIndexPath:atScrollPosition:animated:]
+
Added -[ASTableNode reloadDataWithCompletion:]
+
Added -[ASTableNode reloadData]
+
Added -[ASTableNode relayoutItems]
+
Added -[ASTableNode performBatchAnimated:updates:completion:]
+
Added -[ASTableNode performBatchUpdates:completion:]
+
Added -[ASTableNode waitUntilAllUpdatesAreCommitted]
+
Added -[ASTableNode insertSections:withRowAnimation:]
+
Added -[ASTableNode deleteSections:withRowAnimation:]
+
Added -[ASTableNode reloadSections:withRowAnimation:]
+
Added -[ASTableNode moveSection:toSection:]
+
Added -[ASTableNode insertRowsAtIndexPaths:withRowAnimation:]
+
Added -[ASTableNode deleteRowsAtIndexPaths:withRowAnimation:]
+
Added -[ASTableNode reloadRowsAtIndexPaths:withRowAnimation:]
+
Added -[ASTableNode moveRowAtIndexPath:toIndexPath:]
+
Added -[ASTableNode selectRowAtIndexPath:animated:scrollPosition:]
+
Added -[ASTableNode deselectRowAtIndexPath:animated:]
+
Added -[ASTableNode numberOfRowsInSection:]
+
Added ASTableNode.numberOfSections
+
Added ASTableNode.visibleNodes
+
Added -[ASTableNode nodeForRowAtIndexPath:]
+
Added -[ASTableNode indexPathForNode:]
+
Added -[ASTableNode rectForRowAtIndexPath:]
+
Added -[ASTableNode cellForRowAtIndexPath:]
+
Added ASTableNode.indexPathForSelectedRow
+
Added ASTableNode.indexPathsForSelectedRows
+
Added -[ASTableNode indexPathForRowAtPoint:]
+
Added -[ASTableNode indexPathsForRowsInRect:]
+
Added -[ASTableNode indexPathsForVisibleRows]
+
Added -[ASTableDataSource numberOfSectionsInTableNode:]
+
Added -[ASTableDataSource tableNode:numberOfRowsInSection:]
+
Added -[ASTableDataSource tableNode:nodeBlockForRowAtIndexPath:]
+
Added -[ASTableDataSource tableNode:nodeForRowAtIndexPath:]
+
Added -[ASTableDelegate tableNode:willDisplayRowWithNode:]
+
Added -[ASTableDelegate tableNode:didEndDisplayingRowWithNode:]
+
Added -[ASTableDelegate tableNode:willSelectRowAtIndexPath:]
+
Added -[ASTableDelegate tableNode:didSelectRowAtIndexPath:]
+
Added -[ASTableDelegate tableNode:willDeselectRowAtIndexPath:]
+
Added -[ASTableDelegate tableNode:didDeselectRowAtIndexPath:]
+
Added -[ASTableDelegate tableNode:shouldHighlightRowAtIndexPath:]
+
Added -[ASTableDelegate tableNode:didHighlightRowAtIndexPath:]
+
Added -[ASTableDelegate tableNode:didUnhighlightRowAtIndexPath:]
+
Added -[ASTableDelegate tableNode:shouldShowMenuForRowAtIndexPath:]
+
Added -[ASTableDelegate tableNode:canPerformAction:forRowAtIndexPath:withSender:]
+
Added -[ASTableDelegate tableNode:performAction:forRowAtIndexPath:withSender:]
+
Added -[ASTableDelegate tableNode:constrainedSizeForRowAtIndexPath:]
+
Added -[ASTableDelegate tableNode:willBeginBatchFetchWithContext:]
+
Added -[ASTableDelegate shouldBatchFetchForTableNode:]
+
Added -[ASTableDelegate tableView:willDisplayNode:forRowAtIndexPath:]
+
+ + +
+
Modified ASTableDataSource
+ + + + +
HeaderProtocols
FromASTableView.hASCommonTableViewDataSource, NSObject
ToASTableNode.hASCommonTableDataSource, NSObject
+
+
Modified -[ASTableDataSource tableView:nodeForRowAtIndexPath:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode's method instead.
+
+
Modified -[ASTableDataSource tableView:nodeBlockForRowAtIndexPath:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode's method instead.
+
+
Modified ASTableDelegate
+ + + + +
Header
FromASTableView.h
ToASTableNode.h
+
+
Modified -[ASTableDelegate tableView:didEndDisplayingNode:forRowAtIndexPath:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode's method instead.
+
+
Modified -[ASTableDelegate tableView:willBeginBatchFetchWithContext:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode's method instead.
+
+
Modified -[ASTableDelegate shouldBatchFetchForTableView:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode's method instead.
+
+
Modified -[ASTableDelegate tableView:constrainedSizeForRowAtIndexPath:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode's method instead.
+
+
Modified -[ASTableDelegate tableView:willDisplayNodeForRowAtIndexPath:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode's method instead.
+
+
+ +
+ +
+
ASTableView.h
+ +
+
Removed -[ASTableDelegate tableView:didEndDisplayingNodeForRowAtIndexPath:]
+
Removed -[ASTableView initWithFrame:style:asyncDataFetching:]
+
+ + +
+
Added ASTableView.tableNode
+
Added -[ASTableView cellForRowAtIndexPath:]
+
Added -[ASTableView scrollToRowAtIndexPath:atScrollPosition:animated:]
+
Added -[ASTableView selectRowAtIndexPath:animated:scrollPosition:]
+
Added ASTableView.indexPathForSelectedRow
+
Added ASTableView.indexPathsForSelectedRows
+
Added ASTableView.indexPathsForVisibleRows
+
Added -[ASTableView indexPathForRowAtPoint:]
+
Added -[ASTableView indexPathsForRowsInRect:]
+
+ + +
+
Modified -[ASTableView initWithFrame:style:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedPlease use ASTableNode instead of ASTableView.
+
+
Modified -[ASTableView tuningParametersForRangeType:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode method instead.
+
+
Modified -[ASTableView setTuningParameters:forRangeType:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode method instead.
+
+
Modified -[ASTableView tuningParametersForRangeMode:rangeType:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode method instead.
+
+
Modified -[ASTableView setTuningParameters:forRangeMode:rangeType:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode method instead.
+
+
Modified -[ASTableView visibleNodes]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode method instead.
+
+
Modified -[ASTableView indexPathForNode:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode method instead.
+
+
Modified -[ASTableView reloadDataWithCompletion:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode method instead.
+
+
Modified -[ASTableView reloadData]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode method instead.
+
+
Modified -[ASTableView reloadDataImmediately]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode's reloadDataWithCompletion: followed by ASTableNode's -waitUntilAllUpdatesAreCommitted instead.
+
+
Modified -[ASTableView relayoutItems]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode method instead.
+
+
Modified -[ASTableView beginUpdates]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode's -performBatchUpdates:completion: instead.
+
+
Modified -[ASTableView endUpdates]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode's -performBatchUpdates:completion: instead.
+
+
Modified -[ASTableView endUpdatesAnimated:completion:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode's -performBatchUpdates:completion: instead.
+
+
Modified -[ASTableView waitUntilAllUpdatesAreCommitted]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode method instead.
+
+
Modified -[ASTableView insertSections:withRowAnimation:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode method instead.
+
+
Modified -[ASTableView deleteSections:withRowAnimation:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode method instead.
+
+
Modified -[ASTableView reloadSections:withRowAnimation:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode method instead.
+
+
Modified -[ASTableView moveSection:toSection:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode method instead.
+
+
Modified -[ASTableView insertRowsAtIndexPaths:withRowAnimation:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode method instead.
+
+
Modified -[ASTableView deleteRowsAtIndexPaths:withRowAnimation:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode method instead.
+
+
Modified -[ASTableView reloadRowsAtIndexPaths:withRowAnimation:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode method instead.
+
+
Modified -[ASTableView moveRowAtIndexPath:toIndexPath:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse ASTableNode method instead.
+
+
Modified -[ASTableView clearContents]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedYou should not call this method directly. Intead, rely on the Interstate State callback methods.
+
+
Modified -[ASTableView clearFetchedData]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedYou should not call this method directly. Intead, rely on the Interstate State callback methods.
+
+
Modified ASTableViewDataSource
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedRenamed to ASTableDataSource.
+
+
Modified ASTableViewDelegate
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedRenamed to ASTableDelegate.
+
+
Modified ASTableDataSource
+ + + + +
HeaderProtocols
FromASTableView.hASCommonTableViewDataSource, NSObject
ToASTableNode.hASCommonTableDataSource, NSObject
+
+
Modified ASTableDelegate
+ + + + +
Header
FromASTableView.h
ToASTableNode.h
+
+
+ +
+ +
+
ASTableViewProtocols.h
+ +
+
Removed ASCommonTableViewDataSource
+
Removed -[ASCommonTableViewDataSource tableView:numberOfRowsInSection:]
+
Removed -[ASCommonTableViewDataSource numberOfSectionsInTableView:]
+
Removed -[ASCommonTableViewDataSource tableView:titleForHeaderInSection:]
+
Removed -[ASCommonTableViewDataSource tableView:titleForFooterInSection:]
+
Removed -[ASCommonTableViewDataSource tableView:canEditRowAtIndexPath:]
+
Removed -[ASCommonTableViewDataSource tableView:canMoveRowAtIndexPath:]
+
Removed -[ASCommonTableViewDataSource sectionIndexTitlesForTableView:]
+
Removed -[ASCommonTableViewDataSource tableView:sectionForSectionIndexTitle:atIndex:]
+
Removed -[ASCommonTableViewDataSource tableView:commitEditingStyle:forRowAtIndexPath:]
+
Removed -[ASCommonTableViewDataSource tableView:moveRowAtIndexPath:toIndexPath:]
+
+ + +
+
Added ASCommonTableDataSource
+
Added -[ASCommonTableDataSource tableView:numberOfRowsInSection:]
+
Added -[ASCommonTableDataSource numberOfSectionsInTableView:]
+
Added -[ASCommonTableDataSource tableView:titleForHeaderInSection:]
+
Added -[ASCommonTableDataSource tableView:titleForFooterInSection:]
+
Added -[ASCommonTableDataSource tableView:canEditRowAtIndexPath:]
+
Added -[ASCommonTableDataSource tableView:canMoveRowAtIndexPath:]
+
Added -[ASCommonTableDataSource sectionIndexTitlesForTableView:]
+
Added -[ASCommonTableDataSource tableView:sectionForSectionIndexTitle:atIndex:]
+
Added -[ASCommonTableDataSource tableView:commitEditingStyle:forRowAtIndexPath:]
+
Added -[ASCommonTableDataSource tableView:moveRowAtIndexPath:toIndexPath:]
+
+ + +
+
Modified -[ASCommonTableViewDelegate tableView:shouldHighlightRowAtIndexPath:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedImplement -tableNode:shouldHighlightRowAtIndexPath: instead.
+
+
Modified -[ASCommonTableViewDelegate tableView:didHighlightRowAtIndexPath:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedImplement -tableNode:didHighlightRowAtIndexPath: instead.
+
+
Modified -[ASCommonTableViewDelegate tableView:didUnhighlightRowAtIndexPath:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedImplement -tableNode:didUnhighlightRowAtIndexPath: instead.
+
+
Modified -[ASCommonTableViewDelegate tableView:willSelectRowAtIndexPath:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedImplement -tableNode:willSelectRowAtIndexPath: instead.
+
+
Modified -[ASCommonTableViewDelegate tableView:willDeselectRowAtIndexPath:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedImplement -tableNode:willDeselectRowAtIndexPath: instead.
+
+
Modified -[ASCommonTableViewDelegate tableView:didSelectRowAtIndexPath:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedImplement -tableNode:didSelectRowAtIndexPath: instead.
+
+
Modified -[ASCommonTableViewDelegate tableView:didDeselectRowAtIndexPath:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedImplement -tableNode:didDeselectRowAtIndexPath: instead.
+
+
Modified -[ASCommonTableViewDelegate tableView:shouldShowMenuForRowAtIndexPath:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedImplement -tableNode:shouldShowMenuForRowAtIndexPath: instead.
+
+
Modified -[ASCommonTableViewDelegate tableView:canPerformAction:forRowAtIndexPath:withSender:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedImplement -tableNode:canPerformAction:forRowAtIndexPath:withSender: instead.
+
+
Modified -[ASCommonTableViewDelegate tableView:performAction:forRowAtIndexPath:withSender:]
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedImplement -tableNode:performAction:forRowAtIndexPath:withSender: instead.
+
+
+ +
+ +
+
ASTextNode.h
+ +
+
Added ASTextNode (Unavailable)
+
+ + +
+
Modified ASTextNode.attributedString
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse .attributedText instead.
+
+
Modified ASTextNode.truncationAttributedString
+ + + + +
AvailabilityDeprecation Message
FromAvailablenone
ToDeprecatedUse .truncationAttributedText instead.
+
+
+ +
+ +
+
ASTraceEvent.h
+ +
+
Added ASTraceEvent
+
Added -[ASTraceEvent initWithObject:backtrace:format:arguments:]
+
Added ASTraceEvent.backtrace
+
Added ASTraceEvent.message
+
Added ASTraceEvent.timestamp
+
+ +
+ +
+
ASVideoNode.h
+ +
+
Removed -[ASVideoNodeDelegate videoPlaybackDidFinish:]
+
Removed -[ASVideoNodeDelegate videoNodeWasTapped:]
+
Removed -[ASVideoNodeDelegate videoNode:didPlayToSecond:]
+
+ + +
+
Added ASVideoNode.playerLayer
+
Added ASVideoNode (Unavailable)
+
+ +
+ +
+
ASViewController.h
+ +
+
Added ASViewController (Unavailable)
+
+ +
+ +
+
ASWeakSet.h
+ +
+
Added ASWeakSet
+
Added ObjectType
+
Added ASWeakSet.empty
+
Added -[ASWeakSet containsObject:]
+
Added -[ASWeakSet addObject:]
+
Added -[ASWeakSet removeObject:]
+
Added -[ASWeakSet removeAllObjects]
+
Added -[ASWeakSet allObjects]
+
Added ASWeakSet.count
+
+ +
+ +
+
AsyncDisplayKit+Debug.h
+ +
+
Added ASRangeController (Debugging)
+
Added +[ASRangeController setShouldShowRangeDebugOverlay:]
+
Added +[ASRangeController shouldShowRangeDebugOverlay]
+
Added +[ASRangeController layoutDebugOverlayIfNeeded]
+
Added -[ASRangeController addRangeControllerToRangeDebugOverlay]
+
Added -[ASRangeController updateRangeController:withScrollableDirections:scrollDirection:rangeMode:displayTuningParameters:preloadTuningParameters:interfaceState:]
+
+ +
+ +
+
CGRect+ASConvenience.h
+ +
+
Modified ASDirectionalScreenfulBuffer
+ + + + +
Header
FromCGRect+ASConvenience.h
ToCoreGraphics+ASConvenience.h
+
+
Modified ASDirectionalScreenfulBufferHorizontal()
+ + + + +
Header
FromCGRect+ASConvenience.h
ToCoreGraphics+ASConvenience.h
+
+
Modified ASDirectionalScreenfulBufferVertical()
+ + + + +
Header
FromCGRect+ASConvenience.h
ToCoreGraphics+ASConvenience.h
+
+
Modified CGRectExpandToRangeWithScrollableDirections()
+ + + + +
Header
FromCGRect+ASConvenience.h
ToCoreGraphics+ASConvenience.h
+
+
+ +
+ +
+
CoreGraphics+ASConvenience.h
+ +
+
Added #def CGFLOAT_EPSILON
+
Added ASCGFloatFromString()
+
Added ASCGFloatFromNumber()
+
Added CGSizeEqualToSizeWithIn()
+
+ + +
+
Modified ASDirectionalScreenfulBuffer
+ + + + +
Header
FromCGRect+ASConvenience.h
ToCoreGraphics+ASConvenience.h
+
+
Modified ASDirectionalScreenfulBufferHorizontal()
+ + + + +
Header
FromCGRect+ASConvenience.h
ToCoreGraphics+ASConvenience.h
+
+
Modified ASDirectionalScreenfulBufferVertical()
+ + + + +
Header
FromCGRect+ASConvenience.h
ToCoreGraphics+ASConvenience.h
+
+
Modified CGRectExpandToRangeWithScrollableDirections()
+ + + + +
Header
FromCGRect+ASConvenience.h
ToCoreGraphics+ASConvenience.h
+
+
+ +
+ +
+
NSArray+Diffing.h
+ +
+
Added NSArray (Diffing)
+
Added -[NSArray asdk_diffWithArray:insertions:deletions:]
+
Added -[NSArray asdk_diffWithArray:insertions:deletions:compareBlock:]
+
+ +
+ +
+
UIView+ASConvenience.h
+ +
+
Added ASDisplayProperties.allowsGroupOpacity
+
+ +
+ + diff --git a/docs/apidiff/apidiff.css b/docs/apidiff/apidiff.css new file mode 100755 index 00000000..822ae401 --- /dev/null +++ b/docs/apidiff/apidiff.css @@ -0,0 +1,87 @@ +body { + font: 12px 'Lucida Grande', 'Lucida Sans Unicode', Helvetica, Arial, Verdana, sans-serif; + margin: 0; + padding: 0 2em 2em 2em; +} + +h1 { + margin-top: 30px; + margin-bottom: 30px; + font-size: 28px; + font-weight: bold; +} + +.headerFile { + margin-left: 20px; +} + +.headerName { + margin: 15px 0px 10px -20px; + padding: 4px 4px 4px 20px; + font-weight: bold; + font-size: 120%; + background-color: #f8f8f8; +} + +.differenceGroup { + margin-top: 5px; +} + +.difference { + padding-left: 20px; + font-family: Courier, Consolas, monospace; + font-size: 110%; +} + +.status { + font-style: italic; + font-size: 80%; +} + +.removed { + color: red; +} + +.added { + color: blue; +} + +.modified { + color: #080; +} + +.declaration { + font-family: Courier, Consolas, monospace; +} + +table { + border: 1px #888 solid; + padding: 2px; + border-spacing: 0px; + border-collapse: collapse; + margin-left: 40px; + margin-top: 7px; +} + +td, th { + font-size: 10px; + border: 1px #888 solid; + padding:3px 6px; +} + +th { + font-size: 10px; + text-align: center; + background-color: #eee; +} + +td { + font-size: 90%; + text-align: left; +} + +.message { + margin-left: 20px; + font-style: italic; + color: #888; +} diff --git a/docs/appledoc/Blocks/ASDisplayNodeContextModifier.html b/docs/appledoc/Blocks/ASDisplayNodeContextModifier.html new file mode 100755 index 00000000..f52dec63 --- /dev/null +++ b/docs/appledoc/Blocks/ASDisplayNodeContextModifier.html @@ -0,0 +1,128 @@ + + + + + + ASDisplayNodeContextModifier Block Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASDisplayNodeContextModifier Block Reference

+ + +
+ + + + +
Declared inASDisplayNode.h
+ + + + + + + + + + +

Block Definition

+

ASDisplayNodeContextModifier

+ + +
+

ASDisplayNode will / did render node content in context.

+
+ + + +typedef void (^ASDisplayNodeContextModifier) (CGContextRef context) + + + + + + + + + + + +
+

Declared In

+ ASDisplayNode.h
+
+ + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Blocks/ASDisplayNodeDidLoadBlock.html b/docs/appledoc/Blocks/ASDisplayNodeDidLoadBlock.html new file mode 100755 index 00000000..eba4dee2 --- /dev/null +++ b/docs/appledoc/Blocks/ASDisplayNodeDidLoadBlock.html @@ -0,0 +1,128 @@ + + + + + + ASDisplayNodeDidLoadBlock Block Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASDisplayNodeDidLoadBlock Block Reference

+ + +
+ + + + +
Declared inASDisplayNode.h
+ + + + + + + + + + +

Block Definition

+

ASDisplayNodeDidLoadBlock

+ + +
+

ASDisplayNode loaded callback block. This block is called BEFORE the -didLoad method and is always called on the main thread.

+
+ + + +typedef void (^ASDisplayNodeDidLoadBlock) (__kindof ASDisplayNode, * node) + + + + + + + + + + + +
+

Declared In

+ ASDisplayNode.h
+
+ + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/ASCellNode+.html b/docs/appledoc/Categories/ASCellNode+.html new file mode 100755 index 00000000..8e75aaf5 --- /dev/null +++ b/docs/appledoc/Categories/ASCellNode+.html @@ -0,0 +1,222 @@ + + + + + + ASCellNode() Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASCellNode() Category Reference

+ + +
+ + + + +
Declared inASCellNode+Internal.h
+ + + + + + +
+ + + + + + +
+
+ +

  layoutAttributes +

+ +
+
+ +
+ + +
+

This could be declared @c copy, but since this is only settable internally, we can ensure +that it’s always safe simply to retain it, and copy if needed. Since @c UICollectionViewLayoutAttributes +is always mutable, @c copy is never “free” like it is for e.g. NSString.

+
+ + + +
@property (nonatomic, strong, nullable) UICollectionViewLayoutAttributes *layoutAttributes
+ + + + + + + + + +
+

Discussion

+

Note: This could be declared @c copy, but since this is only settable internally, we can ensure +that it’s always safe simply to retain it, and copy if needed. Since @c UICollectionViewLayoutAttributes +is always mutable, @c copy is never “free” like it is for e.g. NSString.

+
+ + + + + + + +
+

Declared In

+

ASCellNode+Internal.h

+
+ + +
+
+
+ +

  supplementaryElementKind +

+ +
+
+ +
+ + +
+

readwrite variant of the readonly public property.

+
+ + + +
@property (nonatomic, copy, nullable) NSString *supplementaryElementKind
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASCellNode+Internal.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/ASCollectionNode+Deprecated.html b/docs/appledoc/Categories/ASCollectionNode+Deprecated.html new file mode 100755 index 00000000..3a528cff --- /dev/null +++ b/docs/appledoc/Categories/ASCollectionNode+Deprecated.html @@ -0,0 +1,176 @@ + + + + + + ASCollectionNode(Deprecated) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASCollectionNode(Deprecated) Category Reference

+ + +
+ + + + +
Declared inASCollectionNode.h
+ + + + + + +
+ + + + + + +
+
+ +

– reloadDataImmediately +

+ +
+
+ +
+ + +
+

Reload everything from scratch, destroying the working range and all cached nodes. (Deprecated: This method is deprecated in 2.0. Use @c reloadDataWithCompletion: and +then @c waitUntilAllUpdatesAreCommitted instead.)

+
+ + + +
- (void)reloadDataImmediately
+ + + + + + + + + +
+

Discussion

+

Warning: This method is substantially more expensive than UICollectionView’s version.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/ASCollectionView+Deprecated.html b/docs/appledoc/Categories/ASCollectionView+Deprecated.html new file mode 100755 index 00000000..9d4741fe --- /dev/null +++ b/docs/appledoc/Categories/ASCollectionView+Deprecated.html @@ -0,0 +1,1616 @@ + + + + + + ASCollectionView(Deprecated) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASCollectionView(Deprecated) Category Reference

+ + +
+ + + + +
Declared inASCollectionView.h
+ + + + + + +
+ + + + + + +
+
+ +

– initWithCollectionViewLayout: +

+ +
+
+ +
+ + +
+

Initializes an ASCollectionView

+
+ + + +
- (instancetype)initWithCollectionViewLayout:(UICollectionViewLayout *)layout
+ + + +
+

Parameters

+ + + + + + + +
layout

The layout object to use for organizing items. The collection view stores a strong reference to the specified object. Must not be nil.

+
+ + + + + + + +
+

Discussion

+

Initializes and returns a newly allocated collection view object with the specified layout.

+
+ + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– initWithFrame:collectionViewLayout: +

+ +
+
+ +
+ + +
+

Initializes an ASCollectionView

+
+ + + +
- (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout
+ + + +
+

Parameters

+ + + + + + + + + + + + +
frame

The frame rectangle for the collection view, measured in points. The origin of the frame is relative to the superview in which you plan to add it. This frame is passed to the superclass during initialization.

layout

The layout object to use for organizing items. The collection view stores a strong reference to the specified object. Must not be nil.

+
+ + + + + + + +
+

Discussion

+

Initializes and returns a newly allocated collection view object with the specified frame and layout.

+
+ + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– tuningParametersForRangeType: +

+ +
+
+ +
+ + +
+

Tuning parameters for a range type in full mode.

+
+ + + +
- (ASRangeTuningParameters)tuningParametersForRangeType:(ASLayoutRangeType)rangeType
+ + + +
+

Parameters

+ + + + + + + +
rangeType

The range type to get the tuning parameters for.

+
+ + + +
+

Return Value

+

A tuning parameter value for the given range type in full mode.

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– setTuningParameters:forRangeType: +

+ +
+
+ +
+ + +
+

Set the tuning parameters for a range type in full mode.

+
+ + + +
- (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeType:(ASLayoutRangeType)rangeType
+ + + +
+

Parameters

+ + + + + + + + + + + + +
tuningParameters

The tuning parameters to store for a range type.

rangeType

The range type to set the tuning parameters for.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– tuningParametersForRangeMode:rangeType: +

+ +
+
+ +
+ + +
+

Tuning parameters for a range type in the specified mode.

+
+ + + +
- (ASRangeTuningParameters)tuningParametersForRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType
+ + + +
+

Parameters

+ + + + + + + + + + + + +
rangeMode

The range mode to get the running parameters for.

rangeType

The range type to get the tuning parameters for.

+
+ + + +
+

Return Value

+

A tuning parameter value for the given range type in the given mode.

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– setTuningParameters:forRangeMode:rangeType: +

+ +
+
+ +
+ + +
+

Set the tuning parameters for a range type in the specified mode.

+
+ + + +
- (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
tuningParameters

The tuning parameters to store for a range type.

rangeMode

The range mode to set the running parameters for.

rangeType

The range type to set the tuning parameters for.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– performBatchAnimated:updates:completion: +

+ +
+
+ +
+ + +
+

Perform a batch of updates asynchronously, optionally disabling all animations in the batch. This method must be called from the main thread. +The asyncDataSource must be updated to reflect the changes before the update block completes.

+
+ + + +
- (void)performBatchAnimated:(BOOL)animated updates:(nullable __attribute ( ( noescape ) ) void ( ^ ) ( ))updates completion:(nullable void ( ^ ) ( BOOL finished ))completion
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
animated

NO to disable animations for this batch

updates

The block that performs the relevant insert, delete, reload, or move operations.

completion

A completion handler block to execute when all of the operations are finished. This block takes a single +Boolean parameter that contains the value YES if all of the related animations completed successfully or +NO if they were interrupted. This parameter may be nil. If supplied, the block is run on the main thread.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– performBatchUpdates:completion: +

+ +
+
+ +
+ + +
+

Perform a batch of updates asynchronously. This method must be called from the main thread. +The asyncDataSource must be updated to reflect the changes before update block completes.

+
+ + + +
- (void)performBatchUpdates:(nullable __attribute ( ( noescape ) ) void ( ^ ) ( ))updates completion:(nullable void ( ^ ) ( BOOL finished ))completion
+ + + +
+

Parameters

+ + + + + + + + + + + + +
updates

The block that performs the relevant insert, delete, reload, or move operations.

completion

A completion handler block to execute when all of the operations are finished. This block takes a single +Boolean parameter that contains the value YES if all of the related animations completed successfully or +NO if they were interrupted. This parameter may be nil. If supplied, the block is run on the main thread.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– reloadDataWithCompletion: +

+ +
+
+ +
+ + +
+

Reload everything from scratch, destroying the working range and all cached nodes.

+
+ + + +
- (void)reloadDataWithCompletion:(nullable void ( ^ ) ( ))completion
+ + + +
+

Parameters

+ + + + + + + +
completion

block to run on completion of asynchronous loading or nil. If supplied, the block is run on +the main thread.

+
+ + + + + + + +
+

Discussion

+

Warning: This method is substantially more expensive than UICollectionView’s version.

+
+ + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– reloadData +

+ +
+
+ +
+ + +
+

Reload everything from scratch, destroying the working range and all cached nodes.

+
+ + + +
- (void)reloadData
+ + + + + + + + + +
+

Discussion

+

Warning: This method is substantially more expensive than UICollectionView’s version.

+
+ + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– reloadDataImmediately +

+ +
+
+ +
+ + +
+

Reload everything from scratch entirely on the main thread, destroying the working range and all cached nodes.

+
+ + + +
- (void)reloadDataImmediately
+ + + + + + + + + +
+

Discussion

+

Warning: This method is substantially more expensive than UICollectionView’s version and will block the main thread +while all the cells load.

+
+ + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– relayoutItems +

+ +
+
+ +
+ + +
+

Triggers a relayout of all nodes.

+
+ + + +
- (void)relayoutItems
+ + + + + + + + + +
+

Discussion

+

This method invalidates and lays out every cell node in the collection.

+
+ + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– waitUntilAllUpdatesAreCommitted +

+ +
+
+ +
+ + +
+

Blocks execution of the main thread until all section and row updates are committed. This method must be called from the main thread.

+
+ + + +
- (void)waitUntilAllUpdatesAreCommitted
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– registerSupplementaryNodeOfKind: +

+ +
+
+ +
+ + +
+

Registers the given kind of supplementary node for use in creating node-backed supplementary views.

+
+ + + +
- (void)registerSupplementaryNodeOfKind:(NSString *)elementKind
+ + + +
+

Parameters

+ + + + + + + +
elementKind

The kind of supplementary node that will be requested through the data source.

+
+ + + + + + + +
+

Discussion

+

Use this method to register support for the use of supplementary nodes in place of the default +registerClass:forSupplementaryViewOfKind:withReuseIdentifier: and registerNib:forSupplementaryViewOfKind:withReuseIdentifier: +methods. This method will register an internal backing view that will host the contents of the supplementary nodes +returned from the data source.

+
+ + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– insertSections: +

+ +
+
+ +
+ + +
+

Inserts one or more sections.

+
+ + + +
- (void)insertSections:(NSIndexSet *)sections
+ + + +
+

Parameters

+ + + + + + + +
sections

An index set that specifies the sections to insert.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes +before this method is called.

+
+ + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– deleteSections: +

+ +
+
+ +
+ + +
+

Deletes one or more sections.

+
+ + + +
- (void)deleteSections:(NSIndexSet *)sections
+ + + +
+

Parameters

+ + + + + + + +
sections

An index set that specifies the sections to delete.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes +before this method is called.

+
+ + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– reloadSections: +

+ +
+
+ +
+ + +
+

Reloads the specified sections.

+
+ + + +
- (void)reloadSections:(NSIndexSet *)sections
+ + + +
+

Parameters

+ + + + + + + +
sections

An index set that specifies the sections to reload.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes +before this method is called.

+
+ + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– moveSection:toSection: +

+ +
+
+ +
+ + +
+

Moves a section to a new location.

+
+ + + +
- (void)moveSection:(NSInteger)section toSection:(NSInteger)newSection
+ + + +
+

Parameters

+ + + + + + + + + + + + +
section

The index of the section to move.

newSection

The index that is the destination of the move for the section.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes +before this method is called.

+
+ + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– insertItemsAtIndexPaths: +

+ +
+
+ +
+ + +
+

Inserts items at the locations identified by an array of index paths.

+
+ + + +
- (void)insertItemsAtIndexPaths:(NSArray<NSIndexPath*> *)indexPaths
+ + + +
+

Parameters

+ + + + + + + +
indexPaths

An array of NSIndexPath objects, each representing an item index and section index that together identify an item.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes +before this method is called.

+
+ + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– deleteItemsAtIndexPaths: +

+ +
+
+ +
+ + +
+

Deletes the items specified by an array of index paths.

+
+ + + +
- (void)deleteItemsAtIndexPaths:(NSArray<NSIndexPath*> *)indexPaths
+ + + +
+

Parameters

+ + + + + + + +
indexPaths

An array of NSIndexPath objects identifying the items to delete.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes +before this method is called.

+
+ + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– reloadItemsAtIndexPaths: +

+ +
+
+ +
+ + +
+

Reloads the specified items.

+
+ + + +
- (void)reloadItemsAtIndexPaths:(NSArray<NSIndexPath*> *)indexPaths
+ + + +
+

Parameters

+ + + + + + + +
indexPaths

An array of NSIndexPath objects identifying the items to reload.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes +before this method is called.

+
+ + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– moveItemAtIndexPath:toIndexPath: +

+ +
+
+ +
+ + +
+

Moves the item at a specified location to a destination location.

+
+ + + +
- (void)moveItemAtIndexPath:(NSIndexPath *)indexPath toIndexPath:(NSIndexPath *)newIndexPath
+ + + +
+

Parameters

+ + + + + + + + + + + + +
indexPath

The index path identifying the item to move.

newIndexPath

The index path that is the destination of the move for the item.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes +before this method is called.

+
+ + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– calculatedSizeForNodeAtIndexPath: +

+ +
+
+ +
+ + +
+

Query the sized node at @c indexPath for its calculatedSize.

+
+ + + +
- (CGSize)calculatedSizeForNodeAtIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + +
indexPath

The index path for the node of interest.

+ +

This method is deprecated. Call @c calculatedSize on the node of interest instead. First deprecated in version 2.0.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– visibleNodes +

+ +
+
+ +
+ + +
+

Similar to -visibleCells.

+
+ + + +
- (NSArray<__kindofASCellNode*> *)visibleNodes
+ + + + + +
+

Return Value

+

an array containing the nodes being displayed on screen.

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– indexPathForNode: +

+ +
+
+ +
+ + +
+

Similar to -indexPathForCell:.

+
+ + + +
- (nullable NSIndexPath *)indexPathForNode:(ASCellNode *)cellNode
+ + + +
+

Parameters

+ + + + + + + +
cellNode

a cellNode in the collection view

+
+ + + +
+

Return Value

+

The index path for this cell node.

+
+ + + + + +
+

Discussion

+

This index path returned by this method is in the view’s index space +and should only be used with @c ASCollectionView directly. To get an index path suitable +for use with your data source and @c ASCollectionNode, call @c indexPathForNode: on the +collection node instead.

+
+ + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/ASControlNode+Debugging.html b/docs/appledoc/Categories/ASControlNode+Debugging.html new file mode 100755 index 00000000..5f1703f0 --- /dev/null +++ b/docs/appledoc/Categories/ASControlNode+Debugging.html @@ -0,0 +1,187 @@ + + + + + + ASControlNode(Debugging) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASControlNode(Debugging) Category Reference

+ + +
+ + + + +
Declared inAsyncDisplayKit+Debug.h
+ + + + + + +
+ + + + + + +
+
+ +

+ setEnableHitTestDebug: +

+ +
+
+ +
+ + +
+

Class method to enable a visualization overlay of the tappable area on the ASControlNode. For app debugging purposes only. +NOTE: GESTURE RECOGNIZERS, (including tap gesture recognizers on a control node) WILL NOT BE VISUALIZED!!! +Overlay = translucent GREEN color, +edges that are clipped by the tappable area of any parent (their bounds + hitTestSlop) in the hierarchy = DARK GREEN BORDERED EDGE, +edges that are clipped by clipToBounds = YES of any parent in the hierarchy = ORANGE BORDERED EDGE (may still receive touches beyond +overlay rect, but can’t be visualized).

+
+ + + +
+ (void)setEnableHitTestDebug:(BOOL)enable
+ + + +
+

Parameters

+ + + + + + + +
enable

Specify YES to make this debug feature enabled when messaging the ASControlNode class.

+
+ + + + + + + + + + + + + +
+

Declared In

+

AsyncDisplayKit+Debug.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/ASControlNode+Subclassing.html b/docs/appledoc/Categories/ASControlNode+Subclassing.html new file mode 100755 index 00000000..cfff640c --- /dev/null +++ b/docs/appledoc/Categories/ASControlNode+Subclassing.html @@ -0,0 +1,497 @@ + + + + + + ASControlNode(Subclassing) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASControlNode(Subclassing) Category Reference

+ + +
+ + + + +
Declared inASControlNode+Subclasses.h
+ + + + +
+ +

Overview

+

The subclass header ASControlNode+Subclasses defines methods to be +overridden by custom nodes that subclass ASControlNode.

+ +

These methods should never be called directly by other classes.

+
+ + + + + +
+ + + + + + +
+
+ +

– sendActionsForControlEvents:withEvent: +

+ +
+
+ +
+ + +
+

Sends action messages for the given control events.

+
+ + + +
- (void)sendActionsForControlEvents:(ASControlNodeEvent)controlEvents withEvent:(nullable UIEvent *)touchEvent
+ + + +
+

Parameters

+ + + + + + + + + + + + +
controlEvents

A bitmask whose set flags specify the control events for which action messages are sent. See “Control Events” in ASControlNode.h for bitmask constants.

touchEvent

An event object encapsulating the information specific to the user event.

+
+ + + + + + + +
+

Discussion

+

ASControlNode implements this method to send all action messages associated with controlEvents. The list of targets is constructed from prior invocations of addTarget:action:forControlEvents:.

+
+ + + + + + + +
+

Declared In

+

ASControlNode+Subclasses.h

+
+ + +
+
+
+ +

– beginTrackingWithTouch:withEvent: +

+ +
+
+ +
+ + +
+

Sent to the control when tracking begins.

+
+ + + +
- (BOOL)beginTrackingWithTouch:(UITouch *)touch withEvent:(nullable UIEvent *)touchEvent
+ + + +
+

Parameters

+ + + + + + + + + + + + +
touch

The touch on the receiving control.

touchEvent

An event object encapsulating the information specific to the user event.

+
+ + + +
+

Return Value

+

YES if the receiver should respond continuously (respond when touch is dragged); NO otherwise.

+
+ + + + + + + + + + + +
+

Declared In

+

ASControlNode+Subclasses.h

+
+ + +
+
+
+ +

– continueTrackingWithTouch:withEvent: +

+ +
+
+ +
+ + +
+

Sent continuously to the control as it tracks a touch within the control’s bounds.

+
+ + + +
- (BOOL)continueTrackingWithTouch:(UITouch *)touch withEvent:(nullable UIEvent *)touchEvent
+ + + +
+

Parameters

+ + + + + + + + + + + + +
touch

The touch on the receiving control.

touchEvent

An event object encapsulating the information specific to the user event.

+
+ + + +
+

Return Value

+

YES if touch tracking should continue; NO otherwise.

+
+ + + + + + + + + + + +
+

Declared In

+

ASControlNode+Subclasses.h

+
+ + +
+
+
+ +

– cancelTrackingWithEvent: +

+ +
+
+ +
+ + +
+

Sent to the control when tracking should be cancelled.

+
+ + + +
- (void)cancelTrackingWithEvent:(nullable UIEvent *)touchEvent
+ + + +
+

Parameters

+ + + + + + + +
touchEvent

An event object encapsulating the information specific to the user event. This parameter may be nil, indicating that the cancelation was caused by something other than an event, such as the display node being removed from its supernode.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASControlNode+Subclasses.h

+
+ + +
+
+
+ +

– endTrackingWithTouch:withEvent: +

+ +
+
+ +
+ + +
+

Sent to the control when the last touch completely ends, telling it to stop tracking.

+
+ + + +
- (void)endTrackingWithTouch:(nullable UITouch *)touch withEvent:(nullable UIEvent *)touchEvent
+ + + +
+

Parameters

+ + + + + + + + + + + + +
touch

The touch that ended.

touchEvent

An event object encapsulating the information specific to the user event.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASControlNode+Subclasses.h

+
+ + +
+
+
+ +

  highlighted +

+ +
+
+ +
+ + +
+

Settable version of highlighted property.

+
+ + + +
@property (nonatomic, readwrite, assign, getter=isHighlighted) BOOL highlighted
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASControlNode+Subclasses.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/ASDisplayNode+AutomaticSubnodeManagement.html b/docs/appledoc/Categories/ASDisplayNode+AutomaticSubnodeManagement.html new file mode 100755 index 00000000..d0bcbb66 --- /dev/null +++ b/docs/appledoc/Categories/ASDisplayNode+AutomaticSubnodeManagement.html @@ -0,0 +1,177 @@ + + + + + + ASDisplayNode(AutomaticSubnodeManagement) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASDisplayNode(AutomaticSubnodeManagement) Category Reference

+ + +
+ + + + +
Declared inASDisplayNode.h
+ + + + + + +
+ + + + + + +
+
+ +

  automaticallyManagesSubnodes +

+ +
+
+ +
+ + +
+

A boolean that shows whether the node automatically inserts and removes nodes based on the presence or +absence of the node and its subnodes is completely determined in its layoutSpecThatFits: method.

+
+ + + +
@property (nonatomic, assign) BOOL automaticallyManagesSubnodes
+ + + + + + + + + +
+

Discussion

+

If flag is YES the node no longer require addSubnode: or removeFromSupernode method calls. The presence +or absence of subnodes is completely determined in its layoutSpecThatFits: method.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/ASDisplayNode+Beta.html b/docs/appledoc/Categories/ASDisplayNode+Beta.html new file mode 100755 index 00000000..3e7b7af6 --- /dev/null +++ b/docs/appledoc/Categories/ASDisplayNode+Beta.html @@ -0,0 +1,635 @@ + + + + + + ASDisplayNode(Beta) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASDisplayNode(Beta) Category Reference

+ + +
+ + + + +
Declared inASDisplayNode+Beta.h
+ + + + + + +
+ + + + + + +
+
+ +

+ suppressesInvalidCollectionUpdateExceptions +

+ +
+
+ +
+ + +
+

ASTableView and ASCollectionView now throw exceptions on invalid updates +like their UIKit counterparts. If YES, these classes will log messages +on invalid updates rather than throwing exceptions.

+
+ + + +
+ (BOOL)suppressesInvalidCollectionUpdateExceptions
+ + + + + + + + + +
+

Discussion

+

Note that even if AsyncDisplayKit’s exception is suppressed, the app may still crash +as it proceeds with an invalid update.

+ +

This property defaults to NO. It will be removed in a future release.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Beta.h

+
+ + +
+
+
+ +

– recursivelyEnsureDisplaySynchronously: +

+ +
+
+ +
+ + +
+

Recursively ensures node and all subnodes are displayed.

+
+ + + +
- (void)recursivelyEnsureDisplaySynchronously:(BOOL)synchronously
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode+Beta.h

+
+ + +
+
+
+ +

  willDisplayNodeContentWithRenderingContext +

+ +
+
+ +
+ + +
+

allow modification of a context before the node’s content is drawn

+
+ + + +
@property (nonatomic, copy, nullable) ASDisplayNodeContextModifier willDisplayNodeContentWithRenderingContext
+ + + + + + + + + +
+

Discussion

+

Set the block to be called after the context has been created and before the node’s content is drawn. +You can override this to modify the context before the content is drawn. You are responsible for saving and +restoring context if necessary. Restoring can be done in contextDidDisplayNodeContent +This block can be called from any thread and it is unsafe to access any UIKit main thread properties from it.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Beta.h

+
+ + +
+
+
+ +

  didDisplayNodeContentWithRenderingContext +

+ +
+
+ +
+ + +
+

allow modification of a context after the node’s content is drawn

+
+ + + +
@property (nonatomic, copy, nullable) ASDisplayNodeContextModifier didDisplayNodeContentWithRenderingContext
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode+Beta.h

+
+ + +
+
+
+ +

  measurementOptions +

+ +
+
+ +
+ + +
+

A bitmask representing which actions (layout spec, layout generation) should be measured.

+
+ + + +
@property (nonatomic, assign) ASDisplayNodePerformanceMeasurementOptions measurementOptions
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode+Beta.h

+
+ + +
+
+
+ +

  performanceMeasurements +

+ +
+
+ +
+ + +
+

A simple struct representing performance measurements collected.

+
+ + + +
@property (nonatomic, assign, readonly) ASDisplayNodePerformanceMeasurements performanceMeasurements
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode+Beta.h

+
+ + +
+
+
+ +

– placeholderShouldPersist +

+ +
+
+ +
+ + +
+

Currently used by ASNetworkImageNode and ASMultiplexImageNode to allow their placeholders to stay if they are loading an image from the network. +Otherwise, a display pass is scheduled and completes, but does not actually draw anything - and ASDisplayNode considers the element finished.

+
+ + + +
- (BOOL)placeholderShouldPersist
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode+Beta.h

+
+ + +
+
+
+ +

– hierarchyDisplayDidFinish +

+ +
+
+ +
+ + +
+

Indicates that the receiver and all subnodes have finished displaying. May be called more than once, for example if the receiver has +a network image node. This is called after the first display pass even if network image nodes have not downloaded anything (text would be done, +and other nodes that are ready to do their final display). Each render of every progressive jpeg network node would cause this to be called, so +this hook could be called up to 1 + (pJPEGcount * pJPEGrenderCount) times. The render count depends on how many times the downloader calls the +progressImage block.

+
+ + + +
- (void)hierarchyDisplayDidFinish
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode+Beta.h

+
+ + +
+
+
+ +

+ setRangeModeForMemoryWarnings: +

+ +
+
+ +
+ + +
+

Only ASLayoutRangeModeVisibleOnly or ASLayoutRangeModeLowMemory are recommended. Default is ASLayoutRangeModeVisibleOnly, +because this is the only way to ensure an application will not have blank / flashing views as the user navigates back after +a memory warning. Apps that wish to use the more effective / aggressive ASLayoutRangeModeLowMemory may need to take steps +to mitigate this behavior, including: restoring a larger range mode to the next controller before the user navigates there, +enabling .neverShowPlaceholders on ASCellNodes so that the navigation operation is blocked on redisplay completing, etc.

+
+ + + +
+ (void)setRangeModeForMemoryWarnings:(ASLayoutRangeMode)rangeMode
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode+Beta.h

+
+ + +
+
+
+ +

– _logEventWithBacktrace:format: +

+ +
+
+ +
+ + +
+

The primitive event tracing method. You shouldn’t call this. Use the ASDisplayNodeLogEvent macro instead.

+
+ + + +
- (void)_logEventWithBacktrace:(NSArray<NSString*> *)backtrace format:(NSString *)format, ...
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode+Beta.h

+
+ + +
+
+
+ +

  eventLog +

+ +
+
+ +
+ + +
+

The most recent trace events for this node. Max count is ASDISPLAYNODE_EVENTLOG_CAPACITY.

+
+ + + +
@property (readonly, copy) NSArray *eventLog
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode+Beta.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/ASDisplayNode+Debugging.html b/docs/appledoc/Categories/ASDisplayNode+Debugging.html new file mode 100755 index 00000000..33e97cf9 --- /dev/null +++ b/docs/appledoc/Categories/ASDisplayNode+Debugging.html @@ -0,0 +1,188 @@ + + + + + + ASDisplayNode(Debugging) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASDisplayNode(Debugging) Category Reference

+ + +
+ + + + + + + +
Conforms toASLayoutElementAsciiArtProtocol
Declared inASDisplayNode.h
+ + + + +
+ +

Overview

+

Convenience methods for debugging.

+
+ + + + + +
+ + + + + + +
+
+ +

– displayNodeRecursiveDescription +

+ +
+
+ +
+ + +
+

Return a description of the node hierarchy.

+
+ + + +
- (NSString *)displayNodeRecursiveDescription
+ + + + + + + + + +
+

Discussion

+

For debugging: (lldb) po [node displayNodeRecursiveDescription]

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/ASDisplayNode+Deprecated.html b/docs/appledoc/Categories/ASDisplayNode+Deprecated.html new file mode 100755 index 00000000..5eb821eb --- /dev/null +++ b/docs/appledoc/Categories/ASDisplayNode+Deprecated.html @@ -0,0 +1,487 @@ + + + + + + ASDisplayNode(Deprecated) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASDisplayNode(Deprecated) Category Reference

+ + +
+ + + + +
Declared inASDisplayNode+Deprecated.h
+ + + + + + +
+ + + + + + +
+
+ +

  ) +

+ +
+
+ +
+ + +
+

The name of this node, which will be displayed in description. The default value is nil. (Deprecated: Deprecated in version 2.0: Use .debugName instead. This value will display in +results of the -asciiArtString method (@see ASLayoutElementAsciiArtProtocol).)

+
+ + + +
@property (nullable, nonatomic, copy) NSString *ASDISPLAYNODE_DEPRECATED_MSG ( "Use .debugName instead." )
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode+Deprecated.h

+
+ + +
+
+
+ +

– measure: +

+ +
+
+ +
+ + +
+

Asks the node to measure and return the size that best fits its subnodes. (Deprecated: Deprecated in version 2.0: Use layoutThatFits: with a constrained size of (CGSizeZero, constrainedSize) and call size on the returned ASLayout)

+
+ + + +
- (CGSize)measure:(CGSize)constrainedSize
+ + + +
+

Parameters

+ + + + + + + +
constrainedSize

The maximum size the receiver should fit in.

+
+ + + +
+

Return Value

+

A new size that fits the receiver’s subviews.

+
+ + + + + +
+

Discussion

+

Though this method does not set the bounds of the view, it does have side effects–caching both the +constraint and the result.

Warning: Subclasses must not override this; it calls -measureWithSizeRange: with zero min size. +-measureWithSizeRange: caches results from -calculateLayoutThatFits:. Calling this method may +be expensive if result is not cached.

+
+ + + + + + + + + +
+

Declared In

+

ASDisplayNode+Deprecated.h

+
+ + +
+
+
+ +

– visibilityDidChange: +

+ +
+
+ +
+ + +
+

Called whenever the visiblity of the node changed. (Deprecated: @see didEnterVisibleState @see didExitVisibleState)

+
+ + + +
- (void)visibilityDidChange:(BOOL)isVisible
+ + + + + + + + + +
+

Discussion

+

Subclasses may use this to monitor when they become visible.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Deprecated.h

+
+ + +
+
+
+ +

– visibleStateDidChange: +

+ +
+
+ +
+ + +
+

Called whenever the visiblity of the node changed. (Deprecated: @see didEnterVisibleState @see didExitVisibleState)

+
+ + + +
- (void)visibleStateDidChange:(BOOL)isVisible
+ + + + + + + + + +
+

Discussion

+

Subclasses may use this to monitor when they become visible.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Deprecated.h

+
+ + +
+
+
+ +

– displayStateDidChange: +

+ +
+
+ +
+ + +
+

Called whenever the the node has entered or exited the display state. (Deprecated: @see didEnterDisplayState @see didExitDisplayState)

+
+ + + +
- (void)displayStateDidChange:(BOOL)inDisplayState
+ + + + + + + + + +
+

Discussion

+

Subclasses may use this to monitor when a node should be rendering its content.

Note: This method can be called from any thread and should therefore be thread safe.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Deprecated.h

+
+ + +
+
+
+ +

– loadStateDidChange: +

+ +
+
+ +
+ + +
+

Called whenever the the node has entered or left the load state. (Deprecated: @see didEnterPreloadState @see didExitPreloadState)

+
+ + + +
- (void)loadStateDidChange:(BOOL)inLoadState
+ + + + + + + + + +
+

Discussion

+

Subclasses may use this to monitor data for a node should be loaded, either from a local or remote source.

Note: This method can be called from any thread and should therefore be thread safe.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Deprecated.h

+
+ + +
+
+
+ +

– cancelLayoutTransitionsInProgress +

+ +
+
+ +
+ + +
+

Cancels all performing layout transitions. Can be called on any thread. (Deprecated: Deprecated in version 2.0: Use cancelLayoutTransition)

+
+ + + +
- (void)cancelLayoutTransitionsInProgress
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode+Deprecated.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/ASDisplayNode+LayoutTransitioning.html b/docs/appledoc/Categories/ASDisplayNode+LayoutTransitioning.html new file mode 100755 index 00000000..986923fb --- /dev/null +++ b/docs/appledoc/Categories/ASDisplayNode+LayoutTransitioning.html @@ -0,0 +1,560 @@ + + + + + + ASDisplayNode(LayoutTransitioning) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASDisplayNode(LayoutTransitioning) Category Reference

+ + +
+ + + + +
Declared inASDisplayNode.h
+ + + + + + +
+ + + + + + +
+
+ +

  defaultLayoutTransitionDuration +

+ +
+
+ +
+ + +
+

The amount of time it takes to complete the default transition animation. Default is 0.2.

+
+ + + +
@property (nonatomic, assign) NSTimeInterval defaultLayoutTransitionDuration
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

  defaultLayoutTransitionDelay +

+ +
+
+ +
+ + +
+

The amount of time (measured in seconds) to wait before beginning the default transition animation. +Default is 0.0.

+
+ + + +
@property (nonatomic, assign) NSTimeInterval defaultLayoutTransitionDelay
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

  defaultLayoutTransitionOptions +

+ +
+
+ +
+ + +
+

A mask of options indicating how you want to perform the default transition animations. +For a list of valid constants, see UIViewAnimationOptions.

+
+ + + +
@property (nonatomic, assign) UIViewAnimationOptions defaultLayoutTransitionOptions
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

– animateLayoutTransition: +

+ +
+
+ +
+ + +
+

A place to perform your animation. New nodes have been inserted here. You can also use this time to re-order the hierarchy.

+
+ + + +
- (void)animateLayoutTransition:(nonnull id<ASContextTransitioning>)context
+ + + + + + + + + +
+

Discussion

+

A place to perform your animation. New nodes have been inserted here. You can also use this time to re-order the hierarchy.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

– didCompleteLayoutTransition: +

+ +
+
+ +
+ + +
+

A place to clean up your nodes after the transition

+
+ + + +
- (void)didCompleteLayoutTransition:(nonnull id<ASContextTransitioning>)context
+ + + + + + + + + +
+

Discussion

+

A place to clean up your nodes after the transition

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

– transitionLayoutWithSizeRange:animated:shouldMeasureAsync:measurementCompletion: +

+ +
+
+ +
+ + +
+

Transitions the current layout with a new constrained size. Must be called on main thread.

+
+ + + +
- (void)transitionLayoutWithSizeRange:(ASSizeRange)constrainedSize animated:(BOOL)animated shouldMeasureAsync:(BOOL)shouldMeasureAsync measurementCompletion:(nullable void ( ^ ) ( ))completion
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
animated

Animation is optional, but will still proceed through your animateLayoutTransition implementation with isAnimated == NO.

shouldMeasureAsync

Measure the layout asynchronously.

measurementCompletion

Optional completion block called only if a new layout is calculated. +It is called on main, right after the measurement and before -animateLayoutTransition:.

+
+ + + + + + + +
+

Discussion

+

If the passed constrainedSize is the the same as the node’s current constrained size, this method is noop. If passed YES to shouldMeasureAsync it’s guaranteed that measurement is happening on a background thread, otherwise measaurement will happen on the thread that the method was called on. The measurementCompletion callback is always called on the main thread right after the measurement and before -animateLayoutTransition:.

+
+ + + + + +
+

See Also

+ +
+ + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

– transitionLayoutWithAnimation:shouldMeasureAsync:measurementCompletion: +

+ +
+
+ +
+ + +
+

Invalidates the current layout and begins a relayout of the node with the current constrainedSize. Must be called on main thread.

+
+ + + +
- (void)transitionLayoutWithAnimation:(BOOL)animated shouldMeasureAsync:(BOOL)shouldMeasureAsync measurementCompletion:(nullable void ( ^ ) ( ))completion
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
animated

Animation is optional, but will still proceed through your animateLayoutTransition implementation with isAnimated == NO.

shouldMeasureAsync

Measure the layout asynchronously.

measurementCompletion

Optional completion block called only if a new layout is calculated.

+
+ + + + + + + +
+

Discussion

+

It is called right after the measurement and before -animateLayoutTransition:.

+
+ + + + + +
+

See Also

+ +
+ + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

– cancelLayoutTransition +

+ +
+
+ +
+ + +
+

Cancels all performing layout transitions. Can be called on any thread.

+
+ + + +
- (void)cancelLayoutTransition
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/ASDisplayNode+Subclassing.html b/docs/appledoc/Categories/ASDisplayNode+Subclassing.html new file mode 100755 index 00000000..f8844132 --- /dev/null +++ b/docs/appledoc/Categories/ASDisplayNode+Subclassing.html @@ -0,0 +1,2562 @@ + + + + + + ASDisplayNode(Subclassing) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASDisplayNode(Subclassing) Category Reference

+ + +
+ + + + +
Declared inASDisplayNode+Subclasses.h
+ + + + +
+ +

Overview

+

The subclass header ASDisplayNode+Subclasses defines the following methods that either must or can be overriden by +subclasses of ASDisplayNode.

+ +

These methods should never be called directly by other classes.

+ +

Drawing

+ +

Implement one of +displayWithParameters:isCancelled: or +drawRect:withParameters:isCancelled: to provide +drawing for your node.

+ +

Use -drawParametersForAsyncLayer: to copy any properties that are involved in drawing into an immutable object for +use on the display queue. The display and drawRect implementations MUST be thread-safe, as they can be called on +the displayQueue (asynchronously) or the main thread (synchronously/displayImmediately).

+ +

Class methods that require passing in copies of the values are used to minimize the need for locking around instance +variable access, and the possibility of the asynchronous display pass grabbing an inconsistent state across multiple +variables.

+
+ + + + + +
+ + + + +

Properties

+ +
+
+ +

  calculatedLayout +

+ +
+
+ +
+ + +
+

Return the calculated layout.

+
+ + + +
@property (nullable, nonatomic, readonly, assign) ASLayout *calculatedLayout
+ + + + + +
+

Return Value

+

Layout that wraps calculated size returned by -calculateSizeThatFits: (in manual layout mode), +or layout already calculated from layout spec returned by -layoutSpecThatFits: (in automatic layout mode).

+
+ + + + + +
+

Discussion

+

For node subclasses that implement manual layout (e.g., they have a custom -layout method), +calculatedLayout may be accessed on subnodes to retrieved cached information about their size. +This allows -layout to be very fast, saving time on the main thread. +Note: .calculatedLayout will only be set for nodes that have had -measure: called on them. +For manual layout, make sure you call -measure: in your implementation of -calculateSizeThatFits:.

+ +

For node subclasses that use automatic layout (e.g., they implement -layoutSpecThatFits:), +it is typically not necessary to use .calculatedLayout at any point. For these nodes, +the ASLayoutSpec implementation will automatically call -measureWithSizeRange: on all of the subnodes, +and the ASDisplayNode base class implementation of -layout will automatically make use of .calculatedLayout on the subnodes.

Warning: Subclasses must not override this; it returns the last cached layout and is never expensive.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+
+ + + +

View Lifecycle

+ +
+
+ +

– didLoad +

+ +
+
+ +
+ + +
+

Called on the main thread immediately after self.view is created.

+
+ + + +
- (void)didLoad
+ + + + + + + + + +
+

Discussion

+

This is the best time to add gesture recognizers to the view.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+
+ + + +

Layout

+ +
+
+ +

– layout +

+ +
+
+ +
+ + +
+

Called on the main thread by the view’s -layoutSubviews.

+
+ + + +
- (void)layout
+ + + + + + + + + +
+

Discussion

+

Subclasses override this method to layout all subnodes or subviews.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– layoutDidFinish +

+ +
+
+ +
+ + +
+

Called on the main thread by the view’s -layoutSubviews, after -layout.

+
+ + + +
- (void)layoutDidFinish
+ + + + + + + + + +
+

Discussion

+

Gives a chance for subclasses to perform actions after the subclass and superclass have finished laying +out.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– calculatedLayoutDidChange +

+ +
+
+ +
+ + +
+

Called on a background thread if !isNodeLoaded - called on the main thread if isNodeLoaded.

+
+ + + +
- (void)calculatedLayoutDidChange
+ + + + + + + + + +
+

Discussion

+

When the .calculatedLayout property is set to a new ASLayout (directly from -calculateLayoutThatFits: or +calculated via use of -layoutSpecThatFits:), subclasses may inspect it here.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+
+ + + +

Layout calculation

+ +
+
+ +

– calculateLayoutThatFits: +

+ +
+
+ +
+ + +
+

Calculate a layout based on given size range.

+
+ + + +
- (ASLayout *)calculateLayoutThatFits:(ASSizeRange)constrainedSize
+ + + +
+

Parameters

+ + + + + + + +
constrainedSize

The minimum and maximum sizes the receiver should fit in.

+
+ + + +
+

Return Value

+

An ASLayout instance defining the layout of the receiver (and its children, if the box layout model is used).

+
+ + + + + +
+

Discussion

+

This method is called on a non-main thread. The default implementation calls either -layoutSpecThatFits: +or -calculateSizeThatFits:, whichever method is overriden. Subclasses rarely need to override this method, +override -layoutSpecThatFits: or -calculateSizeThatFits: instead.

Note: This method should not be called directly outside of ASDisplayNode; use -measure: or -calculatedLayout instead.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– calculateLayoutThatFits:restrictedToSize:relativeToParentSize: +

+ +
+
+ +
+ + +
+

ASDisplayNode’s implementation of -layoutThatFits:parentSize: calls this method to resolve the node’s size +against parentSize, intersect it with constrainedSize, and call -calculateLayoutThatFits: with the result.

+
+ + + +
- (ASLayout *)calculateLayoutThatFits:(ASSizeRange)constrainedSize restrictedToSize:(ASLayoutElementSize)size relativeToParentSize:(CGSize)parentSize
+ + + + + + + + + +
+

Discussion

+

In certain advanced cases, you may want to customize this logic. Overriding this method allows you to receive all +three parameters and do the computation yourself.

Warning: Overriding this method should be done VERY rarely.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– calculateSizeThatFits: +

+ +
+
+ +
+ + +
+

Return the calculated size.

+
+ + + +
- (CGSize)calculateSizeThatFits:(CGSize)constrainedSize
+ + + +
+

Parameters

+ + + + + + + +
constrainedSize

The maximum size the receiver should fit in.

+
+ + + + + + + +
+

Discussion

+

Subclasses that override should expect this method to be called on a non-main thread. The returned size +is wrapped in an ASLayout and cached for quick access during -layout. Other expensive work that needs to +be done before display can be performed here, and using ivars to cache any valuable intermediate results is +encouraged.

Note: Subclasses that override are committed to manual layout. Therefore, -layout: must be overriden to layout all subnodes or subviews.

Note: This method should not be called directly outside of ASDisplayNode; use -layoutThatFits: or layoutThatFits:parentSize: instead.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– layoutSpecThatFits: +

+ +
+
+ +
+ + +
+

Return a layout spec that describes the layout of the receiver and its children.

+
+ + + +
- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
+ + + +
+

Parameters

+ + + + + + + +
constrainedSize

The minimum and maximum sizes the receiver should fit in.

+
+ + + + + + + +
+

Discussion

+

Subclasses that override should expect this method to be called on a non-main thread. The returned layout spec +is used to calculate an ASLayout and cached by ASDisplayNode for quick access during -layout. Other expensive work that needs to +be done before display can be performed here, and using ivars to cache any valuable intermediate results is +encouraged.

Note: This method should not be called directly outside of ASDisplayNode; use -measure: or -calculatedLayout instead.

Warning: Subclasses that implement -layoutSpecThatFits: must not use .layoutSpecBlock. Doing so will trigger an +exception. A future version of the framework may support using both, calling them serially, with the .layoutSpecBlock +superseding any values set by the method override.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– invalidateCalculatedLayout +

+ +
+
+ +
+ + +
+

Invalidate previously measured and cached layout.

+
+ + + +
- (void)invalidateCalculatedLayout
+ + + + + + + + + +
+

Discussion

+

Subclasses should call this method to invalidate the previously measured and cached layout for the display +node, when the contents of the node change in such a way as to require measuring it again.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+
+ + + +

Drawing

+ +
+
+ +

+ drawRect:withParameters:isCancelled:isRasterizing: +

+ +
+
+ +
+ + +
+

@summary Delegate method to draw layer contents into a CGBitmapContext. The current UIGraphics context will be set +to an appropriate context.

+
+ + + +
+ (void)drawRect:(CGRect)bounds withParameters:(nullable id<NSObject>)parameters isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
bounds

Region to draw in.

parameters

An object describing all of the properties you need to draw. Return this from +-drawParametersForAsyncLayer:

isCancelledBlock

Execute this block to check whether the current drawing operation has been cancelled to avoid +unnecessary work. A return value of YES means cancel drawing and return.

isRasterizing

YES if the layer is being rasterized into another layer, in which case drawRect: probably wants +to avoid doing things like filling its bounds with a zero-alpha color to clear the backing store.

+
+ + + + + + + +
+

Discussion

+

Note: Called on the display queue and/or main queue (MUST BE THREAD SAFE)

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

+ displayWithParameters:isCancelled: +

+ +
+
+ +
+ + +
+

@summary Delegate override to provide new layer contents as a UIImage.

+
+ + + +
+ (nullable UIImage *)displayWithParameters:(nullable id<NSObject>)parameters isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock
+ + + +
+

Parameters

+ + + + + + + + + + + + +
parameters

An object describing all of the properties you need to draw. Return this from +-drawParametersForAsyncLayer:

isCancelledBlock

Execute this block to check whether the current drawing operation has been cancelled to avoid +unnecessary work. A return value of YES means cancel drawing and return.

+
+ + + +
+

Return Value

+

A UIImage with contents that are ready to display on the main thread. Make sure that the image is already +decoded before returning it here.

+
+ + + + + +
+

Discussion

+

Note: Called on the display queue and/or main queue (MUST BE THREAD SAFE)

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– drawParametersForAsyncLayer: +

+ +
+
+ +
+ + +
+

Delegate override for drawParameters

+
+ + + +
- (nullable id<NSObject>)drawParametersForAsyncLayer:(_ASDisplayLayer *)layer
+ + + +
+

Parameters

+ + + + + + + +
layer

The layer that will be drawn into.

+
+ + + + + + + +
+

Discussion

+

Note: Called on the main thread only

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– displayWillStart +

+ +
+
+ +
+ + +
+

Indicates that the receiver is about to display.

+
+ + + +
- (void)displayWillStart
+ + + + + + + + + +
+

Discussion

+

Subclasses may override this method to be notified when display (asynchronous or synchronous) is +about to begin.

Note: Called on the main thread only

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– displayDidFinish +

+ +
+
+ +
+ + +
+

Indicates that the receiver has finished displaying.

+
+ + + +
- (void)displayDidFinish
+ + + + + + + + + +
+

Discussion

+

Subclasses may override this method to be notified when display (asynchronous or synchronous) has +completed.

Note: Called on the main thread only

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+
+ + + +

Observing node-related changes

+ +
+
+ +

– interfaceStateDidChange:fromState: +

+ +
+
+ +
+ + +
+

Called whenever any bit in the ASInterfaceState bitfield is changed.

+
+ + + +
- (void)interfaceStateDidChange:(ASInterfaceState)newState fromState:(ASInterfaceState)oldState
+ + + + + + + + + +
+

Discussion

+

Subclasses may use this to monitor when they become visible, should free cached data, and much more.

+
+ + + + + +
+

See Also

+ +
+ + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– didEnterVisibleState +

+ +
+
+ +
+ + +
+

Called whenever the node becomes visible.

+
+ + + +
- (void)didEnterVisibleState
+ + + + + + + + + +
+

Discussion

+

Subclasses may use this to monitor when they become visible.

Note: This method is guaranteed to be called on main.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– didExitVisibleState +

+ +
+
+ +
+ + +
+

Called whenever the node is no longer visible.

+
+ + + +
- (void)didExitVisibleState
+ + + + + + + + + +
+

Discussion

+

Subclasses may use this to monitor when they are no longer visible.

Note: This method is guaranteed to be called on main.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– didEnterDisplayState +

+ +
+
+ +
+ + +
+

Called whenever the the node has entered the display state.

+
+ + + +
- (void)didEnterDisplayState
+ + + + + + + + + +
+

Discussion

+

Subclasses may use this to monitor when a node should be rendering its content.

Note: This method is guaranteed to be called on main.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– didExitDisplayState +

+ +
+
+ +
+ + +
+

Called whenever the the node has exited the display state.

+
+ + + +
- (void)didExitDisplayState
+ + + + + + + + + +
+

Discussion

+

Subclasses may use this to monitor when a node should no longer be rendering its content.

Note: This method is guaranteed to be called on main.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– didEnterPreloadState +

+ +
+
+ +
+ + +
+

Called whenever the the node has entered the preload state.

+
+ + + +
- (void)didEnterPreloadState
+ + + + + + + + + +
+

Discussion

+

Subclasses may use this to monitor data for a node should be preloaded, either from a local or remote source.

Note: This method is guaranteed to be called on main.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– didExitPreloadState +

+ +
+
+ +
+ + +
+

Called whenever the the node has exited the preload state.

+
+ + + +
- (void)didExitPreloadState
+ + + + + + + + + +
+

Discussion

+

Subclasses may use this to monitor whether preloading data for a node should be canceled.

Note: This method is guaranteed to be called on main.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– willEnterHierarchy +

+ +
+
+ +
+ + +
+

Called just before the view is added to a window.

+
+ + + +
- (void)willEnterHierarchy
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– didExitHierarchy +

+ +
+
+ +
+ + +
+

Called after the view is removed from the window.

+
+ + + +
- (void)didExitHierarchy
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

  inHierarchy +

+ +
+
+ +
+ + +
+

Whether the view or layer of this display node is currently in a window

+
+ + + +
@property (nonatomic, readonly, assign, getter=isInHierarchy) BOOL inHierarchy
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– fetchData +

+ +
+
+ +
+ + +
+

Indicates that the node should fetch any external data, such as images.

+
+ + + +
- (void)fetchData
+ + + + + + + + + +
+

Discussion

+

Subclasses may override this method to be notified when they should begin to fetch data. Fetching +should be done asynchronously. The node is also responsible for managing the memory of any data. +The data may be remote and accessed via the network, but could also be a local database query.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– clearFetchedData +

+ +
+
+ +
+ + +
+

Provides an opportunity to clear any fetched data (e.g. remote / network or database-queried) on the current node.

+
+ + + +
- (void)clearFetchedData
+ + + + + + + + + +
+

Discussion

+

This will not clear data recursively for all subnodes. Either call -recursivelyClearFetchedData or +selectively clear fetched data.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– clearContents +

+ +
+
+ +
+ + +
+

Provides an opportunity to clear backing store and other memory-intensive intermediates, such as text layout managers +on the current node.

+
+ + + +
- (void)clearContents
+ + + + + + + + + +
+

Discussion

+

Called by -recursivelyClearContents. Base class implements self.contents = nil, clearing any backing +store, for asynchronous regeneration when needed.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– subnodeDisplayWillStart: +

+ +
+
+ +
+ + +
+

Indicates that the receiver is about to display its subnodes. This method is not called if there are no +subnodes present.

+
+ + + +
- (void)subnodeDisplayWillStart:(ASDisplayNode *)subnode
+ + + +
+

Parameters

+ + + + + + + +
subnode

The subnode of which display is about to begin.

+
+ + + + + + + +
+

Discussion

+

Subclasses may override this method to be notified when subnode display (asynchronous or synchronous) is +about to begin.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– subnodeDisplayDidFinish: +

+ +
+
+ +
+ + +
+

Indicates that the receiver is finished displaying its subnodes. This method is not called if there are +no subnodes present.

+
+ + + +
- (void)subnodeDisplayDidFinish:(ASDisplayNode *)subnode
+ + + +
+

Parameters

+ + + + + + + +
subnode

The subnode of which display is about to completed.

+
+ + + + + + + +
+

Discussion

+

Subclasses may override this method to be notified when subnode display (asynchronous or synchronous) has +completed.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– setNeedsDisplayAtScale: +

+ +
+
+ +
+ + +
+

Marks the receiver’s bounds as needing to be redrawn, with a scale value.

+
+ + + +
- (void)setNeedsDisplayAtScale:(CGFloat)contentsScale
+ + + +
+

Parameters

+ + + + + + + +
contentsScale

The scale at which the receiver should be drawn.

+
+ + + + + + + +
+

Discussion

+

Subclasses should override this if they don’t want their contentsScale changed.

Note: This changes an internal property. +-setNeedsDisplay is also available to trigger display without changing contentsScaleForDisplay.

+
+ + + + + +
+

See Also

+ +
+ + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– recursivelySetNeedsDisplayAtScale: +

+ +
+
+ +
+ + +
+

Recursively calls setNeedsDisplayAtScale: on subnodes.

+
+ + + +
- (void)recursivelySetNeedsDisplayAtScale:(CGFloat)contentsScale
+ + + +
+

Parameters

+ + + + + + + +
contentsScale

The scale at which the receiver’s subnode hierarchy should be drawn.

+
+ + + + + + + +
+

Discussion

+

Subclasses may override this if they require modifying the scale set on their child nodes.

Note: Only the node tree is walked, not the view or layer trees.

+
+ + + + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

  contentsScaleForDisplay +

+ +
+
+ +
+ + +
+

The scale factor to apply to the rendering.

+
+ + + +
@property (nonatomic, assign, readonly) CGFloat contentsScaleForDisplay
+ + + + + + + + + +
+

Discussion

+

Use setNeedsDisplayAtScale: to set a value and then after display, the display node will set the layer’s +contentsScale. This is to prevent jumps when re-rasterizing at a different contentsScale. +Read this property if you need to know the future contentsScale of your layer, eg in drawParameters.

+
+ + + + + +
+

See Also

+ +
+ + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+
+ + + +

Touch handling

+ +
+
+ +

– touchesBegan:withEvent: +

+ +
+
+ +
+ + +
+

Tells the node when touches began in its view.

+
+ + + +
- (void)touchesBegan:(NSSet<UITouch*> *)touches withEvent:(nullable UIEvent *)event
+ + + +
+

Parameters

+ + + + + + + + + + + + +
touches

A set of UITouch instances.

event

A UIEvent associated with the touch.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– touchesMoved:withEvent: +

+ +
+
+ +
+ + +
+

Tells the node when touches moved in its view.

+
+ + + +
- (void)touchesMoved:(NSSet<UITouch*> *)touches withEvent:(nullable UIEvent *)event
+ + + +
+

Parameters

+ + + + + + + + + + + + +
touches

A set of UITouch instances.

event

A UIEvent associated with the touch.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– touchesEnded:withEvent: +

+ +
+
+ +
+ + +
+

Tells the node when touches ended in its view.

+
+ + + +
- (void)touchesEnded:(NSSet<UITouch*> *)touches withEvent:(nullable UIEvent *)event
+ + + +
+

Parameters

+ + + + + + + + + + + + +
touches

A set of UITouch instances.

event

A UIEvent associated with the touch.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– touchesCancelled:withEvent: +

+ +
+
+ +
+ + +
+

Tells the node when touches was cancelled in its view.

+
+ + + +
- (void)touchesCancelled:(nullable NSSet<UITouch*> *)touches withEvent:(nullable UIEvent *)event
+ + + +
+

Parameters

+ + + + + + + + + + + + +
touches

A set of UITouch instances.

event

A UIEvent associated with the touch.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+
+ + + +

Managing Gesture Recognizers

+ +
+
+ +

– gestureRecognizerShouldBegin: +

+ +
+
+ +
+ + +
+

Asks the node if a gesture recognizer should continue tracking touches.

+
+ + + +
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
+ + + +
+

Parameters

+ + + + + + + +
gestureRecognizer

A gesture recognizer trying to recognize a gesture.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+
+ + + +

Hit Testing

+ +
+
+ +

– hitTest:withEvent: +

+ +
+
+ +
+ + +
+

Returns the view that contains the point.

+
+ + + +
- (nullable UIView *)hitTest:(CGPoint)point withEvent:(nullable UIEvent *)event
+ + + +
+

Parameters

+ + + + + + + + + + + + +
point

A point specified in the node’s local coordinate system (bounds).

event

The event that warranted a call to this method.

+
+ + + +
+

Return Value

+

Returns a UIView, not ASDisplayNode, for two reasons: +1) allows sending events to plain UIViews that don’t have attached nodes, +2) hitTest: is never called before the views are created.

+
+ + + + + +
+

Discussion

+

Override to make this node respond differently to touches: (e.g. hide touches from subviews, send all +touches to certain subviews (hit area maximizing), etc.)

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+
+ + + +

Placeholders

+ +
+
+ +

– placeholderImage +

+ +
+
+ +
+ + +
+

Optionally provide an image to serve as the placeholder for the backing store while the contents are being +displayed.

+
+ + + +
- (nullable UIImage *)placeholderImage
+ + + + + + + + + +
+

Discussion

+

Note: Called on the display queue and/or main queue (MUST BE THREAD SAFE)

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+
+ + + +

Description

+ +
+
+ +

– descriptionForRecursiveDescription +

+ +
+
+ +
+ + +
+

Return a description of the node

+
+ + + +
- (NSString *)descriptionForRecursiveDescription
+ + + + + + + + + +
+

Discussion

+

The function that gets called for each display node in -recursiveDescription

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+ +

– asyncTraitCollectionDidChange +

+ +
+
+ +
+ + +
+

Called when the node’s ASTraitCollection changes

+
+ + + +
- (void)asyncTraitCollectionDidChange
+ + + + + + + + + +
+

Discussion

+

Subclasses can override this method to react to a trait collection change.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode+Subclasses.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/ASDisplayNode+UIViewBridge.html b/docs/appledoc/Categories/ASDisplayNode+UIViewBridge.html new file mode 100755 index 00000000..97f565ab --- /dev/null +++ b/docs/appledoc/Categories/ASDisplayNode+UIViewBridge.html @@ -0,0 +1,348 @@ + + + + + + ASDisplayNode(UIViewBridge) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASDisplayNode(UIViewBridge) Category Reference

+ + +
+ + + + +
Declared inASDisplayNode.h
+ + + + +
+ +

Overview

+

UIView bridge

+ +

ASDisplayNode provides thread-safe access to most of UIView and CALayer properties and methods, traditionally unsafe.

+ +

Using them will not cause the actual view/layer to be created, and will be applied when it is created (when the view +or layer property is accessed).

+ +
    +
  • NOTE: After the view or layer is created, the properties pass through to the view or layer directly and must be called on the main thread.
  • +
+ + +

See UIView and CALayer for documentation on these common properties.

+
+ + + + + +
+ + + + + + +
+
+ +

– setNeedsDisplay +

+ +
+
+ +
+ + +
+

Marks the view as needing display. Convenience for use whether the view / layer is loaded or not. Safe to call from a background thread.

+
+ + + +
- (void)setNeedsDisplay
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

– setNeedsLayout +

+ +
+
+ +
+ + +
+

Marks the node as needing layout. Convenience for use whether the view / layer is loaded or not. Safe to call from a background thread.

+
+ + + +
- (void)setNeedsLayout
+ + + + + + + + + +
+

Discussion

+

If this node was measured, calling this method triggers an internal relayout: the calculated layout is invalidated, +and the supernode is notified or (if this node is the root one) a full measurement pass is executed using the old constrained size.

+ +

Note: ASCellNode has special behavior in that calling this method will automatically notify +the containing ASTableView / ASCollectionView that the cell should be resized, if necessary.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

  backgroundColor +

+ +
+
+ +
+ + +
+

The node view’s background color.

+
+ + + +
@property (nonatomic, strong, nullable) UIColor *backgroundColor
+ + + + + + + + + +
+

Discussion

+

In contrast to UIView, setting a transparent color will not set opaque = NO. +This only affects nodes that implement +drawRect like ASTextNode.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

  contentMode +

+ +
+
+ +
+ + +
+

A flag used to determine how a node lays out its content when its bounds change.

+
+ + + +
@property (nonatomic, assign) UIViewContentMode contentMode
+ + + + + + + + + +
+

Discussion

+

This is like UIView’s contentMode property, but better. We do our own mapping to layer.contentsGravity in +_ASDisplayView. You can set needsDisplayOnBoundsChange independently. +Thus, UIViewContentModeRedraw is not allowed; use needsDisplayOnBoundsChange = YES instead, and pick an appropriate +contentMode for your content while it’s being re-rendered.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/ASImageNode+AnimatedImage.html b/docs/appledoc/Categories/ASImageNode+AnimatedImage.html new file mode 100755 index 00000000..ff83bcb3 --- /dev/null +++ b/docs/appledoc/Categories/ASImageNode+AnimatedImage.html @@ -0,0 +1,275 @@ + + + + + + ASImageNode(AnimatedImage) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASImageNode(AnimatedImage) Category Reference

+ + +
+ + + + +
Declared inASImageNode.h
+ + + + + + +
+ + + + + + +
+
+ +

  animatedImage +

+ +
+
+ +
+ + +
+

The animated image to playback

+
+ + + +
@property (nullable, nonatomic, strong) id<ASAnimatedImageProtocol> animatedImage
+ + + + + + + + + +
+

Discussion

+

Set this to an object which conforms to ASAnimatedImageProtocol +to have the ASImageNode playback an animated image.

+
+ + + + + + + +
+

Declared In

+

ASImageNode.h

+
+ + +
+
+
+ +

  animatedImagePaused +

+ +
+
+ +
+ + +
+

Pause the playback of an animated image.

+
+ + + +
@property (nonatomic, assign) BOOL animatedImagePaused
+ + + + + + + + + +
+

Discussion

+

Set to YES to pause playback of an animated image and NO to resume +playback.

+
+ + + + + + + +
+

Declared In

+

ASImageNode.h

+
+ + +
+
+
+ +

  animatedImageRunLoopMode +

+ +
+
+ +
+ + +
+

The runloop mode used to animate the image.

+
+ + + +
@property (nonatomic, strong) NSString *animatedImageRunLoopMode
+ + + + + + + + + +
+

Discussion

+

Defaults to NSRunLoopCommonModes. Another commonly used mode is NSDefaultRunLoopMode. +Setting NSDefaultRunLoopMode will cause animation to pause while scrolling (if the ASImageNode is +in a scroll view), which may improve scroll performance in some use cases.

+
+ + + + + + + +
+

Declared In

+

ASImageNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/ASImageNode+Debugging.html b/docs/appledoc/Categories/ASImageNode+Debugging.html new file mode 100755 index 00000000..d60ea6fd --- /dev/null +++ b/docs/appledoc/Categories/ASImageNode+Debugging.html @@ -0,0 +1,184 @@ + + + + + + ASImageNode(Debugging) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASImageNode(Debugging) Category Reference

+ + +
+ + + + +
Declared inAsyncDisplayKit+Debug.h
+ + + + + + +
+ + + + + + +
+
+ +

+ setShouldShowImageScalingOverlay: +

+ +
+
+ +
+ + +
+

Enables an ASImageNode debug label that shows the ratio of pixels in the source image to those in +the displayed bounds (including cropRect). This helps detect excessive image fetching / downscaling, +as well as upscaling (such as providing a URL not suitable for a Retina device). For dev purposes only.

+
+ + + +
+ (void)setShouldShowImageScalingOverlay:(BOOL)show
+ + + +
+

Parameters

+ + + + + + + +
enabled

Specify YES to show the label on all ASImageNodes with non-1.0x source-to-bounds pixel ratio.

+
+ + + + + + + + + + + + + +
+

Declared In

+

AsyncDisplayKit+Debug.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/ASLayout+.html b/docs/appledoc/Categories/ASLayout+.html new file mode 100755 index 00000000..f07aea41 --- /dev/null +++ b/docs/appledoc/Categories/ASLayout+.html @@ -0,0 +1,175 @@ + + + + + + ASLayout() Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASLayout() Category Reference

+ + +
+ + + + +
Declared inASLayoutSpec+Subclasses.h
+ + + + + + +
+ + + + + + +
+
+ +

  position +

+ +
+
+ +
+ + +
+

Position in parent. Default to CGPointNull.

+
+ + + +
@property (nonatomic, assign, readwrite) CGPoint position
+ + + + + + + + + +
+

Discussion

+

When being used as a sublayout, this property must not equal CGPointNull.

+
+ + + + + + + +
+

Declared In

+

ASLayoutSpec+Subclasses.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/ASLayout+Debugging.html b/docs/appledoc/Categories/ASLayout+Debugging.html new file mode 100755 index 00000000..0b9fc0a9 --- /dev/null +++ b/docs/appledoc/Categories/ASLayout+Debugging.html @@ -0,0 +1,170 @@ + + + + + + ASLayout(Debugging) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASLayout(Debugging) Category Reference

+ + +
+ + + + +
Declared inASLayout.h
+ + + + + + +
+ + + + + + +
+
+ +

– recursiveDescription +

+ +
+
+ +
+ + +
+

Recrusively output the description of the layout tree.

+
+ + + +
- (NSString *)recursiveDescription
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASLayout.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/ASLayoutElementStyle+.html b/docs/appledoc/Categories/ASLayoutElementStyle+.html new file mode 100755 index 00000000..0bc980f5 --- /dev/null +++ b/docs/appledoc/Categories/ASLayoutElementStyle+.html @@ -0,0 +1,221 @@ + + + + + + ASLayoutElementStyle() Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASLayoutElementStyle() Category Reference

+ + +
+ + + + + + + +
Conforms toASDescriptionProvider
Declared inASLayoutElementStylePrivate.h
+ + + + + + +
+ + + + + + +
+
+ +

  delegate +

+ +
+
+ +
+ + +
+

The object that acts as the delegate of the style.

+
+ + + +
@property (nullable, nonatomic, weak) id<ASLayoutElementStyleDelegate> delegate
+ + + + + + + + + +
+

Discussion

+

The delegate must adopt the ASLayoutElementStyleDelegate protocol. The delegate is not retained.

+
+ + + + + + + +
+

Declared In

+

ASLayoutElementStylePrivate.h

+
+ + +
+
+
+ +

  size +

+ +
+
+ +
+ + +
+

A size constraint that should apply to this ASLayoutElement.

+
+ + + +
@property (nonatomic, assign, readonly) ASLayoutElementSize size
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASLayoutElementStylePrivate.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/ASLayoutSpec+Debugging.html b/docs/appledoc/Categories/ASLayoutSpec+Debugging.html new file mode 100755 index 00000000..c039aa22 --- /dev/null +++ b/docs/appledoc/Categories/ASLayoutSpec+Debugging.html @@ -0,0 +1,173 @@ + + + + + + ASLayoutSpec(Debugging) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASLayoutSpec(Debugging) Category Reference

+ + +
+ + + + + + + +
Conforms toASLayoutElementAsciiArtProtocol
Declared inASLayoutSpec.h
+ + + + + + +
+ + + + + + +
+
+ +

+ asciiArtStringForChildren:parentName:direction: +

+ +
+
+ +
+ + +
+

Used by other layout specs to create ascii art debug strings

+
+ + + +
+ (NSString *)asciiArtStringForChildren:(NSArray *)children parentName:(NSString *)parentName direction:(ASStackLayoutDirection)direction
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASLayoutSpec.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/ASLayoutSpec+Subclassing.html b/docs/appledoc/Categories/ASLayoutSpec+Subclassing.html new file mode 100755 index 00000000..177cf376 --- /dev/null +++ b/docs/appledoc/Categories/ASLayoutSpec+Subclassing.html @@ -0,0 +1,315 @@ + + + + + + ASLayoutSpec(Subclassing) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASLayoutSpec(Subclassing) Category Reference

+ + +
+ + + + +
Declared inASLayoutSpec+Subclasses.h
+ + + + + + +
+ + + + + + +
+
+ +

– layoutElementToAddFromLayoutElement: +

+ +
+
+ +
+ + +
+

Helper method for finalLayoutElement support

+
+ + + +
- (id<ASLayoutElement>)layoutElementToAddFromLayoutElement:(id<ASLayoutElement>)child
+ + + + + + + + + +
+

Discussion

+

Warning: If you are getting recursion crashes here after implementing finalLayoutElement, make sure +that you are setting isFinalLayoutElement flag to YES. This must be one BEFORE adding a child +to the new ASLayoutElement.

+ +

For example: +- (idASLayoutElement)finalLayoutElement +{ +ASInsetLayoutSpec *insetSpec = [[ASInsetLayoutSpec alloc] init]; +insetSpec.insets = UIEdgeInsetsMake(10,10,10,10); +insetSpec.isFinalLayoutElement = YES; +[insetSpec setChild:self]; +return insetSpec; +}

+
+ + + + + + + +
+

Declared In

+

ASLayoutSpec+Subclasses.h

+
+ + +
+
+
+ +

– setChild:atIndex: +

+ +
+
+ +
+ + +
+

Adds a child with the given identifier to this layout spec.

+
+ + + +
- (void)setChild:(id<ASLayoutElement>)child atIndex:(NSUInteger)index
+ + + +
+

Parameters

+ + + + + + + + + + + + +
child

A child to be added.

index

An index associated with the child.

+
+ + + + + + + +
+

Discussion

+

Every ASLayoutSpec must act on at least one child. The ASLayoutSpec base class takes the +responsibility of holding on to the spec children. Some layout specs, like ASInsetLayoutSpec, +only require a single child.

+ +

For layout specs that require a known number of children (ASBackgroundLayoutSpec, for example) +a subclass can use the setChild method to set the “primary” child. It should then use this method +to set any other required children. Ideally a subclass would hide this from the user, and use the +setChild:forIndex: internally. For example, ASBackgroundLayoutSpec exposes a backgroundChild +property that behind the scenes is calling setChild:forIndex:.

+
+ + + + + + + +
+

Declared In

+

ASLayoutSpec+Subclasses.h

+
+ + +
+
+
+ +

– childAtIndex: +

+ +
+
+ +
+ + +
+

Returns the child added to this layout spec using the given index.

+
+ + + +
- (nullable id<ASLayoutElement>)childAtIndex:(NSUInteger)index
+ + + +
+

Parameters

+ + + + + + + +
index

An identifier associated with the the child.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASLayoutSpec+Subclasses.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/ASRangeController+ASRangeControllerUpdateRangeProtocol.html b/docs/appledoc/Categories/ASRangeController+ASRangeControllerUpdateRangeProtocol.html new file mode 100755 index 00000000..cbdbcb32 --- /dev/null +++ b/docs/appledoc/Categories/ASRangeController+ASRangeControllerUpdateRangeProtocol.html @@ -0,0 +1,198 @@ + + + + + + ASRangeController(ASRangeControllerUpdateRangeProtocol) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASRangeController(ASRangeControllerUpdateRangeProtocol) Category Reference

+ + +
+ + + + + + + +
Conforms toASRangeControllerUpdateRangeProtocol
Declared inASRangeController.h
+ + + + + + +
+ + + + + + +
+
+ +

– updateCurrentRangeWithMode: +

+ +
+
+ +
+ + +
+
    +
  • Update the range mode for a range controller to a explicitly set mode until the node that contains the range
  • +
  • controller becomes visible again +*
  • +
  • Logic for the automatic range mode:
  • +
    1. +
    2. If there are no visible node paths available nothing is to be done and no range update will happen
    3. +
    +
  • +
    1. +
    2. The initial range update if the range controller is visible always will be ASLayoutRangeModeCount
    3. +
    +
  • +
  • (ASLayoutRangeModeMinimum) as it’s the initial fetch
  • +
    1. +
    2. The range mode set explicitly via updateCurrentRangeWithMode: will last at least one range update. After that it +the range controller will use the explicit set range mode until it becomes visible and a new range update was +triggered or a new range mode via updateCurrentRangeWithMode: is set
    3. +
    +
  • +
    1. +
    2. If range mode is not explicitly set the range mode is variying based if the range controller is visible or not
    3. +
    +
  • +
+ +
+ + + +
- (void)updateCurrentRangeWithMode:(ASLayoutRangeMode)rangeMode
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASRangeController.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/ASRangeController+Debugging.html b/docs/appledoc/Categories/ASRangeController+Debugging.html new file mode 100755 index 00000000..e85b0d47 --- /dev/null +++ b/docs/appledoc/Categories/ASRangeController+Debugging.html @@ -0,0 +1,183 @@ + + + + + + ASRangeController(Debugging) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASRangeController(Debugging) Category Reference

+ + +
+ + + + +
Declared inAsyncDisplayKit+Debug.h
+ + + + + + +
+ + + + + + +
+
+ +

+ setShouldShowRangeDebugOverlay: +

+ +
+
+ +
+ + +
+

Class method to enable a visualization overlay of the all ASRangeController’s tuning parameters. For dev purposes only. +To use, message ASRangeController in the AppDelegate –> [ASRangeController setShouldShowRangeDebugOverlay:YES];

+
+ + + +
+ (void)setShouldShowRangeDebugOverlay:(BOOL)show
+ + + +
+

Parameters

+ + + + + + + +
enable

Specify YES to make this debug feature enabled when messaging the ASRangeController class.

+
+ + + + + + + + + + + + + +
+

Declared In

+

AsyncDisplayKit+Debug.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/ASTableView+Deprecated.html b/docs/appledoc/Categories/ASTableView+Deprecated.html new file mode 100755 index 00000000..c13c9fc8 --- /dev/null +++ b/docs/appledoc/Categories/ASTableView+Deprecated.html @@ -0,0 +1,948 @@ + + + + + + ASTableView(Deprecated) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASTableView(Deprecated) Category Reference

+ + +
+ + + + +
Declared inASTableView.h
+ + + + + + +
+ + + + + + +
+
+ +

– initWithFrame:style: +

+ +
+
+ +
+ + +
+

Initializer.

+
+ + + +
- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style
+ + + +
+

Parameters

+ + + + + + + + + + + + +
frame

A rectangle specifying the initial location and size of the table view in its superview’€™s coordinates. +The frame of the table view changes as table cells are added and deleted.

style

A constant that specifies the style of the table view. See UITableViewStyle for descriptions of valid constants.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASTableView.h

+
+ + +
+
+
+ +

– tuningParametersForRangeType: +

+ +
+
+ +
+ + +
+

Tuning parameters for a range type in full mode.

+
+ + + +
- (ASRangeTuningParameters)tuningParametersForRangeType:(ASLayoutRangeType)rangeType
+ + + +
+

Parameters

+ + + + + + + +
rangeType

The range type to get the tuning parameters for.

+
+ + + +
+

Return Value

+

A tuning parameter value for the given range type in full mode.

+
+ + + + + + + + + + + +
+

Declared In

+

ASTableView.h

+
+ + +
+
+
+ +

– setTuningParameters:forRangeType: +

+ +
+
+ +
+ + +
+

Set the tuning parameters for a range type in full mode.

+
+ + + +
- (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeType:(ASLayoutRangeType)rangeType
+ + + +
+

Parameters

+ + + + + + + + + + + + +
tuningParameters

The tuning parameters to store for a range type.

rangeType

The range type to set the tuning parameters for.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASTableView.h

+
+ + +
+
+
+ +

– tuningParametersForRangeMode:rangeType: +

+ +
+
+ +
+ + +
+

Tuning parameters for a range type in the specified mode.

+
+ + + +
- (ASRangeTuningParameters)tuningParametersForRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType
+ + + +
+

Parameters

+ + + + + + + + + + + + +
rangeMode

The range mode to get the running parameters for.

rangeType

The range type to get the tuning parameters for.

+
+ + + +
+

Return Value

+

A tuning parameter value for the given range type in the given mode.

+
+ + + + + + + + + + + +
+

Declared In

+

ASTableView.h

+
+ + +
+
+
+ +

– setTuningParameters:forRangeMode:rangeType: +

+ +
+
+ +
+ + +
+

Set the tuning parameters for a range type in the specified mode.

+
+ + + +
- (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
tuningParameters

The tuning parameters to store for a range type.

rangeMode

The range mode to set the running parameters for.

rangeType

The range type to set the tuning parameters for.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASTableView.h

+
+ + +
+
+
+ +

– visibleNodes +

+ +
+
+ +
+ + +
+

Similar to -visibleCells.

+
+ + + +
- (NSArray<ASCellNode*> *)visibleNodes
+ + + + + +
+

Return Value

+

an array containing the cell nodes being displayed on screen.

+
+ + + + + + + + + + + +
+

Declared In

+

ASTableView.h

+
+ + +
+
+
+ +

– indexPathForNode: +

+ +
+
+ +
+ + +
+

Similar to -indexPathForCell:.

+
+ + + +
- (nullable NSIndexPath *)indexPathForNode:(ASCellNode *)cellNode
+ + + +
+

Parameters

+ + + + + + + +
cellNode

a cellNode part of the table view

+
+ + + +
+

Return Value

+

an indexPath for this cellNode

+
+ + + + + + + + + + + +
+

Declared In

+

ASTableView.h

+
+ + +
+
+
+ +

– reloadDataWithCompletion: +

+ +
+
+ +
+ + +
+

Reload everything from scratch, destroying the working range and all cached nodes.

+
+ + + +
- (void)reloadDataWithCompletion:(void ( ^ _Nullable ) ( ))completion
+ + + +
+

Parameters

+ + + + + + + +
completion

block to run on completion of asynchronous loading or nil. If supplied, the block is run on +the main thread.

+
+ + + + + + + +
+

Discussion

+

Warning: This method is substantially more expensive than UITableView’s version.

+
+ + + + + + + +
+

Declared In

+

ASTableView.h

+
+ + +
+
+
+ +

– reloadData +

+ +
+
+ +
+ + +
+

Reload everything from scratch, destroying the working range and all cached nodes.

+
+ + + +
- (void)reloadData
+ + + + + + + + + +
+

Discussion

+

Warning: This method is substantially more expensive than UITableView’s version.

+
+ + + + + + + +
+

Declared In

+

ASTableView.h

+
+ + +
+
+
+ +

– reloadDataImmediately +

+ +
+
+ +
+ + +
+

Reload everything from scratch entirely on the main thread, destroying the working range and all cached nodes.

+
+ + + +
- (void)reloadDataImmediately
+ + + + + + + + + +
+

Discussion

+

Warning: This method is substantially more expensive than UITableView’s version and will block the main thread while +all the cells load.

+
+ + + + + + + +
+

Declared In

+

ASTableView.h

+
+ + +
+
+
+ +

– relayoutItems +

+ +
+
+ +
+ + +
+

Triggers a relayout of all nodes.

+
+ + + +
- (void)relayoutItems
+ + + + + + + + + +
+

Discussion

+

This method invalidates and lays out every cell node in the table view.

+
+ + + + + + + +
+

Declared In

+

ASTableView.h

+
+ + +
+
+
+ +

– endUpdatesAnimated:completion: +

+ +
+
+ +
+ + +
+

Concludes a series of method calls that insert, delete, select, or reload rows and sections of the table view. +You call this method to bracket a series of method calls that begins with beginUpdates and that consists of operations +to insert, delete, select, and reload rows and sections of the table view. When you call endUpdates, ASTableView begins animating +the operations simultaneously. This method is must be called from the main thread. It’s important to remember that the ASTableView will +be processing the updates asynchronously after this call and are not guaranteed to be reflected in the ASTableView until +the completion block is executed.

+
+ + + +
- (void)endUpdatesAnimated:(BOOL)animated completion:(void ( ^ _Nullable ) ( BOOL completed ))completion
+ + + +
+

Parameters

+ + + + + + + + + + + + +
animated

NO to disable all animations.

completion

A completion handler block to execute when all of the operations are finished. This block takes a single +Boolean parameter that contains the value YES if all of the related animations completed successfully or +NO if they were interrupted. This parameter may be nil. If supplied, the block is run on the main thread.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASTableView.h

+
+ + +
+
+
+ +

– waitUntilAllUpdatesAreCommitted +

+ +
+
+ +
+ + +
+

Blocks execution of the main thread until all section and row updates are committed. This method must be called from the main thread.

+
+ + + +
- (void)waitUntilAllUpdatesAreCommitted
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASTableView.h

+
+ + +
+
+
+ +

– clearContents +

+ +
+
+ +
+ + +
+

Deprecated in 2.0. You should not call this method.

+
+ + + +
- (void)clearContents
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASTableView.h

+
+ + +
+
+
+ +

– clearFetchedData +

+ +
+
+ +
+ + +
+

Deprecated in 2.0. You should not call this method.

+
+ + + +
- (void)clearFetchedData
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASTableView.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/ASTableView+Internal.html b/docs/appledoc/Categories/ASTableView+Internal.html new file mode 100755 index 00000000..e21fda7d --- /dev/null +++ b/docs/appledoc/Categories/ASTableView+Internal.html @@ -0,0 +1,453 @@ + + + + + + ASTableView(Internal) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASTableView(Internal) Category Reference

+ + +
+ + + + +
Declared inASTableViewInternal.h
+ + + + + + +
+ + + + + + +
+
+ +

– _initWithFrame:style:dataControllerClass: +

+ +
+
+ +
+ + +
+

Initializer.

+
+ + + +
- (instancetype)_initWithFrame:(CGRect)frame style:(UITableViewStyle)style dataControllerClass:(Class)dataControllerClass
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
frame

A rectangle specifying the initial location and size of the table view in its superview’€™s coordinates. +The frame of the table view changes as table cells are added and deleted.

style

A constant that specifies the style of the table view. See UITableViewStyle for descriptions of valid constants.

dataControllerClass

A controller class injected to and used to create a data controller for the table view.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASTableViewInternal.h

+
+ + +
+
+
+ +

  test_enableSuperUpdateCallLogging +

+ +
+
+ +
+ + +
+

Set YES and we’ll log every time we call [super insertRows…] etc

+
+ + + +
@property (nonatomic) BOOL test_enableSuperUpdateCallLogging
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASTableViewInternal.h

+
+ + +
+
+
+ +

– convertIndexPathFromTableNode:waitingIfNeeded: +

+ +
+
+ +
+ + +
+

Attempt to get the view-layer index path for the row with the given index path.

+
+ + + +
- (NSIndexPath *)convertIndexPathFromTableNode:(NSIndexPath *)indexPath waitingIfNeeded:(BOOL)wait
+ + + +
+

Parameters

+ + + + + + + + + + + + +
indexPath

The index path of the row.

wait

If the item hasn’t reached the view yet, this attempts to wait for updates to commit.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASTableViewInternal.h

+
+ + +
+
+
+ +

– convertIndexPathToTableNode: +

+ +
+
+ +
+ + +
+

Attempt to get the node index path given the view-layer index path.

+
+ + + +
- (NSIndexPath *)convertIndexPathToTableNode:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + +
indexPath

The index path of the row.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASTableViewInternal.h

+
+ + +
+
+
+ +

– convertIndexPathsToTableNode: +

+ +
+
+ +
+ + +
+

Attempt to get the node index paths given the view-layer index paths.

+
+ + + +
- (NSArray<NSIndexPath*> *)convertIndexPathsToTableNode:(NSArray<NSIndexPath*> *)indexPaths
+ + + +
+

Parameters

+ + + + + + + +
indexPaths

An array of index paths in the view space

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASTableViewInternal.h

+
+ + +
+
+
+ +

– sectionIndexWidth +

+ +
+
+ +
+ + +
+

Returns the width of the section index view on the right-hand side of the table, if one is present.

+
+ + + +
- (CGFloat)sectionIndexWidth
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASTableViewInternal.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/ASTextNode+.html b/docs/appledoc/Categories/ASTextNode+.html new file mode 100755 index 00000000..ec3bdd4f --- /dev/null +++ b/docs/appledoc/Categories/ASTextNode+.html @@ -0,0 +1,226 @@ + + + + + + ASTextNode() Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASTextNode() Category Reference

+ + +
+ + + + +
Declared inASTextNode+Beta.h
+ + + + + + +
+ + + + + + +
+
+ +

  pointSizeScaleFactors +

+ +
+
+ +
+ + +
+

An array of descending scale factors that will be applied to this text node to try to make it fit within its constrained size

+
+ + + +
@property (nullable, nonatomic, copy) NSArray<NSNumber*> *pointSizeScaleFactors
+ + + + + + + + + +
+

Discussion

+

This array should be in descending order and NOT contain the scale factor 1.0. For example, it could return @[@(.9), @(.85), @(.8)]; +@default nil (no scaling)

+
+ + + + + + + +
+

Declared In

+

ASTextNode+Beta.h

+
+ + +
+
+
+ +

  textContainerInset +

+ +
+
+ +
+ + +
+

Text margins for text laid out in the text node.

+
+ + + +
@property (nonatomic, assign) UIEdgeInsets textContainerInset
+ + + + + + + + + +
+

Discussion

+

defaults to UIEdgeInsetsZero. +This property can be useful for handling text which does not fit within the view by default. An example: like UILabel, +ASTextNode will clip the left and right of the string “judar” if it’s rendered in an italicised font.

+
+ + + + + + + +
+

Declared In

+

ASTextNode+Beta.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/ASTextNode+Deprecated.html b/docs/appledoc/Categories/ASTextNode+Deprecated.html new file mode 100755 index 00000000..a310bc3f --- /dev/null +++ b/docs/appledoc/Categories/ASTextNode+Deprecated.html @@ -0,0 +1,175 @@ + + + + + + ASTextNode(Deprecated) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASTextNode(Deprecated) Category Reference

+ + +
+ + + + +
Declared inASTextNode.h
+ + + + + + + + +
+ + + + + + +
+
+ +

  ) +

+ +
+
+ +
+ + +
+

The attributedString and attributedText properties are equivalent, but attributedText is now the standard API +name in order to match UILabel and ASEditableTextNode.

+
+ + + +
@property (nullable, nonatomic, copy) NSAttributedString *ASDISPLAYNODE_DEPRECATED_MSG ( "Use .attributedText instead." )
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/ASViewController+ASRangeControllerUpdateRangeProtocol.html b/docs/appledoc/Categories/ASViewController+ASRangeControllerUpdateRangeProtocol.html new file mode 100755 index 00000000..0c0d6ab9 --- /dev/null +++ b/docs/appledoc/Categories/ASViewController+ASRangeControllerUpdateRangeProtocol.html @@ -0,0 +1,176 @@ + + + + + + ASViewController(ASRangeControllerUpdateRangeProtocol) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASViewController(ASRangeControllerUpdateRangeProtocol) Category Reference

+ + +
+ + + + +
Declared inASViewController.h
+ + + + + + +
+ + + + + + +
+
+ +

  automaticallyAdjustRangeModeBasedOnViewEvents +

+ +
+
+ +
+ + +
+

Automatically adjust range mode based on view events. If you set this to YES, the view controller or its node +must conform to the ASRangeControllerUpdateRangeProtocol.

+
+ + + +
@property (nonatomic, assign) BOOL automaticallyAdjustRangeModeBasedOnViewEvents
+ + + + + + + + + +
+

Discussion

+

Default value is YES if node or view controller conform to ASRangeControllerUpdateRangeProtocol otherwise it is NO.

+
+ + + + + + + +
+

Declared In

+

ASViewController.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/CALayer+AsyncDisplayKit.html b/docs/appledoc/Categories/CALayer+AsyncDisplayKit.html new file mode 100755 index 00000000..33a9fc83 --- /dev/null +++ b/docs/appledoc/Categories/CALayer+AsyncDisplayKit.html @@ -0,0 +1,182 @@ + + + + + + CALayer(AsyncDisplayKit) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

CALayer(AsyncDisplayKit) Category Reference

+ + +
+ + + + +
Declared inASDisplayNode.h
+ + + + + + +
+ + + + + + +
+
+ +

– addSubnode: +

+ +
+
+ +
+ + +
+

Convenience method, equivalent to [layer addSublayer:node.layer].

+
+ + + +
- (void)addSubnode:(nonnull ASDisplayNode *)node
+ + + +
+

Parameters

+ + + + + + + +
node

The node to be added.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/NSNumber+ASDimension.html b/docs/appledoc/Categories/NSNumber+ASDimension.html new file mode 100755 index 00000000..7d11d793 --- /dev/null +++ b/docs/appledoc/Categories/NSNumber+ASDimension.html @@ -0,0 +1,118 @@ + + + + + + NSNumber(ASDimension) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

NSNumber(ASDimension) Category Reference

+ + +
+ + + + +
Declared inASDimension.h
+ + + + +
+ +

Overview

+

Resolve this dimension to a parent size.

+
+ + + + + + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/NSURL+ASPhotosFrameworkURLs.html b/docs/appledoc/Categories/NSURL+ASPhotosFrameworkURLs.html new file mode 100755 index 00000000..1ca4bce4 --- /dev/null +++ b/docs/appledoc/Categories/NSURL+ASPhotosFrameworkURLs.html @@ -0,0 +1,176 @@ + + + + + + NSURL(ASPhotosFrameworkURLs) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

NSURL(ASPhotosFrameworkURLs) Category Reference

+ + +
+ + + + +
Declared inASMultiplexImageNode.h
+ + + + + + +
+ + + + + + +
+
+ +

+ URLWithAssetLocalIdentifier:targetSize:contentMode:options: +

+ +
+
+ +
+ + +
+

Create an NSURL that specifies an image from the Photos framework.

+
+ + + +
+ (NSURL *)URLWithAssetLocalIdentifier:(NSString *)assetLocalIdentifier targetSize:(CGSize)targetSize contentMode:(PHImageContentMode)contentMode options:(PHImageRequestOptions *)options
+ + + + + + + + + +
+

Discussion

+

When implementing -multiplexImageNode:URLForImageIdentifier:, you can return a URL +created by this method and the image node will attempt to load the image from the Photos framework.

Note: The synchronous flag in options is ignored.

Note: The Opportunistic delivery mode is not supported and will be treated as HighQualityFormat.

+
+ + + + + + + +
+

Declared In

+

ASMultiplexImageNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/UIImage+ASDKAdditions.html b/docs/appledoc/Categories/UIImage+ASDKAdditions.html new file mode 100755 index 00000000..72e65a6a --- /dev/null +++ b/docs/appledoc/Categories/UIImage+ASDKAdditions.html @@ -0,0 +1,352 @@ + + + + + + UIImage(ASDKAdditions) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

UIImage(ASDKAdditions) Category Reference

+ + +
+ + + + +
Declared inUIImage+ASConvenience.h
+ + + + + + +
+ + + + + + +
+
+ +

+ as_resizableRoundedImageWithCornerRadius:cornerColor:fillColor: +

+ +
+
+ +
+ + +
+

This generates a flat-color, rounded-corner resizeable image

+
+ + + +
+ (UIImage *)as_resizableRoundedImageWithCornerRadius:(CGFloat)cornerRadius cornerColor:(UIColor *)cornerColor fillColor:(UIColor *)fillColor
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
cornerRadius

The radius of the rounded-corner

cornerColor

The fill color of the corners (For Alpha corners use clearColor)

fillColor

The fill color of the rounded-corner image

+
+ + + + + + + + + + + + + +
+

Declared In

+

UIImage+ASConvenience.h

+
+ + +
+
+
+ +

+ as_resizableRoundedImageWithCornerRadius:cornerColor:fillColor:borderColor:borderWidth: +

+ +
+
+ +
+ + +
+

This generates a flat-color, rounded-corner resizeable image with a border

+
+ + + +
+ (UIImage *)as_resizableRoundedImageWithCornerRadius:(CGFloat)cornerRadius cornerColor:(UIColor *)cornerColor fillColor:(UIColor *)fillColor borderColor:(nullable UIColor *)borderColor borderWidth:(CGFloat)borderWidth
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
cornerRadius

The radius of the rounded-corner

cornerColor

The fill color of the corners (For Alpha corners use clearColor)

fillColor

The fill color of the rounded-corner image

borderColor

The border color. Set to nil for no border.

borderWidth

The border width. Dummy value if borderColor = nil.

+
+ + + + + + + + + + + + + +
+

Declared In

+

UIImage+ASConvenience.h

+
+ + +
+
+
+ +

+ as_resizableRoundedImageWithCornerRadius:cornerColor:fillColor:borderColor:borderWidth:roundedCorners:scale: +

+ +
+
+ +
+ + +
+

This generates a flat-color, rounded-corner resizeable image with a border

+
+ + + +
+ (UIImage *)as_resizableRoundedImageWithCornerRadius:(CGFloat)cornerRadius cornerColor:(UIColor *)cornerColor fillColor:(UIColor *)fillColor borderColor:(nullable UIColor *)borderColor borderWidth:(CGFloat)borderWidth roundedCorners:(UIRectCorner)roundedCorners scale:(CGFloat)scale
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
cornerRadius

The radius of the rounded-corner

cornerColor

The fill color of the corners (For Alpha corners use clearColor)

fillColor

The fill color of the rounded-corner image

borderColor

The border color. Set to nil for no border.

borderWidth

The border width. Dummy value if borderColor = nil.

roundedCorners

Select individual or multiple corners to round. Set to UIRectCornerAllCorners to round all 4 corners.

scale

The number of pixels per point. Provide 0.0 to use the screen scale.

+
+ + + + + + + + + + + + + +
+

Declared In

+

UIImage+ASConvenience.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Categories/UIView+AsyncDisplayKit.html b/docs/appledoc/Categories/UIView+AsyncDisplayKit.html new file mode 100755 index 00000000..a1bcd6c4 --- /dev/null +++ b/docs/appledoc/Categories/UIView+AsyncDisplayKit.html @@ -0,0 +1,192 @@ + + + + + + UIView(AsyncDisplayKit) Category Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

UIView(AsyncDisplayKit) Category Reference

+ + +
+ + + + +
Declared inASDisplayNode.h
+ + + + +
+ +

Overview

+

UIVIew(AsyncDisplayKit) defines convenience method for adding sub-ASDisplayNode to an UIView.

+
+ + + + + +
+ + + + + + +
+
+ +

– addSubnode: +

+ +
+
+ +
+ + +
+

Convenience method, equivalent to [view addSubview:node.view] or [view.layer addSublayer:node.layer] if layer-backed.

+
+ + + +
- (void)addSubnode:(nonnull ASDisplayNode *)node
+ + + +
+

Parameters

+ + + + + + + +
node

The node to be added.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASAbsoluteLayoutSpec.html b/docs/appledoc/Classes/ASAbsoluteLayoutSpec.html new file mode 100755 index 00000000..4a526d9b --- /dev/null +++ b/docs/appledoc/Classes/ASAbsoluteLayoutSpec.html @@ -0,0 +1,302 @@ + + + + + + ASAbsoluteLayoutSpec Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASAbsoluteLayoutSpec Class Reference

+ + +
+ + + + + + + +
Inherits fromASLayoutSpec : NSObject
Declared inASAbsoluteLayoutSpec.h
+ + + + +
+ +

Overview

+

A layout spec that positions children at fixed positions.

+
+ + + + + +
+ + + + + + +
+
+ +

  sizing +

+ +
+
+ +
+ + +
+

How much space will the spec taken up

+
+ + + +
@property (nonatomic, assign) ASAbsoluteLayoutSpecSizing sizing
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASAbsoluteLayoutSpec.h

+
+ + +
+
+
+ +

+ absoluteLayoutSpecWithSizing:children: +

+ +
+
+ +
+ + +
+

How much space the spec will take up

+
+ + + +
+ (instancetype)absoluteLayoutSpecWithSizing:(ASAbsoluteLayoutSpecSizing)sizing children:(NSArray<id<ASLayoutElement> > *)children
+ + + +
+

Parameters

+ + + + + + + + + + + + +
sizing

How much space the spec will take up

children

Children to be positioned at fixed positions

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASAbsoluteLayoutSpec.h

+
+ + +
+
+
+ +

+ absoluteLayoutSpecWithChildren: +

+ +
+
+ +
+ + +
+

Children to be positioned at fixed positions

+
+ + + +
+ (instancetype)absoluteLayoutSpecWithChildren:(NSArray<id<ASLayoutElement> > *)children
+ + + +
+

Parameters

+ + + + + + + +
children

Children to be positioned at fixed positions

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASAbsoluteLayoutSpec.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASAsciiArtBoxCreator.html b/docs/appledoc/Classes/ASAsciiArtBoxCreator.html new file mode 100755 index 00000000..de14a956 --- /dev/null +++ b/docs/appledoc/Classes/ASAsciiArtBoxCreator.html @@ -0,0 +1,236 @@ + + + + + + ASAsciiArtBoxCreator Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASAsciiArtBoxCreator Class Reference

+ + +
+ + + + + + + +
Inherits fromNSObject
Declared inASAsciiArtBoxCreator.h
+ + + + +
+ +

Overview

+

A that takes a parent and its children and renders as ascii art box.

+
+ + + + + +
+ + + + + + +
+
+ +

+ horizontalBoxStringForChildren:parent: +

+ +
+
+ +
+ + +
+

Renders an ascii art box with the children aligned horizontally +Example: +————ASStackLayoutSpec———–

+ +

| ASTextNode ASTextNode ASTextNode |

+
+ + + +
+ (NSString *)horizontalBoxStringForChildren:(NSArray<NSString*> *)children parent:(NSString *)parent
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASAsciiArtBoxCreator.h

+
+ + +
+
+
+ +

+ verticalBoxStringForChildren:parent: +

+ +
+
+ +
+ + +
+

Renders an ascii art box with the children aligned vertically. +Example: +–ASStackLayoutSpec– +| ASTextNode | +| ASTextNode |

+ +

| ASTextNode |

+
+ + + +
+ (NSString *)verticalBoxStringForChildren:(NSArray<NSString*> *)children parent:(NSString *)parent
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASAsciiArtBoxCreator.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASBackgroundLayoutSpec.html b/docs/appledoc/Classes/ASBackgroundLayoutSpec.html new file mode 100755 index 00000000..e860a8b3 --- /dev/null +++ b/docs/appledoc/Classes/ASBackgroundLayoutSpec.html @@ -0,0 +1,247 @@ + + + + + + ASBackgroundLayoutSpec Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASBackgroundLayoutSpec Class Reference

+ + +
+ + + + + + + +
Inherits fromASLayoutSpec : NSObject
Declared inASBackgroundLayoutSpec.h
+ + + + +
+ +

Overview

+

Lays out a single layoutElement child, then lays out a background layoutElement instance behind it stretched to its size.

+
+ + + + + +
+ + + + + + +
+
+ +

  background +

+ +
+
+ +
+ + +
+

Background layoutElement for this layout spec

+
+ + + +
@property (nullable, nonatomic, strong) id<ASLayoutElement> background
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASBackgroundLayoutSpec.h

+
+ + +
+
+
+ +

+ backgroundLayoutSpecWithChild:background: +

+ +
+
+ +
+ + +
+

Creates and returns an ASBackgroundLayoutSpec object

+
+ + + +
+ (instancetype)backgroundLayoutSpecWithChild:(id<ASLayoutElement>)child background:(nullable id<ASLayoutElement>)background
+ + + +
+

Parameters

+ + + + + + + + + + + + +
child

A child that is laid out to determine the size of this spec.

background

A layoutElement object that is laid out behind the child. If this is nil, the background is omitted.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASBackgroundLayoutSpec.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASButtonNode.html b/docs/appledoc/Classes/ASButtonNode.html new file mode 100755 index 00000000..3aca43f7 --- /dev/null +++ b/docs/appledoc/Classes/ASButtonNode.html @@ -0,0 +1,831 @@ + + + + + + ASButtonNode Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASButtonNode Class Reference

+ + +
+ + + + + + + +
Inherits fromASControlNode : ASDisplayNode : ASDealloc2MainObject
Declared inASButtonNode.h
+ + + + + + +
+ + + + + + +
+
+ +

  contentSpacing +

+ +
+
+ +
+ + +
+

Spacing between image and title. Defaults to 8.0.

+
+ + + +
@property (nonatomic, assign) CGFloat contentSpacing
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASButtonNode.h

+
+ + +
+
+
+ +

  laysOutHorizontally +

+ +
+
+ +
+ + +
+

Whether button should be laid out vertically (image on top of text) or horizontally (image to the left of text). +ASButton node does not yet support RTL but it should be fairly easy to implement. +Defaults to YES.

+
+ + + +
@property (nonatomic, assign) BOOL laysOutHorizontally
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASButtonNode.h

+
+ + +
+
+
+ +

  contentHorizontalAlignment +

+ +
+
+ +
+ + +
+

Horizontally align content (text or image). +Defaults to ASHorizontalAlignmentMiddle.

+
+ + + +
@property (nonatomic, assign) ASHorizontalAlignment contentHorizontalAlignment
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASButtonNode.h

+
+ + +
+
+
+ +

  contentVerticalAlignment +

+ +
+
+ +
+ + +
+

Vertically align content (text or image). +Defaults to ASVerticalAlignmentCenter.

+
+ + + +
@property (nonatomic, assign) ASVerticalAlignment contentVerticalAlignment
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASButtonNode.h

+
+ + +
+
+
+ +

  contentEdgeInsets +

+ +
+
+ +
+ + +
+

The insets used around the title and image node

+
+ + + +
@property (nonatomic, assign) UIEdgeInsets contentEdgeInsets
+ + + + + + + + + +
+

Discussion

+

The insets used around the title and image node

+
+ + + + + + + +
+

Declared In

+

ASButtonNode.h

+
+ + +
+
+
+ +

  imageAlignment +

+ +
+
+ +
+ + +
+

@discusstion Whether the image should be aligned at the beginning or at the end of node. Default is ASButtonNodeImageAlignmentBeginning.

+
+ + + +
@property (nonatomic, assign) ASButtonNodeImageAlignment imageAlignment
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASButtonNode.h

+
+ + +
+
+
+ +

– attributedTitleForState: +

+ +
+
+ +
+ + +
+

Returns the styled title associated with the specified state.

+
+ + + +
- (NSAttributedString *_Nullable)attributedTitleForState:(ASControlState)state
+ + + +
+

Parameters

+ + + + + + + +
state

The state that uses the styled title. The possible values are described in ASControlState.

+
+ + + +
+

Return Value

+

The title for the specified state.

+
+ + + + + + + + + + + +
+

Declared In

+

ASButtonNode.h

+
+ + +
+
+
+ +

– setAttributedTitle:forState: +

+ +
+
+ +
+ + +
+

Sets the styled title to use for the specified state. This will reset styled title previously set with -setTitle:withFont:withColor:forState.

+
+ + + +
- (void)setAttributedTitle:(nullable NSAttributedString *)title forState:(ASControlState)state
+ + + +
+

Parameters

+ + + + + + + + + + + + +
title

The styled text string to use for the title.

state

The state that uses the specified title. The possible values are described in ASControlState.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASButtonNode.h

+
+ + +
+
+
+ +

– setTitle:withFont:withColor:forState: +

+ +
+
+ +
+ + +
+

Sets the title to use for the specified state. This will reset styled title previously set with -setAttributedTitle:forState.

+
+ + + +
- (void)setTitle:(NSString *)title withFont:(nullable UIFont *)font withColor:(nullable UIColor *)color forState:(ASControlState)state
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
title

The styled text string to use for the title.

font

The font to use for the title.

color

The color to use for the title.

state

The state that uses the specified title. The possible values are described in ASControlState.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASButtonNode.h

+
+ + +
+
+
+ +

– imageForState: +

+ +
+
+ +
+ + +
+

Returns the image used for a button state.

+
+ + + +
- (nullable UIImage *)imageForState:(ASControlState)state
+ + + +
+

Parameters

+ + + + + + + +
state

The state that uses the image. Possible values are described in ASControlState.

+
+ + + +
+

Return Value

+

The image used for the specified state.

+
+ + + + + + + + + + + +
+

Declared In

+

ASButtonNode.h

+
+ + +
+
+
+ +

– setImage:forState: +

+ +
+
+ +
+ + +
+

Sets the image to use for the specified state.

+
+ + + +
- (void)setImage:(nullable UIImage *)image forState:(ASControlState)state
+ + + +
+

Parameters

+ + + + + + + + + + + + +
image

The image to use for the specified state.

state

The state that uses the specified title. The values are described in ASControlState.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASButtonNode.h

+
+ + +
+
+
+ +

– setBackgroundImage:forState: +

+ +
+
+ +
+ + +
+

Sets the background image to use for the specified state.

+
+ + + +
- (void)setBackgroundImage:(nullable UIImage *)image forState:(ASControlState)state
+ + + +
+

Parameters

+ + + + + + + + + + + + +
image

The image to use for the specified state.

state

The state that uses the specified title. The values are described in ASControlState.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASButtonNode.h

+
+ + +
+
+
+ +

– backgroundImageForState: +

+ +
+
+ +
+ + +
+

Returns the background image used for a button state.

+
+ + + +
- (nullable UIImage *)backgroundImageForState:(ASControlState)state
+ + + +
+

Parameters

+ + + + + + + +
state

The state that uses the image. Possible values are described in ASControlState.

+
+ + + +
+

Return Value

+

The background image used for the specified state.

+
+ + + + + + + + + + + +
+

Declared In

+

ASButtonNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASCellNode.html b/docs/appledoc/Classes/ASCellNode.html new file mode 100755 index 00000000..2f927708 --- /dev/null +++ b/docs/appledoc/Classes/ASCellNode.html @@ -0,0 +1,558 @@ + + + + + + ASCellNode Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASCellNode Class Reference

+ + +
+ + + + + + + +
Inherits fromASDisplayNode : ASDealloc2MainObject
Declared inASCellNode.h
+ + + + +
+ +

Overview

+
    +
  • Generic cell node. Subclass this instead of ASDisplayNode to use with ASTableView and ASCollectionView.

  • +
  • @note When a cell node is contained inside a collection view (or table view),

  • +
  • calling -setNeedsLayout will also notify the collection on the main thread
  • +
  • so that the collection can update its item layout if the cell’s size changed.
  • +
+ +
+ + + + + +
+ + + + + + +
+
+ +

  neverShowPlaceholders +

+ +
+
+ +
+ + +
+

When enabled, ensures that the cell is completely displayed before allowed onscreen.

+ +

@default NO

+
+ + + +
@property (nonatomic, assign) BOOL neverShowPlaceholders
+ + + + + + + + + +
+

Discussion

+

Normally, ASCellNodes are preloaded and have finished display before they are onscreen. +However, if the Table or Collection’s rangeTuningParameters are set to small values (or 0), +or if the user is scrolling rapidly on a slow device, it is possible for a cell’s display to +be incomplete when it becomes visible.

+ +

In this case, normally placeholder states are shown and scrolling continues uninterrupted. +The finished, drawn content is then shown as soon as it is ready.

+ +

With this property set to YES, the main thread will be blocked until display is complete for +the cell. This is more similar to UIKit, and in fact makes AsyncDisplayKit scrolling visually +indistinguishable from UIKit’s, except being faster.

+ +

Using this option does not eliminate all of the performance advantages of AsyncDisplayKit. +Normally, a cell has been preloading and is almost done when it reaches the screen, so the +blocking time is very short. If the rangeTuningParameters are set to 0, still this option +outperforms UIKit: while the main thread is waiting, subnode display executes concurrently.

+
+ + + + + + + +
+

Declared In

+

ASCellNode.h

+
+ + +
+
+
+ +

  selected +

+ +
+
+ +
+ + +
+

A Boolean value that is synchronized with the underlying collection or tableView cell property. +Setting this value is equivalent to calling selectItem / deselectItem on the collection or table.

+
+ + + +
@property (nonatomic, assign, getter=isSelected) BOOL selected
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASCellNode.h

+
+ + +
+
+
+ +

  highlighted +

+ +
+
+ +
+ + +
+

A Boolean value that is synchronized with the underlying collection or tableView cell property. +Setting this value is equivalent to calling highlightItem / unHighlightItem on the collection or table.

+
+ + + +
@property (nonatomic, assign, getter=isHighlighted) BOOL highlighted
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASCellNode.h

+
+ + +
+
+
+ +

  indexPath +

+ +
+
+ +
+ + +
+

The current index path of this cell node, or @c nil if this node is +not a valid item inside a table node or collection node.

+
+ + + +
@property (nonatomic, readonly, nullable) NSIndexPath *indexPath
+ + + + + + + + + +
+

Discussion

+

Note: This property must be accessed on the main thread.

+
+ + + + + + + +
+

Declared In

+

ASCellNode.h

+
+ + +
+
+
+ +

  owningNode +

+ +
+
+ +
+ + +
+

The owning node (ASCollectionNode/ASTableNode) of this cell node, or @c nil if this node is +not a valid item inside a table node or collection node or if those nodes are nil.

+
+ + + +
@property (weak, nonatomic, readonly, nullable) ASDisplayNode *owningNode
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASCellNode.h

+
+ + +
+
+
+ +

– applyLayoutAttributes: +

+ +
+
+ +
+ + +
+

Called by the system when ASCellNode is used with an ASCollectionNode. It will not be called by ASTableNode. +When the UICollectionViewLayout object returns a new UICollectionViewLayoutAttributes object, the corresponding ASCellNode will be updated. +See UICollectionViewCell’s applyLayoutAttributes: for a full description.

+
+ + + +
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASCellNode.h

+
+ + +
+
+
+ +

– initWithViewControllerBlock:didLoadBlock: +

+ +
+
+ +
+ + +
+

Initializes a cell with a given view controller block.

+
+ + + +
- (instancetype)initWithViewControllerBlock:(ASDisplayNodeViewControllerBlock)viewControllerBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock
+ + + +
+

Parameters

+ + + + + + + + + + + + +
viewControllerBlock

The block that will be used to create the backing view controller.

didLoadBlock

The block that will be called after the view controller’s view is loaded.

+
+ + + +
+

Return Value

+

An ASCellNode created using the root view of the view controller provided by the viewControllerBlock. +The view controller’s root view is resized to match the calculated size produced during layout.

+
+ + + + + + + + + + + +
+

Declared In

+

ASCellNode.h

+
+ + +
+
+
+ +

– cellNodeVisibilityEvent:inScrollView:withCellFrame: +

+ +
+
+ +
+ + +
+

Notifies the cell node of certain visibility events, such as changing visible rect.

+
+ + + +
- (void)cellNodeVisibilityEvent:(ASCellNodeVisibilityEvent)event inScrollView:(nullable UIScrollView *)scrollView withCellFrame:(CGRect)cellFrame
+ + + + + + + + + +
+

Discussion

+

Warning: In cases where an ASCellNode is used as a plain node – i.e. not returned from the +nodeBlockForItemAtIndexPath/nodeForItemAtIndexPath data source methods – this method will +deliver only the Visible and Invisible events, scrollView will be nil, and +cellFrame will be the zero rect.

+
+ + + + + + + +
+

Declared In

+

ASCellNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASCenterLayoutSpec.html b/docs/appledoc/Classes/ASCenterLayoutSpec.html new file mode 100755 index 00000000..fe4f01cf --- /dev/null +++ b/docs/appledoc/Classes/ASCenterLayoutSpec.html @@ -0,0 +1,207 @@ + + + + + + ASCenterLayoutSpec Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASCenterLayoutSpec Class Reference

+ + +
+ + + + + + + +
Inherits fromASRelativeLayoutSpec : ASLayoutSpec : NSObject
Declared inASCenterLayoutSpec.h
+ + + + +
+ +

Overview

+

Lays out a single layoutElement child and position it so that it is centered into the layout bounds. +NOTE: ASRelativeLayoutSpec offers all of the capabilities of Center, and more. +Check it out if you would like to be able to position the child at any corner or the middle of an edge.

+
+ + + + + +
+ + + + + + +
+
+ +

+ centerLayoutSpecWithCenteringOptions:sizingOptions:child: +

+ +
+
+ +
+ + +
+

Initializer.

+
+ + + +
+ (instancetype)centerLayoutSpecWithCenteringOptions:(ASCenterLayoutSpecCenteringOptions)centeringOptions sizingOptions:(ASCenterLayoutSpecSizingOptions)sizingOptions child:(id<ASLayoutElement>)child
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
centeringOptions

How the child is centered.

sizingOptions

How much space will be taken up.

child

The child to center.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASCenterLayoutSpec.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASCollectionNode.html b/docs/appledoc/Classes/ASCollectionNode.html new file mode 100755 index 00000000..24719914 --- /dev/null +++ b/docs/appledoc/Classes/ASCollectionNode.html @@ -0,0 +1,2405 @@ + + + + + + ASCollectionNode Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASCollectionNode Class Reference

+ + +
+ + + + + + + + + + +
Inherits fromASDisplayNode : ASDealloc2MainObject
Conforms toASRangeControllerUpdateRangeProtocol
Declared inASCollectionNode.h
+ + + + +
+ +

Overview

+

ASCollectionNode is a node based class that wraps an ASCollectionView. It can be used +as a subnode of another node, and provide room for many (great) features and improvements later on.

+
+ + + + + +
+ + + + + + +
+
+ +

– initWithCollectionViewLayout: +

+ +
+
+ +
+ + +
+

Initializes an ASCollectionNode

+
+ + + +
- (instancetype)initWithCollectionViewLayout:(UICollectionViewLayout *)layout
+ + + +
+

Parameters

+ + + + + + + +
layout

The layout object to use for organizing items. The collection view stores a strong reference to the specified object. Must not be nil.

+
+ + + + + + + +
+

Discussion

+

Initializes and returns a newly allocated collection node object with the specified layout.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– initWithFrame:collectionViewLayout: +

+ +
+
+ +
+ + +
+

Initializes an ASCollectionNode

+
+ + + +
- (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout
+ + + +
+

Parameters

+ + + + + + + + + + + + +
frame

The frame rectangle for the collection view, measured in points. The origin of the frame is relative to the superview in which you plan to add it. This frame is passed to the superclass during initialization.

layout

The layout object to use for organizing items. The collection view stores a strong reference to the specified object. Must not be nil.

+
+ + + + + + + +
+

Discussion

+

Initializes and returns a newly allocated collection node object with the specified frame and layout.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

  view +

+ +
+
+ +
+ + +
+

Returns the corresponding ASCollectionView

+
+ + + +
@property (strong, nonatomic, readonly) ASCollectionView *view
+ + + + + +
+

Return Value

+

view The corresponding ASCollectionView.

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

  delegate +

+ +
+
+ +
+ + +
+

The object that acts as the asynchronous delegate of the collection view

+
+ + + +
@property (weak, nonatomic) id<ASCollectionDelegate> delegate
+ + + + + + + + + +
+

Discussion

+

The delegate must adopt the ASCollectionDelegate protocol. The collection view maintains a weak reference to the delegate object.

+ +

The delegate object is responsible for providing size constraints for nodes and indicating whether batch fetching should begin.

Note: This is a convenience method which sets the asyncDelegate on the collection node’s collection view.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

  dataSource +

+ +
+
+ +
+ + +
+

The object that acts as the asynchronous data source of the collection view

+
+ + + +
@property (weak, nonatomic) id<ASCollectionDataSource> dataSource
+ + + + + + + + + +
+

Discussion

+

The datasource must adopt the ASCollectionDataSource protocol. The collection view maintains a weak reference to the datasource object.

+ +

The datasource object is responsible for providing nodes or node creation blocks to the collection view.

Note: This is a convenience method which sets the asyncDatasource on the collection node’s collection view.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

  allowsSelection +

+ +
+
+ +
+ + +
+

A Boolean value that indicates whether users can select items in the collection node. +If the value of this property is YES (the default), users can select items. If you want more fine-grained control over the selection of items, you must provide a delegate object and implement the appropriate methods of the UICollectionNodeDelegate protocol.

+
+ + + +
@property (nonatomic, assign) BOOL allowsSelection
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

  allowsMultipleSelection +

+ +
+
+ +
+ + +
+

A Boolean value that determines whether users can select more than one item in the collection node. +This property controls whether multiple items can be selected simultaneously. The default value of this property is NO. +When the value of this property is YES, tapping a cell adds it to the current selection (assuming the delegate permits the cell to be selected). Tapping the cell again removes it from the selection.

+
+ + + +
@property (nonatomic, assign) BOOL allowsMultipleSelection
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– tuningParametersForRangeType: +

+ +
+
+ +
+ + +
+

Tuning parameters for a range type in full mode.

+
+ + + +
- (ASRangeTuningParameters)tuningParametersForRangeType:(ASLayoutRangeType)rangeType
+ + + +
+

Parameters

+ + + + + + + +
rangeType

The range type to get the tuning parameters for.

+
+ + + +
+

Return Value

+

A tuning parameter value for the given range type in full mode.

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– setTuningParameters:forRangeType: +

+ +
+
+ +
+ + +
+

Set the tuning parameters for a range type in full mode.

+
+ + + +
- (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeType:(ASLayoutRangeType)rangeType
+ + + +
+

Parameters

+ + + + + + + + + + + + +
tuningParameters

The tuning parameters to store for a range type.

rangeType

The range type to set the tuning parameters for.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– tuningParametersForRangeMode:rangeType: +

+ +
+
+ +
+ + +
+

Tuning parameters for a range type in the specified mode.

+
+ + + +
- (ASRangeTuningParameters)tuningParametersForRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType
+ + + +
+

Parameters

+ + + + + + + + + + + + +
rangeMode

The range mode to get the running parameters for.

rangeType

The range type to get the tuning parameters for.

+
+ + + +
+

Return Value

+

A tuning parameter value for the given range type in the given mode.

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– setTuningParameters:forRangeMode:rangeType: +

+ +
+
+ +
+ + +
+

Set the tuning parameters for a range type in the specified mode.

+
+ + + +
- (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
tuningParameters

The tuning parameters to store for a range type.

rangeMode

The range mode to set the running parameters for.

rangeType

The range type to set the tuning parameters for.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– scrollToItemAtIndexPath:atScrollPosition:animated: +

+ +
+
+ +
+ + +
+

Scrolls the collection to the given item.

+
+ + + +
- (void)scrollToItemAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UICollectionViewScrollPosition)scrollPosition animated:(BOOL)animated
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
indexPath

The index path of the item.

scrollPosition

Where the item should end up after the scroll.

animated

Whether the scroll should be animated or not.

+ +

This method must be called on the main thread.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– registerSupplementaryNodeOfKind: +

+ +
+
+ +
+ + +
+

Registers the given kind of supplementary node for use in creating node-backed supplementary elements.

+
+ + + +
- (void)registerSupplementaryNodeOfKind:(NSString *)elementKind
+ + + +
+

Parameters

+ + + + + + + +
elementKind

The kind of supplementary node that will be requested through the data source.

+
+ + + + + + + +
+

Discussion

+

Use this method to register support for the use of supplementary nodes in place of the default +registerClass:forSupplementaryViewOfKind:withReuseIdentifier: and registerNib:forSupplementaryViewOfKind:withReuseIdentifier: +methods. This method will register an internal backing view that will host the contents of the supplementary nodes +returned from the data source.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– performBatchAnimated:updates:completion: +

+ +
+
+ +
+ + +
+

Perform a batch of updates asynchronously, optionally disabling all animations in the batch. This method must be called from the main thread. +The data source must be updated to reflect the changes before the update block completes.

+
+ + + +
- (void)performBatchAnimated:(BOOL)animated updates:(nullable __attribute ( ( noescape ) ) void ( ^ ) ( ))updates completion:(nullable void ( ^ ) ( BOOL finished ))completion
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
animated

NO to disable animations for this batch

updates

The block that performs the relevant insert, delete, reload, or move operations.

completion

A completion handler block to execute when all of the operations are finished. This block takes a single +Boolean parameter that contains the value YES if all of the related animations completed successfully or +NO if they were interrupted. This parameter may be nil. If supplied, the block is run on the main thread.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– performBatchUpdates:completion: +

+ +
+
+ +
+ + +
+

Perform a batch of updates asynchronously, optionally disabling all animations in the batch. This method must be called from the main thread. +The data source must be updated to reflect the changes before the update block completes.

+
+ + + +
- (void)performBatchUpdates:(nullable __attribute ( ( noescape ) ) void ( ^ ) ( ))updates completion:(nullable void ( ^ ) ( BOOL finished ))completion
+ + + +
+

Parameters

+ + + + + + + + + + + + +
updates

The block that performs the relevant insert, delete, reload, or move operations.

completion

A completion handler block to execute when all of the operations are finished. This block takes a single +Boolean parameter that contains the value YES if all of the related animations completed successfully or +NO if they were interrupted. This parameter may be nil. If supplied, the block is run on the main thread.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– waitUntilAllUpdatesAreCommitted +

+ +
+
+ +
+ + +
+

Blocks execution of the main thread until all section and item updates are committed to the view. This method must be called from the main thread.

+
+ + + +
- (void)waitUntilAllUpdatesAreCommitted
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– insertSections: +

+ +
+
+ +
+ + +
+

Inserts one or more sections.

+
+ + + +
- (void)insertSections:(NSIndexSet *)sections
+ + + +
+

Parameters

+ + + + + + + +
sections

An index set that specifies the sections to insert.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread. The data source must be updated to reflect the changes +before this method is called.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– deleteSections: +

+ +
+
+ +
+ + +
+

Deletes one or more sections.

+
+ + + +
- (void)deleteSections:(NSIndexSet *)sections
+ + + +
+

Parameters

+ + + + + + + +
sections

An index set that specifies the sections to delete.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread. The data source must be updated to reflect the changes +before this method is called.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– reloadSections: +

+ +
+
+ +
+ + +
+

Reloads the specified sections.

+
+ + + +
- (void)reloadSections:(NSIndexSet *)sections
+ + + +
+

Parameters

+ + + + + + + +
sections

An index set that specifies the sections to reload.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread. The data source must be updated to reflect the changes +before this method is called.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– moveSection:toSection: +

+ +
+
+ +
+ + +
+

Moves a section to a new location.

+
+ + + +
- (void)moveSection:(NSInteger)section toSection:(NSInteger)newSection
+ + + +
+

Parameters

+ + + + + + + + + + + + +
section

The index of the section to move.

newSection

The index that is the destination of the move for the section.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread. The data source must be updated to reflect the changes +before this method is called.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– insertItemsAtIndexPaths: +

+ +
+
+ +
+ + +
+

Inserts items at the locations identified by an array of index paths.

+
+ + + +
- (void)insertItemsAtIndexPaths:(NSArray<NSIndexPath*> *)indexPaths
+ + + +
+

Parameters

+ + + + + + + +
indexPaths

An array of NSIndexPath objects, each representing an item index and section index that together identify an item.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread. The data source must be updated to reflect the changes +before this method is called.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– deleteItemsAtIndexPaths: +

+ +
+
+ +
+ + +
+

Deletes the items specified by an array of index paths.

+
+ + + +
- (void)deleteItemsAtIndexPaths:(NSArray<NSIndexPath*> *)indexPaths
+ + + +
+

Parameters

+ + + + + + + +
indexPaths

An array of NSIndexPath objects identifying the items to delete.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread. The data source must be updated to reflect the changes +before this method is called.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– reloadItemsAtIndexPaths: +

+ +
+
+ +
+ + +
+

Reloads the specified items.

+
+ + + +
- (void)reloadItemsAtIndexPaths:(NSArray<NSIndexPath*> *)indexPaths
+ + + +
+

Parameters

+ + + + + + + +
indexPaths

An array of NSIndexPath objects identifying the items to reload.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread. The data source must be updated to reflect the changes +before this method is called.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– moveItemAtIndexPath:toIndexPath: +

+ +
+
+ +
+ + +
+

Moves the item at a specified location to a destination location.

+
+ + + +
- (void)moveItemAtIndexPath:(NSIndexPath *)indexPath toIndexPath:(NSIndexPath *)newIndexPath
+ + + +
+

Parameters

+ + + + + + + + + + + + +
indexPath

The index path identifying the item to move.

newIndexPath

The index path that is the destination of the move for the item.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread. The data source must be updated to reflect the changes +before this method is called.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– reloadDataWithCompletion: +

+ +
+
+ +
+ + +
+

Reload everything from scratch, destroying the working range and all cached nodes.

+
+ + + +
- (void)reloadDataWithCompletion:(nullable void ( ^ ) ( ))completion
+ + + +
+

Parameters

+ + + + + + + +
completion

block to run on completion of asynchronous loading or nil. If supplied, the block is run on +the main thread.

+
+ + + + + + + +
+

Discussion

+

Warning: This method is substantially more expensive than UICollectionView’s version.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– reloadData +

+ +
+
+ +
+ + +
+

Reload everything from scratch, destroying the working range and all cached nodes.

+
+ + + +
- (void)reloadData
+ + + + + + + + + +
+

Discussion

+

Warning: This method is substantially more expensive than UICollectionView’s version.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– relayoutItems +

+ +
+
+ +
+ + +
+

Triggers a relayout of all nodes.

+
+ + + +
- (void)relayoutItems
+ + + + + + + + + +
+

Discussion

+

This method invalidates and lays out every cell node in the collection view.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

  indexPathsForSelectedItems +

+ +
+
+ +
+ + +
+

The index paths of the selected items, or @c nil if no items are selected.

+
+ + + +
@property (nonatomic, readonly, nullable) NSArray<NSIndexPath*> *indexPathsForSelectedItems
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– selectItemAtIndexPath:animated:scrollPosition: +

+ +
+
+ +
+ + +
+

Selects the item at the specified index path and optionally scrolls it into view. +If the allowsSelection property is NO, calling this method has no effect. If there is an existing selection with a different index path and the allowsMultipleSelection property is NO, calling this method replaces the previous selection. +This method does not cause any selection-related delegate methods to be called.

+
+ + + +
- (void)selectItemAtIndexPath:(nullable NSIndexPath *)indexPath animated:(BOOL)animated scrollPosition:(UICollectionViewScrollPosition)scrollPosition
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
indexPath

The index path of the item to select. Specifying nil for this parameter clears the current selection.

animated

Specify YES to animate the change in the selection or NO to make the change without animating it.

scrollPosition

An option that specifies where the item should be positioned when scrolling finishes. For a list of possible values, see UICollectionViewScrollPosition.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– deselectItemAtIndexPath:animated: +

+ +
+
+ +
+ + +
+

Deselects the item at the specified index. +If the allowsSelection property is NO, calling this method has no effect. +This method does not cause any selection-related delegate methods to be called.

+
+ + + +
- (void)deselectItemAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated
+ + + +
+

Parameters

+ + + + + + + + + + + + +
indexPath

The index path of the item to select. Specifying nil for this parameter clears the current selection.

animated

Specify YES to animate the change in the selection or NO to make the change without animating it.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– numberOfItemsInSection: +

+ +
+
+ +
+ + +
+

Retrieves the number of items in the given section.

+
+ + + +
- (NSInteger)numberOfItemsInSection:(NSInteger)section
+ + + +
+

Parameters

+ + + + + + + +
section

The section.

+
+ + + +
+

Return Value

+

The number of items.

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

  numberOfSections +

+ +
+
+ +
+ + +
+

The number of sections.

+
+ + + +
@property (nonatomic, readonly) NSInteger numberOfSections
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

  visibleNodes +

+ +
+
+ +
+ + +
+

Similar to -visibleCells.

+
+ + + +
@property (nonatomic, readonly) NSArray<__kindofASCellNode*> *visibleNodes
+ + + + + +
+

Return Value

+

an array containing the nodes being displayed on screen. This must be called on the main thread.

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– nodeForItemAtIndexPath: +

+ +
+
+ +
+ + +
+

Retrieves the node for the item at the given index path.

+
+ + + +
- (nullable __kindof ASCellNode *)nodeForItemAtIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + +
indexPath

The index path of the requested item.

+
+ + + +
+

Return Value

+

The node for the given item, or @c nil if no item exists at the specified path.

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– indexPathForNode: +

+ +
+
+ +
+ + +
+

Retrieve the index path for the item with the given node.

+
+ + + +
- (nullable NSIndexPath *)indexPathForNode:(ASCellNode *)cellNode
+ + + +
+

Parameters

+ + + + + + + +
cellNode

A node for an item in the collection node.

+
+ + + +
+

Return Value

+

The indexPath for this item.

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

  indexPathsForVisibleItems +

+ +
+
+ +
+ + +
+

Retrieve the index paths of all visible items.

+
+ + + +
@property (nonatomic, readonly) NSArray<NSIndexPath*> *indexPathsForVisibleItems
+ + + + + +
+

Return Value

+

an array containing the index paths of all visible items. This must be called on the main thread.

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– indexPathForItemAtPoint: +

+ +
+
+ +
+ + +
+

Retrieve the index path of the item at the given point.

+
+ + + +
- (nullable NSIndexPath *)indexPathForItemAtPoint:(CGPoint)point
+ + + +
+

Parameters

+ + + + + + + +
point

The point of the requested item.

+
+ + + +
+

Return Value

+

The indexPath for the item at the given point. This must be called on the main thread.

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– cellForItemAtIndexPath: +

+ +
+
+ +
+ + +
+

Retrieve the cell at the given index path.

+
+ + + +
- (nullable UICollectionViewCell *)cellForItemAtIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + +
indexPath

The index path of the requested item.

+
+ + + +
+

Return Value

+

The cell for the given index path. This must be called on the main thread.

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– contextForSection: +

+ +
+
+ +
+ + +
+

Retrieves the context object for the given section, as provided by the data source in +the @c collectionNode:contextForSection: method.

+
+ + + +
- (nullable id<ASSectionContext>)contextForSection:(NSInteger)section
+ + + +
+

Parameters

+ + + + + + + +
section

The section to get the context for.

+
+ + + +
+

Return Value

+

The context object, or @c nil if no context was provided.

+ +

TODO: This method currently accepts @c section in the view index space, but it should +be in the node index space. To get the context in the view index space (e.g. for subclasses +of @c UICollectionViewLayout, the user will call the same method on @c ASCollectionView.

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASCollectionView.html b/docs/appledoc/Classes/ASCollectionView.html new file mode 100755 index 00000000..c726f1a1 --- /dev/null +++ b/docs/appledoc/Classes/ASCollectionView.html @@ -0,0 +1,731 @@ + + + + + + ASCollectionView Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASCollectionView Class Reference

+ + +
+ + + + + + + +
Inherits fromUICollectionView
Declared inASCollectionView.h
+ + + + +
+ +

Overview

+

Asynchronous UICollectionView with Intelligent Preloading capabilities.

ASCollectionView is a true subclass of UICollectionView, meaning it is pointer-compatible +with code that currently uses UICollectionView.

+ +

The main difference is that asyncDataSource expects -nodeForItemAtIndexPath, an ASCellNode, and +the sizeForItemAtIndexPath: method is eliminated (as are the performance problems caused by it). +This is made possible because ASCellNodes can calculate their own size, and preload ahead of time.

Note: ASCollectionNode is strongly recommended over ASCollectionView. This class exists for adoption convenience.

+
+ + + + + +
+ + + + + + +
+
+ +

  asyncDelegate +

+ +
+
+ +
+ + +
+

The object that acts as the asynchronous delegate of the collection view

+
+ + + +
@property (nonatomic, weak) id<ASCollectionDelegate> asyncDelegate
+ + + + + + + + + +
+

Discussion

+

The delegate must adopt the ASCollectionDelegate protocol. The collection view maintains a weak reference to the delegate object.

+ +

The delegate object is responsible for providing size constraints for nodes and indicating whether batch fetching should begin.

+
+ + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

  asyncDataSource +

+ +
+
+ +
+ + +
+

The object that acts as the asynchronous data source of the collection view

+
+ + + +
@property (nonatomic, weak) id<ASCollectionDataSource> asyncDataSource
+ + + + + + + + + +
+

Discussion

+

The datasource must adopt the ASCollectionDataSource protocol. The collection view maintains a weak reference to the datasource object.

+ +

The datasource object is responsible for providing nodes or node creation blocks to the collection view.

+
+ + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

  collectionNode +

+ +
+
+ +
+ + +
+

Returns the corresponding ASCollectionNode

+
+ + + +
@property (nonatomic, weak, readonly) ASCollectionNode *collectionNode
+ + + + + +
+

Return Value

+

collectionNode The corresponding ASCollectionNode, if one exists.

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

  leadingScreensForBatching +

+ +
+
+ +
+ + +
+

The number of screens left to scroll before the delegate -collectionView:beginBatchFetchingWithContext: is called.

+
+ + + +
@property (nonatomic, assign) CGFloat leadingScreensForBatching
+ + + + + + + + + +
+

Discussion

+

Defaults to two screenfuls.

+
+ + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

  layoutInspector +

+ +
+
+ +
+ + +
+

Optional introspection object for the collection view’s layout.

+
+ + + +
@property (nonatomic, weak) id<ASCollectionViewLayoutInspecting> layoutInspector
+ + + + + + + + + +
+

Discussion

+

Since supplementary and decoration views are controlled by the collection view’s layout, this object +is used as a bridge to provide information to the internal data controller about the existence of these views and +their associated index paths. For collection views using UICollectionViewFlowLayout, a default inspector +implementation ASCollectionViewFlowLayoutInspector is created and set on this property by default. Custom +collection view layout subclasses will need to provide their own implementation of an inspector object for their +supplementary views to be compatible with ASCollectionView’s supplementary node support.

+
+ + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– nodeForItemAtIndexPath: +

+ +
+
+ +
+ + +
+

Retrieves the node for the item at the given index path.

+
+ + + +
- (nullable ASCellNode *)nodeForItemAtIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + +
indexPath

The index path of the requested node.

+
+ + + +
+

Return Value

+

The node at the given index path, or @c nil if no item exists at the specified path.

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– supplementaryNodeForElementKind:atIndexPath: +

+ +
+
+ +
+ + +
+

Similar to -supplementaryViewForElementKind:atIndexPath:

+
+ + + +
- (nullable ASCellNode *)supplementaryNodeForElementKind:(NSString *)elementKind atIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + + + + + + +
elementKind

The kind of supplementary node to locate.

indexPath

The index path of the requested supplementary node.

+
+ + + +
+

Return Value

+

The specified supplementary node or @c nil.

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– contextForSection: +

+ +
+
+ +
+ + +
+

Retrieves the context object for the given section, as provided by the data source in +the @c collectionNode:contextForSection: method. This method must be called on the main thread.

+
+ + + +
- (nullable id<ASSectionContext>)contextForSection:(NSInteger)section
+ + + +
+

Parameters

+ + + + + + + +
section

The section to get the context for.

+
+ + + +
+

Return Value

+

The context object, or @c nil if no context was provided.

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

  scrollDirection +

+ +
+
+ +
+ + +
+

Determines collection view’s current scroll direction. Supports 2-axis collection views.

+
+ + + +
@property (nonatomic, readonly) ASScrollDirection scrollDirection
+ + + + + +
+

Return Value

+

a bitmask of ASScrollDirection values.

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

  scrollableDirections +

+ +
+
+ +
+ + +
+

Determines collection view’s scrollable directions.

+
+ + + +
@property (nonatomic, readonly) ASScrollDirection scrollableDirections
+ + + + + +
+

Return Value

+

a bitmask of ASScrollDirection values.

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

  zeroContentInsets +

+ +
+
+ +
+ + +
+

Forces the .contentInset to be UIEdgeInsetsZero.

+
+ + + +
@property (nonatomic) BOOL zeroContentInsets
+ + + + + + + + + +
+

Discussion

+

By default, UIKit sets the top inset to the navigation bar height, even for horizontally +scrolling views. This can only be disabled by setting a property on the containing UIViewController, +automaticallyAdjustsScrollViewInsets, which may not be accessible. ASPagerNode uses this to ensure +its flow layout behaves predictably and does not log undefined layout warnings.

+
+ + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASControlNode.html b/docs/appledoc/Classes/ASControlNode.html new file mode 100755 index 00000000..62781e43 --- /dev/null +++ b/docs/appledoc/Classes/ASControlNode.html @@ -0,0 +1,735 @@ + + + + + + ASControlNode Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASControlNode Class Reference

+ + +
+ + + + + + + +
Inherits fromASDisplayNode : ASDealloc2MainObject
Declared inASControlNode.h
+ + + + +
+ +

Overview

+

ASControlNode cannot be used directly. It instead defines the common interface and behavior structure for all its subclasses. Subclasses should import “ASControlNode+Subclasses.h” for information on methods intended to be overriden.

+
+ + + + + +
+ + + + + + +
+
+ +

  enabled +

+ +
+
+ +
+ + +
+

Indicates whether or not the receiver is enabled.

+
+ + + +
@property (nonatomic, assign, getter=isEnabled) BOOL enabled
+ + + + + + + + + +
+

Discussion

+

Specify YES to make the control enabled; otherwise, specify NO to make it disabled. The default value is YES. If the enabled state is NO, the control ignores touch events and subclasses may draw differently.

+
+ + + + + + + +
+

Declared In

+

ASControlNode.h

+
+ + +
+
+
+ +

  highlighted +

+ +
+
+ +
+ + +
+

Indicates whether or not the receiver is highlighted.

+
+ + + +
@property (nonatomic, assign, getter=isHighlighted) BOOL highlighted
+ + + + + + + + + +
+

Discussion

+

This is set automatically when the there is a touch inside the control and removed on exit or touch up. This is different from touchInside in that it includes an area around the control, rather than just for touches inside the control.

+
+ + + + + + + +
+

Declared In

+

ASControlNode.h

+
+ + +
+
+
+ +

  selected +

+ +
+
+ +
+ + +
+

Indicates whether or not the receiver is highlighted.

+
+ + + +
@property (nonatomic, assign, getter=isSelected) BOOL selected
+ + + + + + + + + +
+

Discussion

+

This is set automatically when the receiver is tapped.

+
+ + + + + + + +
+

Declared In

+

ASControlNode.h

+
+ + +
+
+
+ +

  tracking +

+ +
+
+ +
+ + +
+

Indicates whether or not the receiver is currently tracking touches related to an event.

+
+ + + +
@property (nonatomic, readonly, assign, getter=isTracking) BOOL tracking
+ + + + + + + + + +
+

Discussion

+

YES if the receiver is tracking touches; NO otherwise.

+
+ + + + + + + +
+

Declared In

+

ASControlNode.h

+
+ + +
+
+
+ +

  touchInside +

+ +
+
+ +
+ + +
+

Indicates whether or not a touch is inside the bounds of the receiver.

+
+ + + +
@property (nonatomic, readonly, assign, getter=isTouchInside) BOOL touchInside
+ + + + + + + + + +
+

Discussion

+

YES if a touch is inside the receiver’s bounds; NO otherwise.

+
+ + + + + + + +
+

Declared In

+

ASControlNode.h

+
+ + +
+
+
+ +

– addTarget:action:forControlEvents: +

+ +
+
+ +
+ + +
+

Adds a target-action pair for a particular event (or events).

+
+ + + +
- (void)addTarget:(nullable id)target action:(SEL)action forControlEvents:(ASControlNodeEvent)controlEvents
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
target

The object to which the action message is sent. If this is nil, the responder chain is searched for an object willing to respond to the action message. target is not retained.

action

A selector identifying an action message. May optionally include the sender and the event as parameters, in that order. May not be NULL.

controlEvents

A bitmask specifying the control events for which the action message is sent. May not be 0. See “Control Events” for bitmask constants.

+
+ + + + + + + +
+

Discussion

+

You may call this method multiple times, and you may specify multiple target-action pairs for a particular event. Targets are held weakly.

+
+ + + + + + + +
+

Declared In

+

ASControlNode.h

+
+ + +
+
+
+ +

– actionsForTarget:forControlEvent: +

+ +
+
+ +
+ + +
+

Returns the actions that are associated with a target and a particular control event.

+
+ + + +
- (nullable NSArray<NSString*> *)actionsForTarget:(id)target forControlEvent:(ASControlNodeEvent)controlEvent
+ + + +
+

Parameters

+ + + + + + + + + + + + +
target

The target object. May not be nil.

controlEvent

A single constant of type ASControlNodeEvent that specifies a particular user action on the control; for a list of these constants, see “Control Events”. May not be 0 or ASControlNodeEventAllEvents.

+
+ + + +
+

Return Value

+

An array of selector names as NSString objects, or nil if there are no action selectors associated with controlEvent.

+
+ + + + + + + + + + + +
+

Declared In

+

ASControlNode.h

+
+ + +
+
+
+ +

– allTargets +

+ +
+
+ +
+ + +
+

Returns all target objects associated with the receiver.

+
+ + + +
- (NSSet *)allTargets
+ + + + + +
+

Return Value

+

A set of all targets for the receiver. The set may include NSNull to indicate at least one nil target (meaning, the responder chain is searched for a target.)

+
+ + + + + + + + + + + +
+

Declared In

+

ASControlNode.h

+
+ + +
+
+
+ +

– removeTarget:action:forControlEvents: +

+ +
+
+ +
+ + +
+

Removes a target-action pair for a particular event.

+
+ + + +
- (void)removeTarget:(nullable id)target action:(nullable SEL)action forControlEvents:(ASControlNodeEvent)controlEvents
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
target

The target object. Pass nil to remove all targets paired with action and the specified control events.

action

A selector identifying an action message. Pass NULL to remove all action messages paired with target.

controlEvents

A bitmask specifying the control events associated with target and action. See “Control Events” for bitmask constants. May not be 0.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASControlNode.h

+
+ + +
+
+
+ +

– sendActionsForControlEvents:withEvent: +

+ +
+
+ +
+ + +
+

Sends the actions for the control events for a particular event.

+
+ + + +
- (void)sendActionsForControlEvents:(ASControlNodeEvent)controlEvents withEvent:(nullable UIEvent *)event
+ + + +
+

Parameters

+ + + + + + + + + + + + +
controlEvents

A bitmask specifying the control events for which to send actions. See “Control Events” for bitmask constants. May not be 0.

event

The event which triggered these control actions. May be nil.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASControlNode.h

+
+ + +
+
+
+ +

– setDefaultFocusAppearance +

+ +
+
+ +
+ + +
+

How the node looks when it isn’t focused. Exposed here so that subclasses can override.

+
+ + + +
- (void)setDefaultFocusAppearance
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASControlNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASDisplayNode.html b/docs/appledoc/Classes/ASDisplayNode.html new file mode 100755 index 00000000..caf11072 --- /dev/null +++ b/docs/appledoc/Classes/ASDisplayNode.html @@ -0,0 +1,2727 @@ + + + + + + ASDisplayNode Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASDisplayNode Class Reference

+ + +
+ + + + + + + + + + +
Inherits fromASDealloc2MainObject
Conforms toASLayoutElement
Declared inASDisplayNode.h
+ + + + +
+ +

Overview

+

An ASDisplayNode is an abstraction over UIView and CALayer that allows you to perform calculations about a view +hierarchy off the main thread, and could do rendering off the main thread as well.

+ +

The node API is designed to be as similar as possible to UIView. See the README for examples.

+ +

Subclassing

+ +

ASDisplayNode can be subclassed to create a new UI element. The subclass header ASDisplayNode+Subclasses provides +necessary declarations and conveniences.

+ +

Commons reasons to subclass includes making a UIView property available and receiving a callback after async +display.

+
+ + + + + +
+ + + + +

Initializing a node object

+ +
+
+ +

– init +

+ +
+
+ +
+ + +
+

Designated initializer.

+
+ + + +
- (instancetype)init
+ + + + + +
+

Return Value

+

An ASDisplayNode instance whose view will be a subclass that enables asynchronous rendering, and passes +through -layout and touch handling methods.

+
+ + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

– initWithViewBlock: +

+ +
+
+ +
+ + +
+

Alternative initializer with a block to create the backing view.

+
+ + + +
- (instancetype)initWithViewBlock:(ASDisplayNodeViewBlock)viewBlock
+ + + +
+

Parameters

+ + + + + + + +
viewBlock

The block that will be used to create the backing view.

+
+ + + +
+

Return Value

+

An ASDisplayNode instance that loads its view with the given block that is guaranteed to run on the main +queue. The view will render synchronously and -layout and touch handling methods on the node will not be called.

+
+ + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

– initWithViewBlock:didLoadBlock: +

+ +
+
+ +
+ + +
+

Alternative initializer with a block to create the backing view.

+
+ + + +
- (instancetype)initWithViewBlock:(ASDisplayNodeViewBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock
+ + + +
+

Parameters

+ + + + + + + + + + + + +
viewBlock

The block that will be used to create the backing view.

didLoadBlock

The block that will be called after the view created by the viewBlock is loaded

+
+ + + +
+

Return Value

+

An ASDisplayNode instance that loads its view with the given block that is guaranteed to run on the main +queue. The view will render synchronously and -layout and touch handling methods on the node will not be called.

+
+ + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

– initWithLayerBlock: +

+ +
+
+ +
+ + +
+

Alternative initializer with a block to create the backing layer.

+
+ + + +
- (instancetype)initWithLayerBlock:(ASDisplayNodeLayerBlock)layerBlock
+ + + +
+

Parameters

+ + + + + + + +
layerBlock

The block that will be used to create the backing layer.

+
+ + + +
+

Return Value

+

An ASDisplayNode instance that loads its layer with the given block that is guaranteed to run on the main +queue. The layer will render synchronously and -layout and touch handling methods on the node will not be called.

+
+ + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

– initWithLayerBlock:didLoadBlock: +

+ +
+
+ +
+ + +
+

Alternative initializer with a block to create the backing layer.

+
+ + + +
- (instancetype)initWithLayerBlock:(ASDisplayNodeLayerBlock)layerBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock
+ + + +
+

Parameters

+ + + + + + + + + + + + +
layerBlock

The block that will be used to create the backing layer.

didLoadBlock

The block that will be called after the layer created by the layerBlock is loaded

+
+ + + +
+

Return Value

+

An ASDisplayNode instance that loads its layer with the given block that is guaranteed to run on the main +queue. The layer will render synchronously and -layout and touch handling methods on the node will not be called.

+
+ + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

– onDidLoad: +

+ +
+
+ +
+ + +
+

Add a block of work to be performed on the main thread when the node’s view or layer is loaded. Thread safe.

+
+ + + +
- (void)onDidLoad:(ASDisplayNodeDidLoadBlock)body
+ + + +
+

Parameters

+ + + + + + + +
body

The work to be performed when the node is loaded.

+ +

@precondition The node is not already loaded.

+
+ + + + + + + +
+

Discussion

+

Warning: Be careful not to retain self in body. Change the block parameter list to ^(MYCustomNode *self) {} if you +want to shadow self (e.g. if calling this during init).

Note: This will only be called the next time the node is loaded. If the node is later added to a subtree of a node +that has shouldRasterizeDescendants=YES, and is unloaded, this block will not be called if it is loaded again.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

  synchronous +

+ +
+
+ +
+ + +
+

Returns whether the node is synchronous.

+
+ + + +
@property (nonatomic, readonly, assign, getter=isSynchronous) BOOL synchronous
+ + + + + +
+

Return Value

+

NO if the node wraps a _ASDisplayView, YES otherwise.

+
+ + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+
+ + + +

Getting view and layer

+ +
+
+ +

  view +

+ +
+
+ +
+ + +
+

Returns a view.

+
+ + + +
@property (nonatomic, readonly, strong) UIView *view
+ + + + + + + + + +
+

Discussion

+

The view property is lazily initialized, similar to UIViewController. +To go the other direction, use ASViewToDisplayNode() in ASDisplayNodeExtras.h.

Warning: The first access to it must be on the main thread, and should only be used on the main thread thereafter as +well.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

  nodeLoaded +

+ +
+
+ +
+ + +
+

Returns whether a node’s backing view or layer is loaded.

+
+ + + +
@property (nonatomic, readonly, assign, getter=isNodeLoaded) BOOL nodeLoaded
+ + + + + +
+

Return Value

+

YES if a view is loaded, or if layerBacked is YES and layer is not nil; NO otherwise.

+
+ + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

  layerBacked +

+ +
+
+ +
+ + +
+

Returns whether the node rely on a layer instead of a view.

+
+ + + +
@property (nonatomic, assign, getter=isLayerBacked) BOOL layerBacked
+ + + + + +
+

Return Value

+

YES if the node rely on a layer, NO otherwise.

+
+ + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

  layer +

+ +
+
+ +
+ + +
+

Returns a layer.

+
+ + + +
@property (nonatomic, readonly, strong) CALayer *layer
+ + + + + + + + + +
+

Discussion

+

The layer property is lazily initialized, similar to the view property. +To go the other direction, use ASLayerToDisplayNode() in ASDisplayNodeExtras.h.

Warning: The first access to it must be on the main thread, and should only be used on the main thread thereafter as +well.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

  visible +

+ +
+
+ +
+ + +
+

Returns YES if the node is – at least partially – visible in a window.

+
+ + + +
@property (readonly, getter=isVisible) BOOL visible
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

  inPreloadState +

+ +
+
+ +
+ + +
+

Returns YES if the node is in the preloading interface state.

+
+ + + +
@property (readonly, getter=isInPreloadState) BOOL inPreloadState
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

  inDisplayState +

+ +
+
+ +
+ + +
+

Returns YES if the node is in the displaying interface state.

+
+ + + +
@property (readonly, getter=isInDisplayState) BOOL inDisplayState
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

  interfaceState +

+ +
+
+ +
+ + +
+

Returns the Interface State of the node.

+
+ + + +
@property (readonly) ASInterfaceState interfaceState
+ + + + + +
+

Return Value

+

The current ASInterfaceState of the node, indicating whether it is visible and other situational properties.

+
+ + + + + + + + + +
+

See Also

+ +
+ + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+
+ + + +

Managing dimensions

+ +
+
+ +

– layoutThatFits: +

+ +
+
+ +
+ + +
+

Asks the node to return a layout based on given size range.

+
+ + + +
- (ASLayout *)layoutThatFits:(ASSizeRange)constrainedSize
+ + + +
+

Parameters

+ + + + + + + +
constrainedSize

The minimum and maximum sizes the receiver should fit in.

+
+ + + +
+

Return Value

+

An ASLayout instance defining the layout of the receiver (and its children, if the box layout model is used).

+
+ + + + + +
+

Discussion

+

Though this method does not set the bounds of the view, it does have side effects–caching both the +constraint and the result.

Warning: Subclasses must not override this; it caches results from -calculateLayoutThatFits:. Calling this method may +be expensive if result is not cached.

+
+ + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

  layoutSpecBlock +

+ +
+
+ +
+ + +
+

Provides a way to declare a block to provide an ASLayoutSpec without having to subclass ASDisplayNode and +implement layoutSpecThatFits:

+
+ + + +
@property (nonatomic, readwrite, copy, nullable) ASLayoutSpecBlock layoutSpecBlock
+ + + + + +
+

Return Value

+

A block that takes a constrainedSize ASSizeRange argument, and must return an ASLayoutSpec that includes all +of the subnodes to position in the layout. This input-output relationship is identical to the subclass override +method -layoutSpecThatFits:

+
+ + + + + +
+

Discussion

+

Warning: Subclasses that implement -layoutSpecThatFits: must not also use .layoutSpecBlock. Doing so will trigger +an exception. A future version of the framework may support using both, calling them serially, with the +.layoutSpecBlock superseding any values set by the method override.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

  calculatedSize +

+ +
+
+ +
+ + +
+

Return the calculated size.

+
+ + + +
@property (nonatomic, readonly, assign) CGSize calculatedSize
+ + + + + +
+

Return Value

+

Size already calculated by -calculateLayoutThatFits:.

+
+ + + + + +
+

Discussion

+

Ideal for use by subclasses in -layout, having already prompted their subnodes to calculate their size by +calling -measure: on them in -calculateLayoutThatFits.

Warning: Subclasses must not override this; it returns the last cached measurement and is never expensive.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

  constrainedSizeForCalculatedLayout +

+ +
+
+ +
+ + +
+

Return the constrained size range used for calculating layout.

+
+ + + +
@property (nonatomic, readonly, assign) ASSizeRange constrainedSizeForCalculatedLayout
+ + + + + +
+

Return Value

+

The minimum and maximum constrained sizes used by calculateLayoutThatFits:.

+
+ + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+
+ + + +

Managing the nodes hierarchy

+ +
+
+ +

– addSubnode: +

+ +
+
+ +
+ + +
+

Add a node as a subnode to this node.

+
+ + + +
- (void)addSubnode:(ASDisplayNode *)subnode
+ + + +
+

Parameters

+ + + + + + + +
subnode

The node to be added.

+
+ + + + + + + +
+

Discussion

+

The subnode’s view will automatically be added to this node’s view, lazily if the views are not created +yet.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

– insertSubnode:belowSubnode: +

+ +
+
+ +
+ + +
+

Insert a subnode before a given subnode in the list.

+
+ + + +
- (void)insertSubnode:(ASDisplayNode *)subnode belowSubnode:(ASDisplayNode *)below
+ + + +
+

Parameters

+ + + + + + + + + + + + +
subnode

The node to insert below another node.

below

The sibling node that will be above the inserted node.

+
+ + + + + + + +
+

Discussion

+

If the views are loaded, the subnode’s view will be inserted below the given node’s view in the hierarchy +even if there are other non-displaynode views.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

– insertSubnode:aboveSubnode: +

+ +
+
+ +
+ + +
+

Insert a subnode after a given subnode in the list.

+
+ + + +
- (void)insertSubnode:(ASDisplayNode *)subnode aboveSubnode:(ASDisplayNode *)above
+ + + +
+

Parameters

+ + + + + + + + + + + + +
subnode

The node to insert below another node.

above

The sibling node that will be behind the inserted node.

+
+ + + + + + + +
+

Discussion

+

If the views are loaded, the subnode’s view will be inserted above the given node’s view in the hierarchy +even if there are other non-displaynode views.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

– insertSubnode:atIndex: +

+ +
+
+ +
+ + +
+

Insert a subnode at a given index in subnodes.

+
+ + + +
- (void)insertSubnode:(ASDisplayNode *)subnode atIndex:(NSInteger)idx
+ + + +
+

Parameters

+ + + + + + + + + + + + +
subnode

The node to insert.

idx

The index in the array of the subnodes property at which to insert the node. Subnodes indices start at 0 +and cannot be greater than the number of subnodes.

+
+ + + + + + + +
+

Discussion

+

If this node’s view is loaded, ASDisplayNode insert the subnode’s view after the subnode at index - 1’s +view even if there are other non-displaynode views.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

– replaceSubnode:withSubnode: +

+ +
+
+ +
+ + +
+

Replace subnode with replacementSubnode.

+
+ + + +
- (void)replaceSubnode:(ASDisplayNode *)subnode withSubnode:(ASDisplayNode *)replacementSubnode
+ + + +
+

Parameters

+ + + + + + + + + + + + +
subnode

A subnode of self.

replacementSubnode

A node with which to replace subnode.

+
+ + + + + + + +
+

Discussion

+

Should both subnode and replacementSubnode already be subnodes of self, subnode is removed and +replacementSubnode inserted in its place. +If subnode is not a subnode of self, this method will throw an exception. +If replacementSubnode is nil, this method will throw an exception

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

– removeFromSupernode +

+ +
+
+ +
+ + +
+

Remove this node from its supernode.

+
+ + + +
- (void)removeFromSupernode
+ + + + + + + + + +
+

Discussion

+

The node’s view will be automatically removed from the supernode’s view.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

  subnodes +

+ +
+
+ +
+ + +
+

The receiver’s immediate subnodes.

+
+ + + +
@property (nonatomic, readonly, copy) NSArray<ASDisplayNode*> *subnodes
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

  supernode +

+ +
+
+ +
+ + +
+

The receiver’s supernode.

+
+ + + +
@property (nonatomic, readonly, weak) ASDisplayNode *supernode
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+
+ + + +

Drawing and Updating the View

+ +
+
+ +

  displaysAsynchronously +

+ +
+
+ +
+ + +
+

Whether this node’s view performs asynchronous rendering.

+
+ + + +
@property (nonatomic, assign) BOOL displaysAsynchronously
+ + + + + +
+

Return Value

+

Defaults to YES, except for synchronous views (ie, those created with -initWithViewBlock: / +-initWithLayerBlock:), which are always NO.

+
+ + + + + +
+

Discussion

+

If this flag is set, then the node will participate in the current asyncdisplaykit_async_transaction and +do its rendering on the displayQueue instead of the main thread.

+ +

Asynchronous rendering proceeds as follows:

+ +

When the view is initially added to the hierarchy, it has -needsDisplay true. +After layout, Core Animation will call -display on the _ASDisplayLayer +-display enqueues a rendering operation on the displayQueue +When the render block executes, it calls the delegate display method (-drawRect:… or -display) +The delegate provides contents via this method and an operation is added to the asyncdisplaykit_async_transaction +Once all rendering is complete for the current asyncdisplaykit_async_transaction, +the completion for the block sets the contents on all of the layers in the same frame

+ +

If asynchronous rendering is disabled:

+ +

When the view is initially added to the hierarchy, it has -needsDisplay true. +After layout, Core Animation will call -display on the _ASDisplayLayer +-display calls delegate display method (-drawRect:… or -display) immediately +-display sets the layer contents immediately with the result

+ +

Note: this has nothing to do with -[CALayer drawsAsynchronously].

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

  shouldRasterizeDescendants +

+ +
+
+ +
+ + +
+

Whether to draw all descendant nodes' layers/views into this node’s layer/view’s backing store.

+
+ + + +
@property (nonatomic, assign) BOOL shouldRasterizeDescendants
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

  displaySuspended +

+ +
+
+ +
+ + +
+

Prevent the node’s layer from displaying.

+
+ + + +
@property (nonatomic, assign) BOOL displaySuspended
+ + + + + + + + + +
+

Discussion

+

A subclass may check this flag during -display or -drawInContext: to cancel a display that is already in +progress.

+ +

Defaults to NO. Does not control display for any child or descendant nodes; for that, use +-recursivelySetDisplaySuspended:.

+ +

If a setNeedsDisplay occurs while displaySuspended is YES, and displaySuspended is set to NO, then the +layer will be automatically displayed.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

  shouldAnimateSizeChanges +

+ +
+
+ +
+ + +
+

Whether size changes should be animated. Default to YES.

+
+ + + +
@property (nonatomic, assign) BOOL shouldAnimateSizeChanges
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

– recursivelySetDisplaySuspended: +

+ +
+
+ +
+ + +
+

Prevent the node and its descendants' layer from displaying.

+
+ + + +
- (void)recursivelySetDisplaySuspended:(BOOL)flag
+ + + +
+

Parameters

+ + + + + + + +
flag

YES if display should be prevented or cancelled; NO otherwise.

+
+ + + + + + + + + + + +
+

See Also

+ +
+ + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

– recursivelyClearContents +

+ +
+
+ +
+ + +
+

Calls -clearContents on the receiver and its subnode hierarchy.

+
+ + + +
- (void)recursivelyClearContents
+ + + + + + + + + +
+

Discussion

+

Clears backing stores and other memory-intensive intermediates. +If the node is removed from a visible hierarchy and then re-added, it will automatically trigger a new asynchronous display, +as long as displaySuspended is not set. +If the node remains in the hierarchy throughout, -setNeedsDisplay is required to trigger a new asynchronous display.

+
+ + + + + +
+

See Also

+ +
+ + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

– recursivelyClearFetchedData +

+ +
+
+ +
+ + +
+

Calls -clearFetchedData on the receiver and its subnode hierarchy.

+
+ + + +
- (void)recursivelyClearFetchedData
+ + + + + + + + + +
+

Discussion

+

Clears any memory-intensive fetched content. +This method is used to notify the node that it should purge any content that is both expensive to fetch and to +retain in memory.

+
+ + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

– recursivelyFetchData +

+ +
+
+ +
+ + +
+

Calls -fetchData on the receiver and its subnode hierarchy.

+
+ + + +
- (void)recursivelyFetchData
+ + + + + + + + + +
+

Discussion

+

Fetches content from remote sources for the current node and all subnodes.

+
+ + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

– setNeedsDataFetch +

+ +
+
+ +
+ + +
+

Triggers a recursive call to fetchData when the node has an interfaceState of ASInterfaceStatePreload

+
+ + + +
- (void)setNeedsDataFetch
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

  placeholderEnabled +

+ +
+
+ +
+ + +
+

Toggle displaying a placeholder over the node that covers content until the node and all subnodes are +displayed.

+
+ + + +
@property (nonatomic, assign) BOOL placeholderEnabled
+ + + + + + + + + +
+

Discussion

+

Defaults to NO.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

  placeholderFadeDuration +

+ +
+
+ +
+ + +
+

Set the time it takes to fade out the placeholder when a node’s contents are finished displaying.

+
+ + + +
@property (nonatomic, assign) NSTimeInterval placeholderFadeDuration
+ + + + + + + + + +
+

Discussion

+

Defaults to 0 seconds.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

  drawingPriority +

+ +
+
+ +
+ + +
+

Determines drawing priority of the node. Nodes with higher priority will be drawn earlier.

+
+ + + +
@property (nonatomic, assign) NSInteger drawingPriority
+ + + + + + + + + +
+

Discussion

+

Defaults to ASDefaultDrawingPriority. There may be multiple drawing threads, and some of them may +decide to perform operations in queued order (regardless of drawingPriority)

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+
+ + + +

Hit Testing

+ +
+
+ +

  hitTestSlop +

+ +
+
+ +
+ + +
+

Bounds insets for hit testing.

+
+ + + +
@property (nonatomic, assign) UIEdgeInsets hitTestSlop
+ + + + + + + + + +
+

Discussion

+

When set to a non-zero inset, increases the bounds for hit testing to make it easier to tap or perform +gestures on this node. Default is UIEdgeInsetsZero.

+ +

This affects the default implementation of -hitTest and -pointInside, so subclasses should call super if you override +it and want hitTestSlop applied.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

– pointInside:withEvent: +

+ +
+
+ +
+ + +
+

Returns a Boolean value indicating whether the receiver contains the specified point.

+
+ + + +
- (BOOL)pointInside:(CGPoint)point withEvent:(nullable UIEvent *)event
+ + + +
+

Parameters

+ + + + + + + + + + + + +
point

A point that is in the receiver’s local coordinate system (bounds).

event

The event that warranted a call to this method.

+
+ + + +
+

Return Value

+

YES if point is inside the receiver’s bounds; otherwise, NO.

+
+ + + + + +
+

Discussion

+

Includes the “slop” factor specified with hitTestSlop.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+
+ + + +

Converting Between View Coordinate Systems

+ +
+
+ +

– convertPoint:toNode: +

+ +
+
+ +
+ + +
+

Converts a point from the receiver’s coordinate system to that of the specified node.

+
+ + + +
- (CGPoint)convertPoint:(CGPoint)point toNode:(nullable ASDisplayNode *)node
+ + + +
+

Parameters

+ + + + + + + + + + + + +
point

A point specified in the local coordinate system (bounds) of the receiver.

node

The node into whose coordinate system point is to be converted.

+
+ + + +
+

Return Value

+

The point converted to the coordinate system of node.

+
+ + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

– convertPoint:fromNode: +

+ +
+
+ +
+ + +
+

Converts a point from the coordinate system of a given node to that of the receiver.

+
+ + + +
- (CGPoint)convertPoint:(CGPoint)point fromNode:(nullable ASDisplayNode *)node
+ + + +
+

Parameters

+ + + + + + + + + + + + +
point

A point specified in the local coordinate system (bounds) of node.

node

The node with point in its coordinate system.

+
+ + + +
+

Return Value

+

The point converted to the local coordinate system (bounds) of the receiver.

+
+ + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

– convertRect:toNode: +

+ +
+
+ +
+ + +
+

Converts a rectangle from the receiver’s coordinate system to that of another view.

+
+ + + +
- (CGRect)convertRect:(CGRect)rect toNode:(nullable ASDisplayNode *)node
+ + + +
+

Parameters

+ + + + + + + + + + + + +
rect

A rectangle specified in the local coordinate system (bounds) of the receiver.

node

The node that is the target of the conversion operation.

+
+ + + +
+

Return Value

+

The converted rectangle.

+
+ + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

– convertRect:fromNode: +

+ +
+
+ +
+ + +
+

Converts a rectangle from the coordinate system of another node to that of the receiver.

+
+ + + +
- (CGRect)convertRect:(CGRect)rect fromNode:(nullable ASDisplayNode *)node
+ + + +
+

Parameters

+ + + + + + + + + + + + +
rect

A rectangle specified in the local coordinate system (bounds) of node.

node

The node with rect in its coordinate system.

+
+ + + +
+

Return Value

+

The converted rectangle.

+
+ + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASEditableTextNode.html b/docs/appledoc/Classes/ASEditableTextNode.html new file mode 100755 index 00000000..409bc459 --- /dev/null +++ b/docs/appledoc/Classes/ASEditableTextNode.html @@ -0,0 +1,700 @@ + + + + + + ASEditableTextNode Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASEditableTextNode Class Reference

+ + +
+ + + + + + + + + + +
Inherits fromASDisplayNode : ASDealloc2MainObject
Conforms toUITextInputTraits
Declared inASEditableTextNode.h
+ + + + +
+ +

Overview

+

Does not support layer backing.

+
+ + + + + +
+ + + + + + +
+
+ +

– init +

+ +
+
+ +
+ + +
+

Initializes an editable text node using default TextKit components.

+
+ + + +
- (instancetype)init
+ + + + + +
+

Return Value

+

An initialized ASEditableTextNode.

+
+ + + + + + + + + + + +
+

Declared In

+

ASEditableTextNode.h

+
+ + +
+
+
+ +

– initWithTextKitComponents:placeholderTextKitComponents: +

+ +
+
+ +
+ + +
+

Initializes an editable text node using the provided TextKit components.

+
+ + + +
- (instancetype)initWithTextKitComponents:(ASTextKitComponents *)textKitComponents placeholderTextKitComponents:(ASTextKitComponents *)placeholderTextKitComponents
+ + + +
+

Parameters

+ + + + + + + + + + + + +
textKitComponents

The TextKit stack used to render text.

placeholderTextKitComponents

The TextKit stack used to render placeholder text.

+
+ + + +
+

Return Value

+

An initialized ASEditableTextNode.

+
+ + + + + + + + + + + +
+

Declared In

+

ASEditableTextNode.h

+
+ + +
+
+
+ +

  scrollEnabled +

+ +
+
+ +
+ + +
+

Enable scrolling on the textView +@default true

+
+ + + +
@property (nonatomic) BOOL scrollEnabled
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASEditableTextNode.h

+
+ + +
+
+
+ +

  textView +

+ +
+
+ +
+ + +
+

Access to underlying UITextView for more configuration options.

+
+ + + +
@property (nonatomic, readonly, strong) UITextView *textView
+ + + + + + + + + +
+

Discussion

+

Warning: This property should only be used on the main thread and should not be accessed before the editable text node’s view is created.

+
+ + + + + + + +
+

Declared In

+

ASEditableTextNode.h

+
+ + +
+
+
+ +

– isDisplayingPlaceholder +

+ +
+
+ +
+ + +
+

Indicates if the receiver is displaying the placeholder text.

+
+ + + +
- (BOOL)isDisplayingPlaceholder
+ + + + + +
+

Return Value

+

YES if the placeholder is currently displayed; NO otherwise.

+
+ + + + + +
+

Discussion

+

To update the placeholder, see the attributedPlaceholderText property.

+
+ + + + + + + +
+

Declared In

+

ASEditableTextNode.h

+
+ + +
+
+
+ +

  attributedPlaceholderText +

+ +
+
+ +
+ + +
+

The styled placeholder text displayed by the text node while no text is entered

+
+ + + +
@property (nonatomic, readwrite, strong, nullable) NSAttributedString *attributedPlaceholderText
+ + + + + + + + + +
+

Discussion

+

The placeholder is displayed when the user has not entered any text and the keyboard is not visible.

+
+ + + + + + + +
+

Declared In

+

ASEditableTextNode.h

+
+ + +
+
+
+ +

  attributedText +

+ +
+
+ +
+ + +
+

The styled text displayed by the receiver.

+
+ + + +
@property (nonatomic, readwrite, copy, nullable) NSAttributedString *attributedText
+ + + + + + + + + +
+

Discussion

+

When the placeholder is displayed (as indicated by -isDisplayingPlaceholder), this value is nil. Otherwise, this value is the attributed text the user has entered. This value can be modified regardless of whether the receiver is the first responder (and thus, editing) or not. Changing this value from nil to non-nil will result in the placeholder being hidden, and the new value being displayed.

+
+ + + + + + + +
+

Declared In

+

ASEditableTextNode.h

+
+ + +
+
+
+ +

  textContainerInset +

+ +
+
+ +
+ + +
+

The textContainerInset of both the placeholder and typed textView. This value defaults to UIEdgeInsetsZero.

+
+ + + +
@property (nonatomic, readwrite) UIEdgeInsets textContainerInset
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASEditableTextNode.h

+
+ + +
+
+
+ +

  autocapitalizationType +

+ +
+
+ +
+ + +
+

properties.

+
+ + + +
@property (nonatomic, readwrite, assign) UITextAutocapitalizationType autocapitalizationType
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASEditableTextNode.h

+
+ + +
+
+
+ +

– isFirstResponder +

+ +
+
+ +
+ + +
+

Indicates whether the receiver’s text view is the first responder, and thus has the keyboard visible and is prepared for editing by the user.

+
+ + + +
- (BOOL)isFirstResponder
+ + + + + +
+

Return Value

+

YES if the receiver’s text view is the first-responder; NO otherwise.

+
+ + + + + + + + + + + +
+

Declared In

+

ASEditableTextNode.h

+
+ + +
+
+
+ +

– frameForTextRange: +

+ +
+
+ +
+ + +
+

Returns the frame of the given range of characters.

+
+ + + +
- (CGRect)frameForTextRange:(NSRange)textRange
+ + + +
+

Parameters

+ + + + + + + +
textRange

A range of characters.

+
+ + + +
+

Return Value

+

A CGRect that is the bounding box of the glyphs covered by the given range of characters, in the coordinate system of the receiver.

+
+ + + + + +
+

Discussion

+

This method raises an exception if textRange is not a valid range of characters within the receiver’s attributed text.

+
+ + + + + + + +
+

Declared In

+

ASEditableTextNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASImageNode.html b/docs/appledoc/Classes/ASImageNode.html new file mode 100755 index 00000000..387adaa0 --- /dev/null +++ b/docs/appledoc/Classes/ASImageNode.html @@ -0,0 +1,674 @@ + + + + + + ASImageNode Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASImageNode Class Reference

+ + +
+ + + + + + + +
Inherits fromASControlNode : ASDisplayNode : ASDealloc2MainObject
Declared inASImageNode.h
+ + + + +
+ +

Overview

+

Supports cropping, tinting, and arbitrary image modification blocks.

+
+ + + + + +
+ + + + + + +
+
+ +

  image +

+ +
+
+ +
+ + +
+

The image to display.

+
+ + + +
@property (nullable, nonatomic, strong) UIImage *image
+ + + + + + + + + +
+

Discussion

+

The node will efficiently display stretchable images by using +the layer’s contentsCenter property. Non-stretchable images work too, of +course.

+
+ + + + + + + +
+

Declared In

+

ASImageNode.h

+
+ + +
+
+
+ +

  placeholderColor +

+ +
+
+ +
+ + +
+

The placeholder color.

+
+ + + +
@property (nullable, nonatomic, strong) UIColor *placeholderColor
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASImageNode.h

+
+ + +
+
+
+ +

  cropEnabled +

+ +
+
+ +
+ + +
+

Indicates whether efficient cropping of the receiver is enabled.

+
+ + + +
@property (nonatomic, assign, getter=isCropEnabled) BOOL cropEnabled
+ + + + + + + + + +
+

Discussion

+

Defaults to YES. See -setCropEnabled:recropImmediately:inBounds: for more +information.

+
+ + + + + + + +
+

Declared In

+

ASImageNode.h

+
+ + +
+
+
+ +

  forceUpscaling +

+ +
+
+ +
+ + +
+

Indicates that efficient downsizing of backing store should not be enabled.

+
+ + + +
@property (nonatomic, assign) BOOL forceUpscaling
+ + + + + + + + + +
+

Discussion

+

Defaults to NO. @see ASCroppedImageBackingSizeAndDrawRectInBounds for more +information.

+
+ + + + + + + +
+

Declared In

+

ASImageNode.h

+
+ + +
+
+
+ +

  forcedSize +

+ +
+
+ +
+ + +
+

Forces image to be rendered at forcedSize.

+
+ + + +
@property (nonatomic, assign) CGSize forcedSize
+ + + + + + + + + +
+

Discussion

+

Defaults to CGSizeZero to indicate that the forcedSize should not be used. +Setting forcedSize to non-CGSizeZero will force the backing of the layer contents to +be forcedSize (automatically adjusted for contentsSize).

+
+ + + + + + + +
+

Declared In

+

ASImageNode.h

+
+ + +
+
+
+ +

– setCropEnabled:recropImmediately:inBounds: +

+ +
+
+ +
+ + +
+

Enables or disables efficient cropping.

+
+ + + +
- (void)setCropEnabled:(BOOL)cropEnabled recropImmediately:(BOOL)recropImmediately inBounds:(CGRect)cropBounds
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
cropEnabled

YES to efficiently crop the receiver’s contents such that +contents outside of its bounds are not included; NO otherwise.

recropImmediately

If the receiver has an image, YES to redisplay the +receiver immediately; NO otherwise.

cropBounds

The bounds into which the receiver will be cropped. Useful +if bounds are to change in response to cropping (but have not yet done so).

+
+ + + + + + + +
+

Discussion

+

Efficient cropping is only performed when the receiver’s view’s +contentMode is UIViewContentModeScaleAspectFill. By default, cropping is +enabled. The crop alignment may be controlled via cropAlignmentFactor.

+
+ + + + + + + +
+

Declared In

+

ASImageNode.h

+
+ + +
+
+
+ +

  cropRect +

+ +
+
+ +
+ + +
+

A value that controls how the receiver’s efficient cropping is aligned.

+
+ + + +
@property (nonatomic, readwrite, assign) CGRect cropRect
+ + + + + + + + + +
+

Discussion

+

This value defines a rectangle that is to be featured by the +receiver. The rectangle is specified as a “unit rectangle,” using +fractions of the source image’s width and height, e.g. CGRectMake(0.5, 0, +0.5, 1.0) will feature the full right half a photo. If the cropRect is +empty, the content mode of the receiver will be used to determine its +dimensions, and only the cropRect’s origin will be used for positioning. The +default value of this property is CGRectMake(0.5, 0.5, 0.0, 0.0).

+
+ + + + + + + +
+

Declared In

+

ASImageNode.h

+
+ + +
+
+
+ +

  imageModificationBlock +

+ +
+
+ +
+ + +
+

An optional block which can perform drawing operations on image +during the display phase.

+
+ + + +
@property (nullable, nonatomic, readwrite, copy) asimagenode_modification_block_t imageModificationBlock
+ + + + + + + + + +
+

Discussion

+

Can be used to add image effects (such as rounding, adding +borders, or other pattern overlays) without extraneous display calls.

+
+ + + + + + + +
+

Declared In

+

ASImageNode.h

+
+ + +
+
+
+ +

– setNeedsDisplayWithCompletion: +

+ +
+
+ +
+ + +
+

Marks the receiver as needing display and performs a block after +display has finished.

+
+ + + +
- (void)setNeedsDisplayWithCompletion:(nullable void ( ^ ) ( BOOL canceled ))displayCompletionBlock
+ + + +
+

Parameters

+ + + + + + + +
displayCompletionBlock

The block to be performed after display has +finished. Its canceled property will be YES if display was prevented or +canceled (via displaySuspended); NO otherwise.

+
+ + + + + + + +
+

Discussion

+

displayCompletionBlock will be performed on the main-thread. If +displaySuspended is YES, displayCompletionBlock is will be +performed immediately and YES will be passed for canceled.

+
+ + + + + + + +
+

Declared In

+

ASImageNode.h

+
+ + +
+
+
+ +

  isDefaultFocusAppearance +

+ +
+
+ +
+ + +
+

A bool to track if the current appearance of the node +is the default focus appearance. +Exposed here so the category methods can set it.

+
+ + + +
@property (nonatomic, assign) BOOL isDefaultFocusAppearance
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASImageNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASInsetLayoutSpec.html b/docs/appledoc/Classes/ASInsetLayoutSpec.html new file mode 100755 index 00000000..5349d434 --- /dev/null +++ b/docs/appledoc/Classes/ASInsetLayoutSpec.html @@ -0,0 +1,214 @@ + + + + + + ASInsetLayoutSpec Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASInsetLayoutSpec Class Reference

+ + +
+ + + + + + + +
Inherits fromASLayoutSpec : NSObject
Declared inASInsetLayoutSpec.h
+ + + + +
+ +

Overview

+

A layout spec that wraps another layoutElement child, applying insets around it.

+ +

If the child has a size specified as a fraction, the fraction is resolved against this spec’s parent +size after applying insets.

+ +

@example ASOuterLayoutSpec contains an ASInsetLayoutSpec with an ASInnerLayoutSpec. Suppose that: +- ASOuterLayoutSpec is 200pt wide. +- ASInnerLayoutSpec specifies its width as 100%. +- The ASInsetLayoutSpec has insets of 10pt on every side. +ASInnerLayoutSpec will have size 180pt, not 200pt, because it receives a parent size that has been adjusted for insets.

+ +

If you’re familiar with CSS: ASInsetLayoutSpec’s child behaves similarly to “box-sizing: border-box”.

+ +

An infinite inset is resolved as an inset equal to all remaining space after applying the other insets and child size. +@example An ASInsetLayoutSpec with an infinite left inset and 10px for all other edges will position it’s child 10px from the right edge.

+
+ + + + + +
+ + + + + + +
+
+ +

+ insetLayoutSpecWithInsets:child: +

+ +
+
+ +
+ + +
+

The amount of space to inset on each side.

+
+ + + +
+ (instancetype)insetLayoutSpecWithInsets:(UIEdgeInsets)insets child:(id<ASLayoutElement>)child
+ + + +
+

Parameters

+ + + + + + + + + + + + +
insets

The amount of space to inset on each side.

child

The wrapped child to inset.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASInsetLayoutSpec.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASLayout.html b/docs/appledoc/Classes/ASLayout.html new file mode 100755 index 00000000..98474e10 --- /dev/null +++ b/docs/appledoc/Classes/ASLayout.html @@ -0,0 +1,762 @@ + + + + + + ASLayout Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASLayout Class Reference

+ + +
+ + + + + + + +
Inherits fromNSObject
Declared inASLayout.h
+ + + + +
+ +

Overview

+

A node in the layout tree that represents the size and position of the object that created it (ASLayoutElement).

+
+ + + + + +
+ + + + + + +
+
+ +

  layoutElement +

+ +
+
+ +
+ + +
+

The underlying object described by this layout

+
+ + + +
@property (nonatomic, weak, readonly) id<ASLayoutElement> layoutElement
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASLayout.h

+
+ + +
+
+
+ +

  type +

+ +
+
+ +
+ + +
+

The type of ASLayoutElement that created this layout

+
+ + + +
@property (nonatomic, assign, readonly) ASLayoutElementType type
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASLayout.h

+
+ + +
+
+
+ +

  size +

+ +
+
+ +
+ + +
+

Size of the current layout

+
+ + + +
@property (nonatomic, assign, readonly) CGSize size
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASLayout.h

+
+ + +
+
+
+ +

  position +

+ +
+
+ +
+ + +
+

Position in parent. Default to CGPointNull.

+
+ + + +
@property (nonatomic, assign, readonly) CGPoint position
+ + + + + + + + + +
+

Discussion

+

When being used as a sublayout, this property must not equal CGPointNull.

+
+ + + + + + + +
+

Declared In

+

ASLayout.h

+
+ + +
+
+
+ +

  sublayouts +

+ +
+
+ +
+ + +
+

Array of ASLayouts. Each must have a valid non-null position.

+
+ + + +
@property (nonatomic, copy, readonly) NSArray<ASLayout*> *sublayouts
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASLayout.h

+
+ + +
+
+
+ +

  frame +

+ +
+
+ +
+ + +
+

Returns a valid frame for the current layout computed with the size and position.

+
+ + + +
@property (nonatomic, assign, readonly) CGRect frame
+ + + + + + + + + +
+

Discussion

+

Clamps the layout’s origin or position to 0 if any of the calculated values are infinite.

+
+ + + + + + + +
+

Declared In

+

ASLayout.h

+
+ + +
+
+
+ +

– initWithLayoutElement:size:position:sublayouts: +

+ +
+
+ +
+ + +
+

Designated initializer

+
+ + + +
- (instancetype)initWithLayoutElement:(id<ASLayoutElement>)layoutElement size:(CGSize)size position:(CGPoint)position sublayouts:(nullable NSArray<ASLayout*> *)sublayouts
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASLayout.h

+
+ + +
+
+
+ +

+ layoutWithLayoutElement:size:position:sublayouts: +

+ +
+
+ +
+ + +
+

Convenience class initializer for layout construction.

+
+ + + +
+ (instancetype)layoutWithLayoutElement:(id<ASLayoutElement>)layoutElement size:(CGSize)size position:(CGPoint)position sublayouts:(nullable NSArray<ASLayout*> *)sublayouts
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
layoutElement

The backing ASLayoutElement object.

size

The size of this layout.

position

The position of this layout within its parent (if available).

sublayouts

Sublayouts belong to the new layout.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASLayout.h

+
+ + +
+
+
+ +

+ layoutWithLayoutElement:size:sublayouts: +

+ +
+
+ +
+ + +
+

Convenience initializer that has CGPointNull position. +Best used by ASDisplayNode subclasses that are manually creating a layout for -calculateLayoutThatFits:, +or for ASLayoutSpec subclasses that are referencing the “self” level in the layout tree, +or for creating a sublayout of which the position is yet to be determined.

+
+ + + +
+ (instancetype)layoutWithLayoutElement:(id<ASLayoutElement>)layoutElement size:(CGSize)size sublayouts:(nullable NSArray<ASLayout*> *)sublayouts
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
layoutElement

The backing ASLayoutElement object.

size

The size of this layout.

sublayouts

Sublayouts belong to the new layout.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASLayout.h

+
+ + +
+
+
+ +

+ layoutWithLayoutElement:size: +

+ +
+
+ +
+ + +
+

Convenience that has CGPointNull position and no sublayouts. +Best used for creating a layout that has no sublayouts, and is either a root one +or a sublayout of which the position is yet to be determined.

+
+ + + +
+ (instancetype)layoutWithLayoutElement:(id<ASLayoutElement>)layoutElement size:(CGSize)size
+ + + +
+

Parameters

+ + + + + + + + + + + + +
layoutElement

The backing ASLayoutElement object.

size

The size of this layout.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASLayout.h

+
+ + +
+
+
+ +

+ layoutWithLayout:position: +

+ +
+
+ +
+ + +
+

Convenience initializer that creates a layout based on the values of the given layout, with a new position

+
+ + + +
+ (instancetype)layoutWithLayout:(ASLayout *)layout position:(CGPoint)position
+ + + +
+

Parameters

+ + + + + + + + + + + + +
layout

The layout to use to create the new layout

position

The position of the new layout

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASLayout.h

+
+ + +
+
+
+ +

– filteredNodeLayoutTree +

+ +
+
+ +
+ + +
+

Traverses the existing layout tree and generates a new tree that represents only ASDisplayNode layouts

+
+ + + +
- (ASLayout *)filteredNodeLayoutTree
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASLayout.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASLayoutElementStyle.html b/docs/appledoc/Classes/ASLayoutElementStyle.html new file mode 100755 index 00000000..6a71f721 --- /dev/null +++ b/docs/appledoc/Classes/ASLayoutElementStyle.html @@ -0,0 +1,796 @@ + + + + + + ASLayoutElementStyle Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASLayoutElementStyle Class Reference

+ + +
+ + + + + + + + + + +
Inherits fromNSObject
Conforms toASAbsoluteLayoutElement
ASStackLayoutElement
Declared inASLayoutElement.h
+ + + + + + +
+ + + + + + +
+
+ +

– initWithDelegate: +

+ +
+
+ +
+ + +
+

Initializes the layoutElement style with a specified delegate

+
+ + + +
- (instancetype)initWithDelegate:(id<ASLayoutElementStyleDelegate>)delegate
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASLayoutElement.h

+
+ + +
+
+
+ +

  delegate +

+ +
+
+ +
+ + +
+

The object that acts as the delegate of the style.

+
+ + + +
@property (nullable, nonatomic, weak, readonly) id<ASLayoutElementStyleDelegate> delegate
+ + + + + + + + + +
+

Discussion

+

The delegate must adopt the ASLayoutElementStyleDelegate protocol. The delegate is not retained.

+
+ + + + + + + +
+

Declared In

+

ASLayoutElement.h

+
+ + +
+
+
+ +

  width +

+ +
+
+ +
+ + +
+

The width property specifies the height of the content area of an ASLayoutElement. +The minWidth and maxWidth properties override width. +Defaults to ASDimensionAuto

+
+ + + +
@property (nonatomic, assign, readwrite) ASDimension width
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASLayoutElement.h

+
+ + +
+
+
+ +

  height +

+ +
+
+ +
+ + +
+

The height property specifies the height of the content area of an ASLayoutElement +The minHeight and maxHeight properties override height. +Defaults to ASDimensionAuto

+
+ + + +
@property (nonatomic, assign, readwrite) ASDimension height
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASLayoutElement.h

+
+ + +
+
+
+ +

  minHeight +

+ +
+
+ +
+ + +
+

The minHeight property is used to set the minimum height of a given element. It prevents the used value +of the height property from becoming smaller than the value specified for minHeight. +The value of minHeight overrides both maxHeight and height. +Defaults to ASDimensionAuto

+
+ + + +
@property (nonatomic, assign, readwrite) ASDimension minHeight
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASLayoutElement.h

+
+ + +
+
+
+ +

  maxHeight +

+ +
+
+ +
+ + +
+

The maxHeight property is used to set the maximum height of an element. It prevents the used value of the +height property from becoming larger than the value specified for maxHeight. +The value of maxHeight overrides height, but minHeight overrides maxHeight. +Defaults to ASDimensionAuto

+
+ + + +
@property (nonatomic, assign, readwrite) ASDimension maxHeight
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASLayoutElement.h

+
+ + +
+
+
+ +

  minWidth +

+ +
+
+ +
+ + +
+

The minWidth property is used to set the minimum width of a given element. It prevents the used value of +the width property from becoming smaller than the value specified for minWidth. +The value of minWidth overrides both maxWidth and width. +Defaults to ASDimensionAuto

+
+ + + +
@property (nonatomic, assign, readwrite) ASDimension minWidth
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASLayoutElement.h

+
+ + +
+
+
+ +

  maxWidth +

+ +
+
+ +
+ + +
+

The maxWidth property is used to set the maximum width of a given element. It prevents the used value of +the width property from becoming larger than the value specified for maxWidth. +The value of maxWidth overrides width, but minWidth overrides maxWidth. +Defaults to ASDimensionAuto

+
+ + + +
@property (nonatomic, assign, readwrite) ASDimension maxWidth
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASLayoutElement.h

+
+ + +
+
+
+ +

  preferredSize +

+ +
+
+ +
+ + +
+

Provides a suggested size for a layout element. If the optional minSize or maxSize are provided, +and the preferredSize exceeds these, the minSize or maxSize will be enforced. If this optional value is not +provided, the layout element’s size will default to it’s intrinsic content size provided calculateSizeThatFits:

+
+ + + +
@property (nonatomic, assign) CGSize preferredSize
+ + + + + + + + + +
+

Discussion

+

This method is optional, but one of either preferredSize or preferredLayoutSize is required +for nodes that either have no intrinsic content size or +should be laid out at a different size than its intrinsic content size. For example, this property could be +set on an ASImageNode to display at a size different from the underlying image size.

Warning: Calling the getter when the size’s width or height are relative will cause an assert.

+
+ + + + + + + +
+

Declared In

+

ASLayoutElement.h

+
+ + +
+
+
+ +

  minSize +

+ +
+
+ +
+ + +
+

An optional property that provides a minimum size bound for a layout element. If provided, this restriction will +always be enforced. If a parent layout element’s minimum size is smaller than its child’s minimum size, the child’s +minimum size will be enforced and its size will extend out of the layout spec’s.

+
+ + + +
@property (nonatomic, assign) CGSize minSize
+ + + + + + + + + +
+

Discussion

+

For example, if you set a preferred relative width of 50% and a minimum width of 200 points on an +element in a full screen container, this would result in a width of 160 points on an iPhone screen. However, +since 160 pts is lower than the minimum width of 200 pts, the minimum width would be used.

+
+ + + + + + + +
+

Declared In

+

ASLayoutElement.h

+
+ + +
+
+
+ +

  maxSize +

+ +
+
+ +
+ + +
+

An optional property that provides a maximum size bound for a layout element. If provided, this restriction will +always be enforced. If a child layout element’s maximum size is smaller than its parent, the child’s maximum size will +be enforced and its size will extend out of the layout spec’s.

+
+ + + +
@property (nonatomic, assign) CGSize maxSize
+ + + + + + + + + +
+

Discussion

+

For example, if you set a preferred relative width of 50% and a maximum width of 120 points on an +element in a full screen container, this would result in a width of 160 points on an iPhone screen. However, +since 160 pts is higher than the maximum width of 120 pts, the maximum width would be used.

+
+ + + + + + + +
+

Declared In

+

ASLayoutElement.h

+
+ + +
+
+
+ +

  preferredLayoutSize +

+ +
+
+ +
+ + +
+

Provides a suggested RELATIVE size for a layout element. An ASLayoutSize uses percentages rather +than points to specify layout. E.g. width should be 50% of the parent’s width. If the optional minLayoutSize or +maxLayoutSize are provided, and the preferredLayoutSize exceeds these, the minLayoutSize or maxLayoutSize +will be enforced. If this optional value is not provided, the layout element’s size will default to its intrinsic content size +provided calculateSizeThatFits:

+
+ + + +
@property (nonatomic, assign, readwrite) ASLayoutSize preferredLayoutSize
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASLayoutElement.h

+
+ + +
+
+
+ +

  minLayoutSize +

+ +
+
+ +
+ + +
+

An optional property that provides a minimum RELATIVE size bound for a layout element. If provided, this +restriction will always be enforced. If a parent layout element’s minimum relative size is smaller than its child’s minimum +relative size, the child’s minimum relative size will be enforced and its size will extend out of the layout spec’s.

+
+ + + +
@property (nonatomic, assign, readwrite) ASLayoutSize minLayoutSize
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASLayoutElement.h

+
+ + +
+
+
+ +

  maxLayoutSize +

+ +
+
+ +
+ + +
+

An optional property that provides a maximum RELATIVE size bound for a layout element. If provided, this +restriction will always be enforced. If a parent layout element’s maximum relative size is smaller than its child’s maximum +relative size, the child’s maximum relative size will be enforced and its size will extend out of the layout spec’s.

+
+ + + +
@property (nonatomic, assign, readwrite) ASLayoutSize maxLayoutSize
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASLayoutElement.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASLayoutSpec.html b/docs/appledoc/Classes/ASLayoutSpec.html new file mode 100755 index 00000000..0502e88f --- /dev/null +++ b/docs/appledoc/Classes/ASLayoutSpec.html @@ -0,0 +1,363 @@ + + + + + + ASLayoutSpec Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASLayoutSpec Class Reference

+ + +
+ + + + + + + + + + +
Inherits fromNSObject
Conforms toASLayoutElement
Declared inASLayoutSpec.h
+ + + + +
+ +

Overview

+

A layout spec is an immutable object that describes a layout, loosely inspired by React.

+
+ + + + + +
+ + + + + + +
+
+ +

  isMutable +

+ +
+
+ +
+ + +
+

Creation of a layout spec should only happen by a user in layoutSpecThatFits:. During that method, a +layout spec can be created and mutated. Once it is passed back to ASDK, the isMutable flag will be +set to NO and any further mutations will cause an assert.

+
+ + + +
@property (nonatomic, assign) BOOL isMutable
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASLayoutSpec.h

+
+ + +
+
+
+ +

  parent +

+ +
+
+ +
+ + +
+

Parent of the layout spec

+
+ + + +
@property (nullable, nonatomic, weak) id<ASLayoutElement> parent
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASLayoutSpec.h

+
+ + +
+
+
+ +

  child +

+ +
+
+ +
+ + +
+

Adds a child to this layout spec using a default identifier.

+
+ + + +
@property (nullable, strong, nonatomic) id<ASLayoutElement> child
+ + + +
+

Parameters

+ + + + + + + +
child

A child to be added.

+
+ + + + + + + +
+

Discussion

+

Every ASLayoutSpec must act on at least one child. The ASLayoutSpec base class takes the +responsibility of holding on to the spec children. Some layout specs, like ASInsetLayoutSpec, +only require a single child.

+ +

For layout specs that require a known number of children (ASBackgroundLayoutSpec, for example) +a subclass should use this method to set the “primary” child. It can then use setChild:forIdentifier: +to set any other required children. Ideally a subclass would hide this from the user, and use the +setChild:forIdentifier: internally. For example, ASBackgroundLayoutSpec exposes a backgroundChild +property that behind the scenes is calling setChild:forIdentifier:.

+
+ + + + + + + +
+

Declared In

+

ASLayoutSpec.h

+
+ + +
+
+
+ +

  children +

+ +
+
+ +
+ + +
+

Adds childen to this layout spec.

+
+ + + +
@property (nullable, strong, nonatomic) NSArray<id<ASLayoutElement> > *children
+ + + +
+

Parameters

+ + + + + + + +
children

An array of ASLayoutElement children to be added.

+
+ + + + + + + +
+

Discussion

+

Every ASLayoutSpec must act on at least one child. The ASLayoutSpec base class takes the +reponsibility of holding on to the spec children. Some layout specs, like ASStackLayoutSpec, +can take an unknown number of children. In this case, the this method should be used. +For good measure, in these layout specs it probably makes sense to define +setChild: and setChild:forIdentifier: methods to do something appropriate or to assert.

+
+ + + + + + + +
+

Declared In

+

ASLayoutSpec.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASMapNode.html b/docs/appledoc/Classes/ASMapNode.html new file mode 100755 index 00000000..75a586bc --- /dev/null +++ b/docs/appledoc/Classes/ASMapNode.html @@ -0,0 +1,531 @@ + + + + + + ASMapNode Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASMapNode Class Reference

+ + +
+ + + + + + + +
Inherits fromASImageNode : ASControlNode : ASDisplayNode : ASDealloc2MainObject
Declared inASMapNode.h
+ + + + + + +
+ + + + + + +
+
+ +

  options +

+ +
+
+ +
+ + +
+

The current options of ASMapNode. This can be set at any time and ASMapNode will animate the change.

This property may be set from a background thread before the node is loaded, and will automatically be applied to define the behavior of the static snapshot (if .liveMap = NO) or the internal MKMapView (otherwise).

Changes to the region and camera options will only be animated when when the liveMap mode is enabled, otherwise these options will be applied statically to the new snapshot.

The options object is used to specify properties even when the liveMap mode is enabled, allowing seamless transitions between the snapshot and liveMap (as well as back to the snapshot).

+
+ + + +
@property (nonatomic, strong) MKMapSnapshotOptions *options
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASMapNode.h

+
+ + +
+
+
+ +

  region +

+ +
+
+ +
+ + +
+

The region is simply the sub-field on the options object. If the objects object is reset, + this will in effect be overwritten and become the value of the .region property on that object. + Defaults to MKCoordinateRegionForMapRect(MKMapRectWorld).

+
+ + + +
@property (nonatomic, assign) MKCoordinateRegion region
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASMapNode.h

+
+ + +
+
+
+ +

  mapView +

+ +
+
+ +
+ + +
+

This is the MKMapView that is the live map part of ASMapNode. This will be nil if .liveMap = NO. Note, MKMapView is not thread-safe.

+
+ + + +
@property (nullable, nonatomic, readonly) MKMapView *mapView
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASMapNode.h

+
+ + +
+
+
+ +

  liveMap +

+ +
+
+ +
+ + +
+

Set this to YES to turn the snapshot into an interactive MKMapView and vice versa. Defaults to NO. This property may be set on a background thread before the node is loaded, and will automatically be actioned, once the node is loaded.

+
+ + + +
@property (nonatomic, assign, getter=isLiveMap) BOOL liveMap
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASMapNode.h

+
+ + +
+
+
+ +

  needsMapReloadOnBoundsChange +

+ +
+
+ +
+ + +
+

Whether ASMapNode should automatically request a new map snapshot to correspond to the new node size. +@default Default value is YES.

+
+ + + +
@property (nonatomic, assign) BOOL needsMapReloadOnBoundsChange
+ + + + + + + + + +
+

Discussion

+

If mapSize is set then this will be set to NO, since the size will be the same in all orientations.

+
+ + + + + + + +
+

Declared In

+

ASMapNode.h

+
+ + +
+
+
+ +

  mapDelegate +

+ +
+
+ +
+ + +
+

Set the delegate of the MKMapView. This can be set even before mapView is created and will be set on the map in the case that the liveMap mode is engaged.

+
+ + + +
@property (nonatomic, weak) id<MKMapViewDelegate> mapDelegate
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASMapNode.h

+
+ + +
+
+
+ +

  annotations +

+ +
+
+ +
+ + +
+

The annotations to display on the map.

+
+ + + +
@property (nonatomic, copy) NSArray<id<MKAnnotation> > *annotations
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASMapNode.h

+
+ + +
+
+
+ +

  showAnnotationsOptions +

+ +
+
+ +
+ + +
+

This property specifies how to show the annotations. +@default Default value is ASMapNodeShowAnnotationsIgnored

+
+ + + +
@property (nonatomic, assign) ASMapNodeShowAnnotationsOptions showAnnotationsOptions
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASMapNode.h

+
+ + +
+
+
+ +

  imageForStaticMapAnnotationBlock +

+ +
+
+ +
+ + +
+

The block which should return annotation image for static map based on provided annotation.

+
+ + + +
@property (nonatomic, copy, nullable) UIImage *( ^ ) ( id<MKAnnotation> annotation , CGPoint *centerOffset ) imageForStaticMapAnnotationBlock
+ + + + + + + + + +
+

Discussion

+

This block is executed on an arbitrary serial queue. If this block is nil, standard pin is used.

+
+ + + + + + + +
+

Declared In

+

ASMapNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASMultiplexImageNode.html b/docs/appledoc/Classes/ASMultiplexImageNode.html new file mode 100755 index 00000000..bb6387c5 --- /dev/null +++ b/docs/appledoc/Classes/ASMultiplexImageNode.html @@ -0,0 +1,651 @@ + + + + + + ASMultiplexImageNode Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASMultiplexImageNode Class Reference

+ + +
+ + + + + + + +
Inherits fromASImageNode : ASControlNode : ASDisplayNode : ASDealloc2MainObject
Declared inASMultiplexImageNode.h
+ + + + +
+ +

Overview

+

ASMultiplexImageNode begins loading images when its resource can either return a UIImage directly, or a URL the image node should load.

+
+ + + + + +
+ + + + + + +
+
+ +

– initWithCache:downloader: +

+ +
+
+ +
+ + +
+

The designated initializer.

+
+ + + +
- (instancetype)initWithCache:(nullable id<ASImageCacheProtocol>)cache downloader:(nullable id<ASImageDownloaderProtocol>)downloader
+ + + +
+

Parameters

+ + + + + + + + + + + + +
cache

The object that implements a cache of images for the image node.

downloader

The object that implements image downloading for the image node.

+
+ + + +
+

Return Value

+

An initialized ASMultiplexImageNode.

+
+ + + + + +
+

Discussion

+

If cache is nil, the receiver will not attempt to retrieve images from a cache before downloading them.

+
+ + + + + + + +
+

Declared In

+

ASMultiplexImageNode.h

+
+ + +
+
+
+ +

  delegate +

+ +
+
+ +
+ + +
+

The delegate, which must conform to the ASMultiplexImageNodeDelegate protocol.

+
+ + + +
@property (nonatomic, readwrite, weak) id<ASMultiplexImageNodeDelegate> delegate
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASMultiplexImageNode.h

+
+ + +
+
+
+ +

  dataSource +

+ +
+
+ +
+ + +
+

The data source, which must conform to the ASMultiplexImageNodeDataSource protocol.

+
+ + + +
@property (nonatomic, readwrite, weak) id<ASMultiplexImageNodeDataSource> dataSource
+ + + + + + + + + +
+

Discussion

+

This value is required for ASMultiplexImageNode to load images.

+
+ + + + + + + +
+

Declared In

+

ASMultiplexImageNode.h

+
+ + +
+
+
+ +

  downloadsIntermediateImages +

+ +
+
+ +
+ + +
+

Whether the receiver should download more than just its highest-quality image. Defaults to NO.

+
+ + + +
@property (nonatomic, readwrite, assign) BOOL downloadsIntermediateImages
+ + + + + + + + + +
+

Discussion

+

ASMultiplexImageNode immediately loads and displays the first image specified in imageIdentifiers (its +highest-quality image). If that image is not immediately available or cached, the node can download and display +lesser-quality images. Set downloadsIntermediateImages to YES to enable this behaviour.

+
+ + + + + + + +
+

Declared In

+

ASMultiplexImageNode.h

+
+ + +
+
+
+ +

  imageIdentifiers +

+ +
+
+ +
+ + +
+

An array of identifiers representing various versions of an image for ASMultiplexImageNode to display.

+
+ + + +
@property (nonatomic, readwrite, copy) NSArray<ASImageIdentifier> *imageIdentifiers
+ + + + + + + + + +
+

Discussion

+

An identifier can be any object that conforms to NSObject and NSCopying. The array should be in +decreasing order of image quality – that is, the first identifier in the array represents the best version.

+
+ + + + + +
+

See Also

+ +
+ + + +
+

Declared In

+

ASMultiplexImageNode.h

+
+ + +
+
+
+ +

– reloadImageIdentifierSources +

+ +
+
+ +
+ + +
+

Notify the receiver SSAA that its data source has new UIImages or NSURLs available for imageIdentifiers.

+
+ + + +
- (void)reloadImageIdentifierSources
+ + + + + + + + + +
+

Discussion

+

If a higher-quality image than is currently displayed is now available, it will be loaded.

+
+ + + + + + + +
+

Declared In

+

ASMultiplexImageNode.h

+
+ + +
+
+
+ +

  loadedImageIdentifier +

+ +
+
+ +
+ + +
+

The identifier for the last image that the receiver loaded, or nil.

+
+ + + +
@property (nullable, nonatomic, readonly) ASImageIdentifier loadedImageIdentifier
+ + + + + + + + + +
+

Discussion

+

This value may differ from displayedImageIdentifier if the image hasn’t yet been displayed.

+
+ + + + + + + +
+

Declared In

+

ASMultiplexImageNode.h

+
+ + +
+
+
+ +

  displayedImageIdentifier +

+ +
+
+ +
+ + +
+

The identifier for the image that the receiver is currently displaying, or nil.

+
+ + + +
@property (nullable, nonatomic, readonly) ASImageIdentifier displayedImageIdentifier
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASMultiplexImageNode.h

+
+ + +
+
+
+ +

  shouldRenderProgressImages +

+ +
+
+ +
+ + +
+

If the downloader implements progressive image rendering and this value is YES progressive renders of the +image will be displayed as the image downloads. Regardless of this properties value, progress renders will +only occur when the node is visible. Defaults to YES.

+
+ + + +
@property (nonatomic, assign, readwrite) BOOL shouldRenderProgressImages
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASMultiplexImageNode.h

+
+ + +
+
+
+ +

  imageManager +

+ +
+
+ +
+ + +
+
    +
  • @abstract The image manager that this image node should use when requesting images from the Photos framework. If this is nil (the default), then PHImageManager.defaultManager is used.
  • +
+ +
+ + + +
@property (nullable, nonatomic, strong) PHImageManager *imageManager
+ + + + + + + + + +
+

Discussion

+
    +
  • @see +[NSURL URLWithAssetLocalIdentifier:targetSize:contentMode:options:] below.
  • +
+ +
+ + + + + + + +
+

Declared In

+

ASMultiplexImageNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASNavigationController.html b/docs/appledoc/Classes/ASNavigationController.html new file mode 100755 index 00000000..4dd2da49 --- /dev/null +++ b/docs/appledoc/Classes/ASNavigationController.html @@ -0,0 +1,127 @@ + + + + + + ASNavigationController Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASNavigationController Class Reference

+ + +
+ + + + + + + + + + +
Inherits fromUINavigationController
Conforms toASManagesChildVisibilityDepth
Declared inASNavigationController.h
+ + + + +
+ +

Overview

+

ASNavigationController

ASNavigationController is a drop in replacement for UINavigationController +which improves memory efficiency by implementing the @c ASManagesChildVisibilityDepth protocol. +You can use ASNavigationController with regular UIViewControllers, as well as ASViewControllers. +It is safe to subclass or use even where AsyncDisplayKit is not adopted.

+
+ + + + + + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASNetworkImageNode.html b/docs/appledoc/Classes/ASNetworkImageNode.html new file mode 100755 index 00000000..36b5f304 --- /dev/null +++ b/docs/appledoc/Classes/ASNetworkImageNode.html @@ -0,0 +1,633 @@ + + + + + + ASNetworkImageNode Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASNetworkImageNode Class Reference

+ + +
+ + + + + + + +
Inherits fromASImageNode : ASControlNode : ASDisplayNode : ASDealloc2MainObject
Declared inASNetworkImageNode.h
+ + + + +
+ +

Overview

+

ASNetworkImageNode is a simple image node that can download and display an image from the network, with support for a +placeholder image (defaultImage). The currently-displayed image is always available in the inherited ASImageNode + property.

+
+ + + + + +
+ + + + + + +
+
+ +

– initWithCache:downloader: +

+ +
+
+ +
+ + +
+

The designated initializer. Cache and Downloader are WEAK references.

+
+ + + +
- (instancetype)initWithCache:(nullable id<ASImageCacheProtocol>)cache downloader:(id<ASImageDownloaderProtocol>)downloader
+ + + +
+

Parameters

+ + + + + + + + + + + + +
cache

The object that implements a cache of images for the image node. Weak reference.

downloader

The object that implements image downloading for the image node. Must not be nil. Weak reference.

+
+ + + +
+

Return Value

+

An initialized ASNetworkImageNode.

+
+ + + + + +
+

Discussion

+

If cache is nil, the receiver will not attempt to retrieve images from a cache before downloading them.

+
+ + + + + + + +
+

Declared In

+

ASNetworkImageNode.h

+
+ + +
+
+
+ +

– init +

+ +
+
+ +
+ + +
+

Convenience initialiser.

+
+ + + +
- (instancetype)init
+ + + + + +
+

Return Value

+

An ASNetworkImageNode configured to use the NSURLSession-powered ASBasicImageDownloader, and no extra cache.

+
+ + + + + + + + + + + +
+

Declared In

+

ASNetworkImageNode.h

+
+ + +
+
+
+ +

  delegate +

+ +
+
+ +
+ + +
+

The delegate, which must conform to the ASNetworkImageNodeDelegate protocol.

+
+ + + +
@property (nullable, nonatomic, weak, readwrite) id<ASNetworkImageNodeDelegate> delegate
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASNetworkImageNode.h

+
+ + +
+
+
+ +

  defaultImage +

+ +
+
+ +
+ + +
+

A placeholder image to display while the URL is loading.

+
+ + + +
@property (nullable, nonatomic, strong, readwrite) UIImage *defaultImage
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASNetworkImageNode.h

+
+ + +
+
+
+ +

  URL +

+ +
+
+ +
+ + +
+

The URL of a new image to download and display.

+
+ + + +
@property (nullable, nonatomic, strong, readwrite) NSURL *URL
+ + + + + + + + + +
+

Discussion

+

Changing this property will reset the displayed image to a placeholder (defaultImage) while loading.

+
+ + + + + + + +
+

Declared In

+

ASNetworkImageNode.h

+
+ + +
+
+
+ +

– setURL:resetToDefault: +

+ +
+
+ +
+ + +
+

Download and display a new image.

+
+ + + +
- (void)setURL:(nullable NSURL *)URL resetToDefault:(BOOL)reset
+ + + +
+

Parameters

+ + + + + + + + + + + + +
URL

The URL of a new image to download and display.

reset

Whether to display a placeholder (defaultImage) while loading the new image.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASNetworkImageNode.h

+
+ + +
+
+
+ +

  shouldCacheImage +

+ +
+
+ +
+ + +
+

If URL is a local file, set this property to YES to take advantage of UIKit’s image caching. Defaults to YES.

+
+ + + +
@property (nonatomic, assign, readwrite) BOOL shouldCacheImage
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASNetworkImageNode.h

+
+ + +
+
+
+ +

  shouldRenderProgressImages +

+ +
+
+ +
+ + +
+

If the downloader implements progressive image rendering and this value is YES progressive renders of the +image will be displayed as the image downloads. Regardless of this properties value, progress renders will +only occur when the node is visible. Defaults to YES.

+
+ + + +
@property (nonatomic, assign, readwrite) BOOL shouldRenderProgressImages
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASNetworkImageNode.h

+
+ + +
+
+
+ +

  currentImageQuality +

+ +
+
+ +
+ + +
+

The image quality of the current image. This is a number between 0 and 1 and can be used to track +progressive progress. Calculated by dividing number of bytes / expected number of total bytes.

+
+ + + +
@property (nonatomic, assign, readonly) CGFloat currentImageQuality
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASNetworkImageNode.h

+
+ + +
+
+
+ +

  renderedImageQuality +

+ +
+
+ +
+ + +
+

The image quality (value between 0 and 1) of the last image that completed displaying.

+
+ + + +
@property (nonatomic, assign, readonly) CGFloat renderedImageQuality
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASNetworkImageNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASOverlayLayoutSpec.html b/docs/appledoc/Classes/ASOverlayLayoutSpec.html new file mode 100755 index 00000000..8ebefaec --- /dev/null +++ b/docs/appledoc/Classes/ASOverlayLayoutSpec.html @@ -0,0 +1,247 @@ + + + + + + ASOverlayLayoutSpec Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASOverlayLayoutSpec Class Reference

+ + +
+ + + + + + + +
Inherits fromASLayoutSpec : NSObject
Declared inASOverlayLayoutSpec.h
+ + + + +
+ +

Overview

+

This layout spec lays out a single layoutElement child and then overlays a layoutElement object on top of it streched to its size

+
+ + + + + +
+ + + + + + +
+
+ +

  overlay +

+ +
+
+ +
+ + +
+

Overlay layoutElement of this layout spec

+
+ + + +
@property (nullable, nonatomic, strong) id<ASLayoutElement> overlay
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASOverlayLayoutSpec.h

+
+ + +
+
+
+ +

+ overlayLayoutSpecWithChild:overlay: +

+ +
+
+ +
+ + +
+

Creates and returns an ASOverlayLayoutSpec object with a given child and an layoutElement that act as overlay.

+
+ + + +
+ (instancetype)overlayLayoutSpecWithChild:(id<ASLayoutElement>)child overlay:(nullable id<ASLayoutElement>)overlay
+ + + +
+

Parameters

+ + + + + + + + + + + + +
child

A child that is laid out to determine the size of this spec.

overlay

A layoutElement object that is laid out over the child. If this is nil, the overlay is omitted.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASOverlayLayoutSpec.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASPagerNode.html b/docs/appledoc/Classes/ASPagerNode.html new file mode 100755 index 00000000..b6f529ae --- /dev/null +++ b/docs/appledoc/Classes/ASPagerNode.html @@ -0,0 +1,579 @@ + + + + + + ASPagerNode Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASPagerNode Class Reference

+ + +
+ + + + + + + +
Inherits fromASCollectionNode : ASDisplayNode : ASDealloc2MainObject
Declared inASPagerNode.h
+ + + + + + +
+ + + + + + +
+
+ +

– init +

+ +
+
+ +
+ + +
+

Configures a default horizontal, paging flow layout with 0 inter-item spacing.

+
+ + + +
- (instancetype)init
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASPagerNode.h

+
+ + +
+
+
+ +

– initWithCollectionViewLayout: +

+ +
+
+ +
+ + +
+

Initializer with custom-configured flow layout properties.

+
+ + + +
- (instancetype)initWithCollectionViewLayout:(ASPagerFlowLayout *)flowLayout
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASPagerNode.h

+
+ + +
+
+
+ +

– setDataSource: +

+ +
+
+ +
+ + +
+

Data Source is required, and uses a different protocol from ASCollectionNode.

+
+ + + +
- (void)setDataSource:(nullable id<ASPagerDataSource>)dataSource
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASPagerNode.h

+
+ + +
+
+
+ +

– dataSource +

+ +
+
+ +
+ + +
+

The object that acts as the asynchronous data source of the collection view

+
+ + + +
- (nullable id<ASPagerDataSource>)dataSource
+ + + + + + + + + +
+

Discussion

+

The datasource must adopt the ASCollectionDataSource protocol. The collection view maintains a weak reference to the datasource object.

+ +

The datasource object is responsible for providing nodes or node creation blocks to the collection view.

Note: This is a convenience method which sets the asyncDatasource on the collection node’s collection view.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– setDelegate: +

+ +
+
+ +
+ + +
+

Delegate is optional. +This includes UIScrollViewDelegate as well as most methods from UICollectionViewDelegate, like willDisplay…

+
+ + + +
- (void)setDelegate:(nullable id<ASPagerDelegate>)delegate
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASPagerNode.h

+
+ + +
+
+
+ +

– delegate +

+ +
+
+ +
+ + +
+

The object that acts as the asynchronous delegate of the collection view

+
+ + + +
- (nullable id<ASPagerDelegate>)delegate
+ + + + + + + + + +
+

Discussion

+

The delegate must adopt the ASCollectionDelegate protocol. The collection view maintains a weak reference to the delegate object.

+ +

The delegate object is responsible for providing size constraints for nodes and indicating whether batch fetching should begin.

Note: This is a convenience method which sets the asyncDelegate on the collection node’s collection view.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

  view +

+ +
+
+ +
+ + +
+

The underlying ASCollectionView object.

+
+ + + +
@property (nonatomic, readonly) ASCollectionView *view
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASPagerNode.h

+
+ + +
+
+
+ +

  currentPageIndex +

+ +
+
+ +
+ + +
+

Returns the current page index

+
+ + + +
@property (nonatomic, assign, readonly) NSInteger currentPageIndex
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASPagerNode.h

+
+ + +
+
+
+ +

– scrollToPageAtIndex:animated: +

+ +
+
+ +
+ + +
+

Scroll the contents of the receiver to ensure that the page is visible

+
+ + + +
- (void)scrollToPageAtIndex:(NSInteger)index animated:(BOOL)animated
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASPagerNode.h

+
+ + +
+
+
+ +

– nodeForPageAtIndex: +

+ +
+
+ +
+ + +
+

Returns the node for the passed page index

+
+ + + +
- (ASCellNode *)nodeForPageAtIndex:(NSInteger)index
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASPagerNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASRangeController.html b/docs/appledoc/Classes/ASRangeController.html new file mode 100755 index 00000000..ad02f940 --- /dev/null +++ b/docs/appledoc/Classes/ASRangeController.html @@ -0,0 +1,437 @@ + + + + + + ASRangeController Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASRangeController Class Reference

+ + +
+ + + + + + + + + + +
Inherits fromASDealloc2MainObject
Conforms toASDataControllerDelegate
Declared inASRangeController.h
+ + + + +
+ +

Overview

+

Working range controller.

+ +

Used internally by ASTableView and ASCollectionView. It is paired with ASDataController. +It is designed to support custom scrolling containers as well. Observes the visible range, maintains +“working ranges” to trigger network calls and rendering, and is responsible for driving asynchronous layout of cells. +This includes cancelling those asynchronous operations as cells fall outside of the working ranges.

+
+ + + + + +
+ + + + + + +
+
+ +

– setNeedsUpdate +

+ +
+
+ +
+ + +
+

Notify the range controller that the visible range has been updated. +This is the primary input call that drives updating the working ranges, and triggering their actions. +The ranges will be updated in the next turn of the main loop, or when -updateIfNeeded is called.

+
+ + + +
- (void)setNeedsUpdate
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASRangeController.h

+
+ + +
+
+
+ +

– updateIfNeeded +

+ +
+
+ +
+ + +
+

Update the ranges immediately, if -setNeedsUpdate has been called since the last update. +This is useful because the ranges must be updated immediately after a cell is added +into a table/collection to satisfy interface state API guarantees.

+
+ + + +
- (void)updateIfNeeded
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASRangeController.h

+
+ + +
+
+
+ +

– configureContentView:forCellNode: +

+ +
+
+ +
+ + +
+

Add the sized node for indexPath as a subview of contentView.

+
+ + + +
- (void)configureContentView:(UIView *)contentView forCellNode:(ASCellNode *)node
+ + + +
+

Parameters

+ + + + + + + + + + + + +
contentView

UIView to add a (sized) node’s view to.

node

The cell node to be added.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASRangeController.h

+
+ + +
+
+
+ +

  layoutController +

+ +
+
+ +
+ + +
+

An object that describes the layout behavior of the ranged component (table view, collection view, etc.)

+
+ + + +
@property (nonatomic, strong) id<ASLayoutController> layoutController
+ + + + + + + + + +
+

Discussion

+

Used primarily for providing the current range of index paths and identifying when the +range controller should invalidate its range.

+
+ + + + + + + +
+

Declared In

+

ASRangeController.h

+
+ + +
+
+
+ +

  dataSource +

+ +
+
+ +
+ + +
+

The underlying data source for the range controller

+
+ + + +
@property (nonatomic, weak) id<ASRangeControllerDataSource> dataSource
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASRangeController.h

+
+ + +
+
+
+ +

  delegate +

+ +
+
+ +
+ + +
+

Delegate for handling range controller events. Must not be nil.

+
+ + + +
@property (nonatomic, weak) id<ASRangeControllerDelegate> delegate
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASRangeController.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASRatioLayoutSpec.html b/docs/appledoc/Classes/ASRatioLayoutSpec.html new file mode 100755 index 00000000..cc159b58 --- /dev/null +++ b/docs/appledoc/Classes/ASRatioLayoutSpec.html @@ -0,0 +1,139 @@ + + + + + + ASRatioLayoutSpec Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASRatioLayoutSpec Class Reference

+ + +
+ + + + + + + +
Inherits fromASLayoutSpec : NSObject
Declared inASRatioLayoutSpec.h
+ + + + +
+ +

Overview

+

Ratio layout spec +For when the content should respect a certain inherent ratio but can be scaled (think photos or videos) +The ratio passed is the ratio of height / width you expect

+ +

For a ratio 0.5, the spec will have a flat rectangle shape

+ +
+ +

| | +| _ _ |

+ +

For a ratio 2.0, the spec will be twice as tall as it is wide + _ _ +| | +| | +| | +| |

+ +

*

+
+ + + + + + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASRelativeLayoutSpec.html b/docs/appledoc/Classes/ASRelativeLayoutSpec.html new file mode 100755 index 00000000..ebcd5585 --- /dev/null +++ b/docs/appledoc/Classes/ASRelativeLayoutSpec.html @@ -0,0 +1,305 @@ + + + + + + ASRelativeLayoutSpec Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASRelativeLayoutSpec Class Reference

+ + +
+ + + + + + + +
Inherits fromASLayoutSpec : NSObject
Declared inASRelativeLayoutSpec.h
+ + + + +
+ +

Overview

+

Lays out a single layoutElement child and positions it within the layout bounds according to vertical and horizontal positional specifiers. +Can position the child at any of the 4 corners, or the middle of any of the 4 edges, as well as the center - similar to “9-part” image areas.

+
+ + + + + +
+ + + + + + +
+
+ +

+ relativePositionLayoutSpecWithHorizontalPosition:verticalPosition:sizingOption:child: +

+ +
+
+ +
+ + +
+

convenience constructor for a ASRelativeLayoutSpec

+
+ + + +
+ (instancetype)relativePositionLayoutSpecWithHorizontalPosition:(ASRelativeLayoutSpecPosition)horizontalPosition verticalPosition:(ASRelativeLayoutSpecPosition)verticalPosition sizingOption:(ASRelativeLayoutSpecSizingOption)sizingOption child:(id<ASLayoutElement>)child
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
horizontalPosition

how to position the item on the horizontal (x) axis

verticalPosition

how to position the item on the vertical (y) axis

sizingOption

how much size to take up

child

the child to layout

+
+ + + +
+

Return Value

+

a configured ASRelativeLayoutSpec

+
+ + + + + +
+

Discussion

+

convenience constructor for a ASRelativeLayoutSpec

+
+ + + + + + + +
+

Declared In

+

ASRelativeLayoutSpec.h

+
+ + +
+
+
+ +

– initWithHorizontalPosition:verticalPosition:sizingOption:child: +

+ +
+
+ +
+ + +
+

convenience initializer for a ASRelativeLayoutSpec

+
+ + + +
- (instancetype)initWithHorizontalPosition:(ASRelativeLayoutSpecPosition)horizontalPosition verticalPosition:(ASRelativeLayoutSpecPosition)verticalPosition sizingOption:(ASRelativeLayoutSpecSizingOption)sizingOption child:(id<ASLayoutElement>)child
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
horizontalPosition

how to position the item on the horizontal (x) axis

verticalPosition

how to position the item on the vertical (y) axis

sizingOption

how much size to take up

child

the child to layout

+
+ + + +
+

Return Value

+

a configured ASRelativeLayoutSpec

+
+ + + + + +
+

Discussion

+

convenience initializer for a ASRelativeLayoutSpec

+
+ + + + + + + +
+

Declared In

+

ASRelativeLayoutSpec.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASScrollNode.html b/docs/appledoc/Classes/ASScrollNode.html new file mode 100755 index 00000000..83843991 --- /dev/null +++ b/docs/appledoc/Classes/ASScrollNode.html @@ -0,0 +1,183 @@ + + + + + + ASScrollNode Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASScrollNode Class Reference

+ + +
+ + + + + + + +
Inherits fromASDisplayNode : ASDealloc2MainObject
Declared inASScrollNode.h
+ + + + +
+ +

Overview

+

Simple node that wraps UIScrollView.

+
+ + + + + +
+ + + + + + +
+
+ +

  view +

+ +
+
+ +
+ + +
+

The node’s UIScrollView.

+
+ + + +
@property (nonatomic, readonly, strong) UIScrollView *view
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASScrollNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASStackLayoutSpec.html b/docs/appledoc/Classes/ASStackLayoutSpec.html new file mode 100755 index 00000000..80de7f10 --- /dev/null +++ b/docs/appledoc/Classes/ASStackLayoutSpec.html @@ -0,0 +1,649 @@ + + + + + + ASStackLayoutSpec Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASStackLayoutSpec Class Reference

+ + +
+ + + + + + + +
Inherits fromASLayoutSpec : NSObject
Declared inASStackLayoutSpec.h
+ + + + +
+ +

Overview

+

A simple layout spec that stacks a list of children vertically or horizontally.

+ +
    +
  • All children are initially laid out with the an infinite available size in the stacking direction.
  • +
  • In the other direction, this spec’s constraint is passed.
  • +
  • The children’s sizes are summed in the stacking direction. + +
      +
    • If this sum is less than this spec’s minimum size in stacking direction, children with flexGrow are flexed.
    • +
    • If it is greater than this spec’s maximum size in the stacking direction, children with flexShrink are flexed.
    • +
    • If, even after flexing, the sum is still greater than this spec’s maximum size in the stacking direction, +justifyContent determines how children are laid out.
    • +
    +
  • +
+ + +

For example:

+ +
    +
  • Suppose stacking direction is Vertical, min-width=100, max-width=300, min-height=200, max-height=500.
  • +
  • All children are laid out with min-width=100, max-width=300, min-height=0, max-height=INFINITY.
  • +
  • If the sum of the childrens' heights is less than 200, children with flexGrow are flexed larger.
  • +
  • If the sum of the childrens' heights is greater than 500, children with flexShrink are flexed smaller. + Each child is shrunk by ((sum of heights) - 500)/(number of flexShrink-able children).
  • +
  • If the sum of the childrens' heights is greater than 500 even after flexShrink-able children are flexed, + justifyContent determines how children are laid out.
  • +
+ +
+ + + + + +
+ + + + + + +
+
+ +

  direction +

+ +
+
+ +
+ + +
+

Specifies the direction children are stacked in. If horizontalAlignment and verticalAlignment were set, +they will be resolved again, causing justifyContent and alignItems to be updated accordingly

+
+ + + +
@property (nonatomic, assign) ASStackLayoutDirection direction
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASStackLayoutSpec.h

+
+ + +
+
+
+ +

  spacing +

+ +
+
+ +
+ + +
+

The amount of space between each child.

+
+ + + +
@property (nonatomic, assign) CGFloat spacing
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASStackLayoutSpec.h

+
+ + +
+
+
+ +

  horizontalAlignment +

+ +
+
+ +
+ + +
+

Specifies how children are aligned horizontally. Depends on the stack direction, setting the alignment causes either +justifyContent or alignItems to be updated. The alignment will remain valid after future direction changes. +Thus, it is preferred to those properties

+
+ + + +
@property (nonatomic, assign) ASHorizontalAlignment horizontalAlignment
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASStackLayoutSpec.h

+
+ + +
+
+
+ +

  verticalAlignment +

+ +
+
+ +
+ + +
+

Specifies how children are aligned vertically. Depends on the stack direction, setting the alignment causes either +justifyContent or alignItems to be updated. The alignment will remain valid after future direction changes. +Thus, it is preferred to those properties

+
+ + + +
@property (nonatomic, assign) ASVerticalAlignment verticalAlignment
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASStackLayoutSpec.h

+
+ + +
+
+
+ +

  justifyContent +

+ +
+
+ +
+ + +
+

The amount of space between each child.

+
+ + + +
@property (nonatomic, assign) ASStackLayoutJustifyContent justifyContent
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASStackLayoutSpec.h

+
+ + +
+
+
+ +

  alignItems +

+ +
+
+ +
+ + +
+

Orientation of children along cross axis

+
+ + + +
@property (nonatomic, assign) ASStackLayoutAlignItems alignItems
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASStackLayoutSpec.h

+
+ + +
+
+
+ +

  baselineRelativeArrangement +

+ +
+
+ +
+ + +
+

If YES the vertical spacing between two views is measured from the last baseline of the top view to the top of the bottom view

+
+ + + +
@property (nonatomic, assign) BOOL baselineRelativeArrangement
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASStackLayoutSpec.h

+
+ + +
+
+
+ +

+ stackLayoutSpecWithDirection:spacing:justifyContent:alignItems:children: +

+ +
+
+ +
+ + +
+

The direction of the stack view (horizontal or vertical)

+
+ + + +
+ (instancetype)stackLayoutSpecWithDirection:(ASStackLayoutDirection)direction spacing:(CGFloat)spacing justifyContent:(ASStackLayoutJustifyContent)justifyContent alignItems:(ASStackLayoutAlignItems)alignItems children:(NSArray<id<ASLayoutElement> > *)children
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
direction

The direction of the stack view (horizontal or vertical)

spacing

The spacing between the children

justifyContent

If no children are flexible, this describes how to fill any extra space

alignItems

Orientation of the children along the cross axis

children

ASLayoutElement children to be positioned.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASStackLayoutSpec.h

+
+ + +
+
+
+ +

+ verticalStackLayoutSpec +

+ +
+
+ +
+ + +
+

A stack layout spec with direction of ASStackLayoutDirectionVertical

+
+ + + +
+ (instancetype)verticalStackLayoutSpec
+ + + + + +
+

Return Value

+

A stack layout spec with direction of ASStackLayoutDirectionVertical

+
+ + + + + + + + + + + +
+

Declared In

+

ASStackLayoutSpec.h

+
+ + +
+
+
+ +

+ horizontalStackLayoutSpec +

+ +
+
+ +
+ + +
+

A stack layout spec with direction of ASStackLayoutDirectionHorizontal

+
+ + + +
+ (instancetype)horizontalStackLayoutSpec
+ + + + + +
+

Return Value

+

A stack layout spec with direction of ASStackLayoutDirectionHorizontal

+
+ + + + + + + + + + + +
+

Declared In

+

ASStackLayoutSpec.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASTabBarController.html b/docs/appledoc/Classes/ASTabBarController.html new file mode 100755 index 00000000..851476ab --- /dev/null +++ b/docs/appledoc/Classes/ASTabBarController.html @@ -0,0 +1,125 @@ + + + + + + ASTabBarController Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASTabBarController Class Reference

+ + +
+ + + + + + + + + + +
Inherits fromUITabBarController
Conforms toASManagesChildVisibilityDepth
Declared inASTabBarController.h
+ + + + +
+ +

Overview

+

ASTabBarController

ASTabBarController is a drop in replacement for UITabBarController +which implements the memory efficiency improving @c ASManagesChildVisibilityDepth protocol.

+
+ + + + + + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASTableNode.html b/docs/appledoc/Classes/ASTableNode.html new file mode 100755 index 00000000..aa37fc25 --- /dev/null +++ b/docs/appledoc/Classes/ASTableNode.html @@ -0,0 +1,2128 @@ + + + + + + ASTableNode Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASTableNode Class Reference

+ + +
+ + + + + + + + + + +
Inherits fromASDisplayNode : ASDealloc2MainObject
Conforms toASRangeControllerUpdateRangeProtocol
Declared inASTableNode.h
+ + + + +
+ +

Overview

+

ASTableNode is a node based class that wraps an ASTableView. It can be used +as a subnode of another node, and provide room for many (great) features and improvements later on.

+
+ + + + + +
+ + + + + + +
+
+ +

– init +

+ +
+
+ +
+ + +
+

Designated initializer.

+
+ + + +
- (instancetype)init
+ + + + + +
+

Return Value

+

An ASDisplayNode instance whose view will be a subclass that enables asynchronous rendering, and passes +through -layout and touch handling methods.

+
+ + + + + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

  view +

+ +
+
+ +
+ + +
+

Returns a view.

+
+ + + +
@property (strong, nonatomic, readonly) ASTableView *view
+ + + + + + + + + +
+

Discussion

+

The view property is lazily initialized, similar to UIViewController. +To go the other direction, use ASViewToDisplayNode() in ASDisplayNodeExtras.h.

Warning: The first access to it must be on the main thread, and should only be used on the main thread thereafter as +well.

+
+ + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + +
+
+
+ +

– tuningParametersForRangeType: +

+ +
+
+ +
+ + +
+

Tuning parameters for a range type in full mode.

+
+ + + +
- (ASRangeTuningParameters)tuningParametersForRangeType:(ASLayoutRangeType)rangeType
+ + + +
+

Parameters

+ + + + + + + +
rangeType

The range type to get the tuning parameters for.

+
+ + + +
+

Return Value

+

A tuning parameter value for the given range type in full mode.

+
+ + + + + + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– setTuningParameters:forRangeType: +

+ +
+
+ +
+ + +
+

Set the tuning parameters for a range type in full mode.

+
+ + + +
- (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeType:(ASLayoutRangeType)rangeType
+ + + +
+

Parameters

+ + + + + + + + + + + + +
tuningParameters

The tuning parameters to store for a range type.

rangeType

The range type to set the tuning parameters for.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– tuningParametersForRangeMode:rangeType: +

+ +
+
+ +
+ + +
+

Tuning parameters for a range type in the specified mode.

+
+ + + +
- (ASRangeTuningParameters)tuningParametersForRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType
+ + + +
+

Parameters

+ + + + + + + + + + + + +
rangeMode

The range mode to get the running parameters for.

rangeType

The range type to get the tuning parameters for.

+
+ + + +
+

Return Value

+

A tuning parameter value for the given range type in the given mode.

+
+ + + + + + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– setTuningParameters:forRangeMode:rangeType: +

+ +
+
+ +
+ + +
+

Set the tuning parameters for a range type in the specified mode.

+
+ + + +
- (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
tuningParameters

The tuning parameters to store for a range type.

rangeMode

The range mode to set the running parameters for.

rangeType

The range type to set the tuning parameters for.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– scrollToRowAtIndexPath:atScrollPosition:animated: +

+ +
+
+ +
+ + +
+

Scrolls the table to the given row.

+
+ + + +
- (void)scrollToRowAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UITableViewScrollPosition)scrollPosition animated:(BOOL)animated
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
indexPath

The index path of the row.

scrollPosition

Where the row should end up after the scroll.

animated

Whether the scroll should be animated or not.

+ +

This method must be called on the main thread.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– reloadDataWithCompletion: +

+ +
+
+ +
+ + +
+

Reload everything from scratch, destroying the working range and all cached nodes.

+
+ + + +
- (void)reloadDataWithCompletion:(nullable void ( ^ ) ( ))completion
+ + + +
+

Parameters

+ + + + + + + +
completion

block to run on completion of asynchronous loading or nil. If supplied, the block is run on +the main thread.

+
+ + + + + + + +
+

Discussion

+

Warning: This method is substantially more expensive than UITableView’s version.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– reloadData +

+ +
+
+ +
+ + +
+

Reload everything from scratch, destroying the working range and all cached nodes.

+
+ + + +
- (void)reloadData
+ + + + + + + + + +
+

Discussion

+

Warning: This method is substantially more expensive than UITableView’s version.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– relayoutItems +

+ +
+
+ +
+ + +
+

Triggers a relayout of all nodes.

+
+ + + +
- (void)relayoutItems
+ + + + + + + + + +
+

Discussion

+

This method invalidates and lays out every cell node in the table view.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– performBatchAnimated:updates:completion: +

+ +
+
+ +
+ + +
+

Perform a batch of updates asynchronously, optionally disabling all animations in the batch. This method must be called from the main thread. +The data source must be updated to reflect the changes before the update block completes.

+
+ + + +
- (void)performBatchAnimated:(BOOL)animated updates:(nullable __attribute ( ( noescape ) ) void ( ^ ) ( ))updates completion:(nullable void ( ^ ) ( BOOL finished ))completion
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
animated

NO to disable animations for this batch

updates

The block that performs the relevant insert, delete, reload, or move operations.

completion

A completion handler block to execute when all of the operations are finished. This block takes a single +Boolean parameter that contains the value YES if all of the related animations completed successfully or +NO if they were interrupted. This parameter may be nil. If supplied, the block is run on the main thread.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– performBatchUpdates:completion: +

+ +
+
+ +
+ + +
+

Perform a batch of updates asynchronously, optionally disabling all animations in the batch. This method must be called from the main thread. +The data source must be updated to reflect the changes before the update block completes.

+
+ + + +
- (void)performBatchUpdates:(nullable __attribute ( ( noescape ) ) void ( ^ ) ( ))updates completion:(nullable void ( ^ ) ( BOOL finished ))completion
+ + + +
+

Parameters

+ + + + + + + + + + + + +
updates

The block that performs the relevant insert, delete, reload, or move operations.

completion

A completion handler block to execute when all of the operations are finished. This block takes a single +Boolean parameter that contains the value YES if all of the related animations completed successfully or +NO if they were interrupted. This parameter may be nil. If supplied, the block is run on the main thread.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– waitUntilAllUpdatesAreCommitted +

+ +
+
+ +
+ + +
+

Blocks execution of the main thread until all section and row updates are committed. This method must be called from the main thread.

+
+ + + +
- (void)waitUntilAllUpdatesAreCommitted
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– insertSections:withRowAnimation: +

+ +
+
+ +
+ + +
+

Inserts one or more sections, with an option to animate the insertion.

+
+ + + +
- (void)insertSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation
+ + + +
+

Parameters

+ + + + + + + + + + + + +
sections

An index set that specifies the sections to insert.

animation

A constant that indicates how the insertion is to be animated. See UITableViewRowAnimation.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes +before this method is called.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– deleteSections:withRowAnimation: +

+ +
+
+ +
+ + +
+

Deletes one or more sections, with an option to animate the deletion.

+
+ + + +
- (void)deleteSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation
+ + + +
+

Parameters

+ + + + + + + + + + + + +
sections

An index set that specifies the sections to delete.

animation

A constant that indicates how the deletion is to be animated. See UITableViewRowAnimation.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes +before this method is called.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– reloadSections:withRowAnimation: +

+ +
+
+ +
+ + +
+

Reloads the specified sections using a given animation effect.

+
+ + + +
- (void)reloadSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation
+ + + +
+

Parameters

+ + + + + + + + + + + + +
sections

An index set that specifies the sections to reload.

animation

A constant that indicates how the reloading is to be animated. See UITableViewRowAnimation.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes +before this method is called.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– moveSection:toSection: +

+ +
+
+ +
+ + +
+

Moves a section to a new location.

+
+ + + +
- (void)moveSection:(NSInteger)section toSection:(NSInteger)newSection
+ + + +
+

Parameters

+ + + + + + + + + + + + +
section

The index of the section to move.

newSection

The index that is the destination of the move for the section.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes +before this method is called.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– insertRowsAtIndexPaths:withRowAnimation: +

+ +
+
+ +
+ + +
+

Inserts rows at the locations identified by an array of index paths, with an option to animate the insertion.

+
+ + + +
- (void)insertRowsAtIndexPaths:(NSArray<NSIndexPath*> *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation
+ + + +
+

Parameters

+ + + + + + + + + + + + +
indexPaths

An array of NSIndexPath objects, each representing a row index and section index that together identify a row.

animation

A constant that indicates how the insertion is to be animated. See UITableViewRowAnimation.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes +before this method is called.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– deleteRowsAtIndexPaths:withRowAnimation: +

+ +
+
+ +
+ + +
+

Deletes the rows specified by an array of index paths, with an option to animate the deletion.

+
+ + + +
- (void)deleteRowsAtIndexPaths:(NSArray<NSIndexPath*> *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation
+ + + +
+

Parameters

+ + + + + + + + + + + + +
indexPaths

An array of NSIndexPath objects identifying the rows to delete.

animation

A constant that indicates how the deletion is to be animated. See UITableViewRowAnimation.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes +before this method is called.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– reloadRowsAtIndexPaths:withRowAnimation: +

+ +
+
+ +
+ + +
+

Reloads the specified rows using a given animation effect.

+
+ + + +
- (void)reloadRowsAtIndexPaths:(NSArray<NSIndexPath*> *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation
+ + + +
+

Parameters

+ + + + + + + + + + + + +
indexPaths

An array of NSIndexPath objects identifying the rows to reload.

animation

A constant that indicates how the reloading is to be animated. See UITableViewRowAnimation.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes +before this method is called.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– moveRowAtIndexPath:toIndexPath: +

+ +
+
+ +
+ + +
+

Moves the row at a specified location to a destination location.

+
+ + + +
- (void)moveRowAtIndexPath:(NSIndexPath *)indexPath toIndexPath:(NSIndexPath *)newIndexPath
+ + + +
+

Parameters

+ + + + + + + + + + + + +
indexPath

The index path identifying the row to move.

newIndexPath

The index path that is the destination of the move for the row.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes +before this method is called.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– selectRowAtIndexPath:animated:scrollPosition: +

+ +
+
+ +
+ + +
+

Selects a row in the table view identified by index path, optionally scrolling the row to a location in the table view. +This method does not cause any selection-related delegate methods to be called.

+
+ + + +
- (void)selectRowAtIndexPath:(nullable NSIndexPath *)indexPath animated:(BOOL)animated scrollPosition:(UITableViewScrollPosition)scrollPosition
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
indexPath

An index path identifying a row in the table view.

animated

Specify YES to animate the change in the selection or NO to make the change without animating it.

scrollPosition

A constant that identifies a relative position in the table view (top, middle, bottom) for the row when scrolling concludes. See UITableViewScrollPosition for descriptions of valid constants.

+
+ + + + + + + +
+

Discussion

+

This method must be called from the main thread.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– numberOfRowsInSection: +

+ +
+
+ +
+ + +
+

Retrieves the number of rows in the given section.

+
+ + + +
- (NSInteger)numberOfRowsInSection:(NSInteger)section
+ + + +
+

Parameters

+ + + + + + + +
section

The section.

+
+ + + +
+

Return Value

+

The number of rows.

+
+ + + + + + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

  numberOfSections +

+ +
+
+ +
+ + +
+

The number of sections in the table node.

+
+ + + +
@property (nonatomic, readonly) NSInteger numberOfSections
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

  visibleNodes +

+ +
+
+ +
+ + +
+

Similar to -visibleCells.

+
+ + + +
@property (nonatomic, readonly) NSArray<__kindofASCellNode*> *visibleNodes
+ + + + + +
+

Return Value

+

an array containing the nodes being displayed on screen. This must be called on the main thread.

+
+ + + + + + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– nodeForRowAtIndexPath: +

+ +
+
+ +
+ + +
+

Retrieves the node for the row at the given index path.

+
+ + + +
- (nullable __kindof ASCellNode *)nodeForRowAtIndexPath:(NSIndexPath *)indexPath
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– indexPathForNode: +

+ +
+
+ +
+ + +
+

Similar to -indexPathForCell:.

+
+ + + +
- (nullable NSIndexPath *)indexPathForNode:(ASCellNode *)cellNode
+ + + +
+

Parameters

+ + + + + + + +
cellNode

a node for a row.

+
+ + + +
+

Return Value

+

The index path to this row, if it exists.

+
+ + + + + +
+

Discussion

+

This method will return @c nil for a node that is still being +displayed in the table view, if the data source has deleted the row. +That is, the node is visible but it no longer corresponds +to any item in the data source and will be removed soon.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– rectForRowAtIndexPath: +

+ +
+
+ +
+ + +
+

Similar to -[UITableView rectForRowAtIndexPath:]

+
+ + + +
- (CGRect)rectForRowAtIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + +
indexPath

An index path identifying a row in the table view.

+
+ + + +
+

Return Value

+

A rectangle defining the area in which the table view draws the row or CGRectZero if indexPath is invalid.

+
+ + + + + +
+

Discussion

+

This method must be called from the main thread.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– cellForRowAtIndexPath: +

+ +
+
+ +
+ + +
+

Similar to -[UITableView cellForRowAtIndexPath:]

+
+ + + +
- (nullable __kindof UITableViewCell *)cellForRowAtIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + +
indexPath

An index path identifying a row in the table view.

+
+ + + +
+

Return Value

+

An object representing a cell of the table, or nil if the cell is not visible or indexPath is out of range.

+
+ + + + + +
+

Discussion

+

This method must be called from the main thread.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

  indexPathForSelectedRow +

+ +
+
+ +
+ + +
+

Similar to UITableView.indexPathForSelectedRow

+
+ + + +
@property (nonatomic, readonly, nullable) NSIndexPath *indexPathForSelectedRow
+ + + + + +
+

Return Value

+

The value of this property is an index path identifying the row and section +indexes of the selected row, or nil if the index path is invalid. If there are multiple selections, +this property contains the first index-path object in the array of row selections; +this object has the lowest index values for section and row.

+
+ + + + + +
+

Discussion

+

This method must be called from the main thread.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– indexPathForRowAtPoint: +

+ +
+
+ +
+ + +
+

Similar to -[UITableView indexPathForRowAtPoint:]

+
+ + + +
- (nullable NSIndexPath *)indexPathForRowAtPoint:(CGPoint)point
+ + + +
+

Parameters

+ + + + + + + +
point

A point in the local coordinate system of the table view (the table view’€™s bounds).

+
+ + + +
+

Return Value

+

An index path representing the row and section associated with point, +or nil if the point is out of the bounds of any row.

+
+ + + + + +
+

Discussion

+

This method must be called from the main thread.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– indexPathsForRowsInRect: +

+ +
+
+ +
+ + +
+

Similar to -[UITableView indexPathsForRowsInRect:]

+
+ + + +
- (nullable NSArray<NSIndexPath*> *)indexPathsForRowsInRect:(CGRect)rect
+ + + +
+

Parameters

+ + + + + + + +
rect

A rectangle defining an area of the table view in local coordinates.

+
+ + + +
+

Return Value

+

An array of NSIndexPath objects each representing a row and section index identifying a row within rect. +Returns an empty array if there aren’t any rows to return.

+
+ + + + + +
+

Discussion

+

This method must be called from the main thread.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– indexPathsForVisibleRows +

+ +
+
+ +
+ + +
+

Similar to -[UITableView indexPathsForVisibleRows]

+
+ + + +
- (NSArray<NSIndexPath*> *)indexPathsForVisibleRows
+ + + + + +
+

Return Value

+

The value of this property is an array of NSIndexPath objects each representing a row index and section index +that together identify a visible row in the table view. If no rows are visible, the value is nil.

+
+ + + + + +
+

Discussion

+

This method must be called from the main thread.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASTableView.html b/docs/appledoc/Classes/ASTableView.html new file mode 100755 index 00000000..d1482c15 --- /dev/null +++ b/docs/appledoc/Classes/ASTableView.html @@ -0,0 +1,333 @@ + + + + + + ASTableView Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASTableView Class Reference

+ + +
+ + + + + + + +
Inherits fromUITableView
Declared inASTableView.h
+ + + + +
+ +

Overview

+

Asynchronous UITableView with Intelligent Preloading capabilities.

ASTableView is a true subclass of UITableView, meaning it is pointer-compatible with code that +currently uses UITableView

+ +

The main difference is that asyncDataSource expects -nodeForRowAtIndexPath, an ASCellNode, and +the heightForRowAtIndexPath: method is eliminated (as are the performance problems caused by it). +This is made possible because ASCellNodes can calculate their own size, and preload ahead of time.

Note: ASTableNode is strongly recommended over ASTableView. This class is provided for adoption convenience.

+
+ + + + + +
+ + + + + + +
+
+ +

  tableNode +

+ +
+
+ +
+ + +
+

The corresponding table node, or nil if one does not exist.

+
+ + + +
@property (nonatomic, weak, readonly) ASTableNode *tableNode
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASTableView.h

+
+ + +
+
+
+ +

– nodeForRowAtIndexPath: +

+ +
+
+ +
+ + +
+

Retrieves the node for the row at the given index path.

+
+ + + +
- (nullable ASCellNode *)nodeForRowAtIndexPath:(NSIndexPath *)indexPath
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASTableView.h

+
+ + +
+
+
+ +

  automaticallyAdjustsContentOffset +

+ +
+
+ +
+ + +
+

YES to automatically adjust the contentOffset when cells are inserted or deleted “before” +visible cells, maintaining the users' visible scroll position. Currently this feature tracks insertions, moves and deletions of +cells, but section edits are ignored.

+
+ + + +
@property (nonatomic) BOOL automaticallyAdjustsContentOffset
+ + + + + + + + + +
+

Discussion

+

default is NO.

+
+ + + + + + + +
+

Declared In

+

ASTableView.h

+
+ + +
+
+
+ +

  leadingScreensForBatching +

+ +
+
+ +
+ + +
+

The number of screens left to scroll before the delegate -tableView:beginBatchFetchingWithContext: is called.

+
+ + + +
@property (nonatomic, assign) CGFloat leadingScreensForBatching
+ + + + + + + + + +
+

Discussion

+

Defaults to two screenfuls.

+
+ + + + + + + +
+

Declared In

+

ASTableView.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASTextCellNode.html b/docs/appledoc/Classes/ASTextCellNode.html new file mode 100755 index 00000000..da3f0aa3 --- /dev/null +++ b/docs/appledoc/Classes/ASTextCellNode.html @@ -0,0 +1,316 @@ + + + + + + ASTextCellNode Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASTextCellNode Class Reference

+ + +
+ + + + + + + +
Inherits fromASCellNode : ASDisplayNode : ASDealloc2MainObject
Declared inASCellNode.h
+ + + + +
+ +

Overview

+

Simple label-style cell node. Read its source for an example of custom ASCellNodes.

+
+ + + + + +
+ + + + + + +
+
+ +

– initWithAttributes:insets: +

+ +
+
+ +
+ + +
+

Initializes a text cell with given text attributes and text insets

+
+ + + +
- (instancetype)initWithAttributes:(NSDictionary *)textAttributes insets:(UIEdgeInsets)textInsets
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASCellNode.h

+
+ + +
+
+
+ +

  text +

+ +
+
+ +
+ + +
+

Text to display.

+
+ + + +
@property (nonatomic, copy) NSString *text
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASCellNode.h

+
+ + +
+
+
+ +

  textAttributes +

+ +
+
+ +
+ + +
+

A dictionary containing key-value pairs for text attributes. You can specify the font, text color, text shadow color, and text shadow offset using the keys listed in NSString UIKit Additions Reference.

+
+ + + +
@property (nonatomic, copy) NSDictionary *textAttributes
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASCellNode.h

+
+ + +
+
+
+ +

  textInsets +

+ +
+
+ +
+ + +
+

The text inset or outset for each edge. The default value is 15.0 horizontal and 11.0 vertical padding.

+
+ + + +
@property (nonatomic, assign) UIEdgeInsets textInsets
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASCellNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASTextNode.html b/docs/appledoc/Classes/ASTextNode.html new file mode 100755 index 00000000..fab6645f --- /dev/null +++ b/docs/appledoc/Classes/ASTextNode.html @@ -0,0 +1,1338 @@ + + + + + + ASTextNode Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASTextNode Class Reference

+ + +
+ + + + + + + +
Inherits fromASControlNode : ASDisplayNode : ASDealloc2MainObject
Declared inASTextNode.h
+ + + + +
+ +

Overview

+

Backed by TextKit.

+
+ + + + + +
+ + + + + + +
+
+ +

  attributedText +

+ +
+
+ +
+ + +
+

The styled text displayed by the node.

+
+ + + +
@property (nullable, nonatomic, copy) NSAttributedString *attributedText
+ + + + + + + + + +
+

Discussion

+

Defaults to nil, no text is shown. +For inline image attachments, add an attribute of key NSAttachmentAttributeName, with a value of an NSTextAttachment.

+
+ + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+ +

  truncationAttributedText +

+ +
+
+ +
+ + +
+

The attributedText to use when the text must be truncated.

+
+ + + +
@property (nullable, nonatomic, copy) NSAttributedString *truncationAttributedText
+ + + + + + + + + +
+

Discussion

+

Defaults to a localized ellipsis character.

+
+ + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+ +

  additionalTruncationMessage +

+ +
+
+ +
+ + +
+

@summary The second attributed string appended for truncation.

+
+ + + +
@property (nullable, nonatomic, copy) NSAttributedString *additionalTruncationMessage
+ + + + + + + + + +
+

Discussion

+

This string will be highlighted on touches. +@default nil

+
+ + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+ +

  truncationMode +

+ +
+
+ +
+ + +
+

Determines how the text is truncated to fit within the receiver’s maximum size.

+
+ + + +
@property (nonatomic, assign) NSLineBreakMode truncationMode
+ + + + + + + + + +
+

Discussion

+

Defaults to NSLineBreakByWordWrapping.

Note: Setting a truncationMode in attributedString will override the truncation mode set here.

+
+ + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+ +

  truncated +

+ +
+
+ +
+ + +
+

If the text node is truncated. Text must have been sized first.

+
+ + + +
@property (nonatomic, readonly, assign, getter=isTruncated) BOOL truncated
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+ +

  maximumNumberOfLines +

+ +
+
+ +
+ + +
+

The maximum number of lines to render of the text before truncation. +@default 0 (No limit)

+
+ + + +
@property (nonatomic, assign) NSUInteger maximumNumberOfLines
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+ +

  lineCount +

+ +
+
+ +
+ + +
+

The number of lines in the text. Text must have been sized first.

+
+ + + +
@property (nonatomic, readonly, assign) NSUInteger lineCount
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+ +

  exclusionPaths +

+ +
+
+ +
+ + +
+

An array of path objects representing the regions where text should not be displayed.

+
+ + + +
@property (nullable, nonatomic, strong) NSArray<UIBezierPath*> *exclusionPaths
+ + + + + + + + + +
+

Discussion

+

The default value of this property is an empty array. You can +assign an array of UIBezierPath objects to exclude text from one or more regions in +the text node’s bounds. You can use this property to have text wrap around images, +shapes or other text like a fancy magazine.

+
+ + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+ +

  placeholderEnabled +

+ +
+
+ +
+ + +
+

ASTextNode has a special placeholder behavior when placeholderEnabled is YES.

+
+ + + +
@property (nonatomic, assign) BOOL placeholderEnabled
+ + + + + + + + + +
+

Discussion

+

Defaults to NO. When YES, it draws rectangles for each line of text, +following the true shape of the text’s wrapping. This visually mirrors the overall +shape and weight of paragraphs, making the appearance of the finished text less jarring.

+
+ + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+ +

  placeholderColor +

+ +
+
+ +
+ + +
+

The placeholder color.

+
+ + + +
@property (nullable, nonatomic, strong) UIColor *placeholderColor
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+ +

  placeholderInsets +

+ +
+
+ +
+ + +
+

Inset each line of the placeholder.

+
+ + + +
@property (nonatomic, assign) UIEdgeInsets placeholderInsets
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+ +

  shadowPadding +

+ +
+
+ +
+ + +
+

The number of pixels used for shadow padding on each side of the receiver.

+
+ + + +
@property (nonatomic, readonly, assign) UIEdgeInsets shadowPadding
+ + + + + + + + + +
+

Discussion

+

Each inset will be less than or equal to zero, so that applying +UIEdgeInsetsRect(boundingRectForText, shadowPadding) +will return a CGRect large enough to fit both the text and the appropriate shadow padding.

+
+ + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+ +

– rectsForTextRange: +

+ +
+
+ +
+ + +
+

Returns an array of rects bounding the characters in a given text range.

+
+ + + +
- (NSArray<NSValue*> *)rectsForTextRange:(NSRange)textRange
+ + + +
+

Parameters

+ + + + + + + +
textRange

A range of text. Must be valid for the receiver’s string.

+
+ + + + + + + +
+

Discussion

+

Use this method to detect all the different rectangles a given range of text occupies. +The rects returned are not guaranteed to be contiguous (for example, if the given text range spans +a line break, the rects returned will be on opposite sides and different lines). The rects returned +are in the coordinate system of the receiver.

+
+ + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+ +

– highlightRectsForTextRange: +

+ +
+
+ +
+ + +
+

Returns an array of rects used for highlighting the characters in a given text range.

+
+ + + +
- (NSArray<NSValue*> *)highlightRectsForTextRange:(NSRange)textRange
+ + + +
+

Parameters

+ + + + + + + +
textRange

A range of text. Must be valid for the receiver’s string.

+
+ + + + + + + +
+

Discussion

+

Use this method to detect all the different rectangles the highlights of a given range of text occupies. +The rects returned are not guaranteed to be contiguous (for example, if the given text range spans +a line break, the rects returned will be on opposite sides and different lines). The rects returned +are in the coordinate system of the receiver. This method is useful for visual coordination with a +highlighted range of text.

+
+ + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+ +

– frameForTextRange: +

+ +
+
+ +
+ + +
+

Returns a bounding rect for the given text range.

+
+ + + +
- (CGRect)frameForTextRange:(NSRange)textRange
+ + + +
+

Parameters

+ + + + + + + +
textRange

A range of text. Must be valid for the receiver’s string.

+
+ + + + + + + +
+

Discussion

+

The height of the frame returned is that of the receiver’s line-height; adjustment for +cap-height and descenders is not performed. This method raises an exception if textRange is not +a valid substring range of the receiver’s string.

+
+ + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+ +

– trailingRect +

+ +
+
+ +
+ + +
+

Returns the trailing rectangle of space in the receiver, after the final character.

+
+ + + +
- (CGRect)trailingRect
+ + + + + + + + + +
+

Discussion

+

Use this method to detect which portion of the receiver is not occupied by characters. +The rect returned is in the coordinate system of the receiver.

+
+ + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+ +

  linkAttributeNames +

+ +
+
+ +
+ + +
+

The set of attribute names to consider links. Defaults to NSLinkAttributeName.

+
+ + + +
@property (nonatomic, copy) NSArray<NSString*> *linkAttributeNames
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+ +

– linkAttributeValueAtPoint:attributeName:range: +

+ +
+
+ +
+ + +
+

Indicates whether the receiver has an entity at a given point.

+
+ + + +
- (nullable id)linkAttributeValueAtPoint:(CGPoint)point attributeName:(out NSString *_Nullable *_Nullable)attributeNameOut range:(out NSRange *_Nullable)rangeOut
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
point

The point, in the receiver’s coordinate system.

attributeNameOut

The name of the attribute at the point. Can be NULL.

rangeOut

The ultimate range of the found text. Can be NULL.

+
+ + + +
+

Return Value

+

YES if an entity exists at point; NO otherwise.

+
+ + + + + + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+ +

  highlightStyle +

+ +
+
+ +
+ + +
+

The style to use when highlighting text.

+
+ + + +
@property (nonatomic, assign) ASTextNodeHighlightStyle highlightStyle
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+ +

  highlightRange +

+ +
+
+ +
+ + +
+

The range of text highlighted by the receiver. Changes to this property are not animated by default.

+
+ + + +
@property (nonatomic, assign) NSRange highlightRange
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+ +

– setHighlightRange:animated: +

+ +
+
+ +
+ + +
+

Set the range of text to highlight, with optional animation.

+
+ + + +
- (void)setHighlightRange:(NSRange)highlightRange animated:(BOOL)animated
+ + + +
+

Parameters

+ + + + + + + + + + + + +
highlightRange

The range of text to highlight.

animated

Whether the text should be highlighted with an animation.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+ +

  delegate +

+ +
+
+ +
+ + +
+

Responds to actions from links in the text node.

+
+ + + +
@property (nonatomic, weak) id<ASTextNodeDelegate> delegate
+ + + + + + + + + +
+

Discussion

+

The delegate must be set before the node is loaded, and implement + textNode:longPressedLinkAttribute:value:atPoint:textRange: in order for + the long press gesture recognizer to be installed.

+
+ + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+ +

  longPressCancelsTouches +

+ +
+
+ +
+ + +
+

If YES and a long press is recognized, touches are cancelled. Default is NO

+
+ + + +
@property (nonatomic, assign) BOOL longPressCancelsTouches
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+ +

  passthroughNonlinkTouches +

+ +
+
+ +
+ + +
+

if YES will not intercept touches for non-link areas of the text. Default is NO.

+
+ + + +
@property (nonatomic, assign) BOOL passthroughNonlinkTouches
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASVideoNode.html b/docs/appledoc/Classes/ASVideoNode.html new file mode 100755 index 00000000..f9b2b283 --- /dev/null +++ b/docs/appledoc/Classes/ASVideoNode.html @@ -0,0 +1,265 @@ + + + + + + ASVideoNode Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASVideoNode Class Reference

+ + +
+ + + + + + + +
Inherits fromASNetworkImageNode : ASImageNode : ASControlNode : ASDisplayNode : ASDealloc2MainObject
Declared inASVideoNode.h
+ + + + + + +
+ + + + + + +
+
+ +

  assetURL +

+ +
+
+ +
+ + +
+
    +
  • @abstract The URL with which the asset was initialized.
  • +
  • @discussion Setting the URL will overwrite the current asset with a newly created AVURLAsset created from the given URL, and AVAsset *asset will point to that newly created AVURLAsset. Please don’t set both assetURL and asset.
  • +
  • @return Current URL the asset was initialized or nil if no URL was given.
  • +
+ +
+ + + +
@property (nullable, nonatomic, strong, readwrite) NSURL *assetURL
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASVideoNode.h

+
+ + +
+
+
+ +

  shouldAutoplay +

+ +
+
+ +
+ + +
+

When shouldAutoplay is set to true, a video node will play when it has both loaded and entered the “visible” interfaceState. +If it leaves the visible interfaceState it will pause but will resume once it has returned.

+
+ + + +
@property (nonatomic, assign, readwrite) BOOL shouldAutoplay
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASVideoNode.h

+
+ + +
+
+
+ +

  delegate +

+ +
+
+ +
+ + +
+

The delegate, which must conform to the ASNetworkImageNodeDelegate protocol.

+
+ + + +
@property (nullable, nonatomic, weak, readwrite) id<ASVideoNodeDelegate,ASNetworkImageNodeDelegate> delegate
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASNetworkImageNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASVideoPlayerNode.html b/docs/appledoc/Classes/ASVideoPlayerNode.html new file mode 100755 index 00000000..3d6645c8 --- /dev/null +++ b/docs/appledoc/Classes/ASVideoPlayerNode.html @@ -0,0 +1,174 @@ + + + + + + ASVideoPlayerNode Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASVideoPlayerNode Class Reference

+ + +
+ + + + + + + +
Inherits fromASDisplayNode : ASDealloc2MainObject
Declared inASVideoPlayerNode.h
+ + + + + + +
+ + + + + + +
+
+ +

  shouldAutoPlay +

+ +
+
+ +
+ + +
+

When shouldAutoplay is set to true, a video node will play when it has both loaded and entered the “visible” interfaceState. +If it leaves the visible interfaceState it will pause but will resume once it has returned.

+
+ + + +
@property (nonatomic, assign, readwrite) BOOL shouldAutoPlay
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASVideoPlayerNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASViewController.html b/docs/appledoc/Classes/ASViewController.html new file mode 100755 index 00000000..d29e08e0 --- /dev/null +++ b/docs/appledoc/Classes/ASViewController.html @@ -0,0 +1,450 @@ + + + + + + ASViewController Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASViewController Class Reference

+ + +
+ + + + + + + +
Conforms to*
:
ASDisplayNode
DisplayNodeType
__covariant
Declared inASViewController.h
+ + + + + + +
+ + + + + + +
+
+ +

– initWithNode: +

+ +
+
+ +
+ + +
+

ASViewController Designated initializer.

+
+ + + +
- (instancetype)initWithNode:(DisplayNodeType)node
+ + + +
+

Parameters

+ + + + + + + +
node

An ASDisplayNode which will provide the root view (self.view)

+
+ + + +
+

Return Value

+

An ASViewController instance whose root view will be backed by the provided ASDisplayNode.

+
+ + + + + +
+

Discussion

+

ASViewController allows you to have a completely node backed heirarchy. It automatically +handles @c ASVisibilityDepth, automatic range mode and propogating @c ASDisplayTraits to contained nodes.

+
+ + + + + +
+

See Also

+ +
+ + + +
+

Declared In

+

ASViewController.h

+
+ + +
+
+
+ +

  node +

+ +
+
+ +
+ + +
+

node Returns the ASDisplayNode which provides the backing view to the view controller.

+
+ + + +
@property (nonatomic, strong, readonly) DisplayNodeType node
+ + + + + +
+

Return Value

+

node Returns the ASDisplayNode which provides the backing view to the view controller.

+
+ + + + + + + + + + + +
+

Declared In

+

ASViewController.h

+
+ + +
+
+
+ +

  overrideDisplayTraitsWithTraitCollection +

+ +
+
+ +
+ + +
+

Set this block to customize the ASDisplayTraits returned when the VC transitions to the given traitCollection.

+
+ + + +
@property (nonatomic, copy) ASDisplayTraitsForTraitCollectionBlock overrideDisplayTraitsWithTraitCollection
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASViewController.h

+
+ + +
+
+
+ +

  overrideDisplayTraitsWithWindowSize +

+ +
+
+ +
+ + +
+

Set this block to customize the ASDisplayTraits returned when the VC transitions to the given window size.

+
+ + + +
@property (nonatomic, copy) ASDisplayTraitsForTraitWindowSizeBlock overrideDisplayTraitsWithWindowSize
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASViewController.h

+
+ + +
+
+
+ +

  interfaceState +

+ +
+
+ +
+ + +
+

Passthrough property to the the .interfaceState of the node.

+
+ + + +
@property (nonatomic, readonly) ASInterfaceState interfaceState
+ + + + + +
+

Return Value

+

The current ASInterfaceState of the node, indicating whether it is visible and other situational properties.

+
+ + + + + + + + + +
+

See Also

+ +
+ + + +
+

Declared In

+

ASViewController.h

+
+ + +
+
+
+ +

– nodeConstrainedSize +

+ +
+
+ +
+ + +
+

The constrained size used to measure the backing node.

+
+ + + +
- (ASSizeRange)nodeConstrainedSize
+ + + + + + + + + +
+

Discussion

+

Defaults to providing a size range that uses the view controller view’s bounds as +both the min and max definitions. Override this method to provide a custom size range to the +backing node.

+
+ + + + + + + +
+

Declared In

+

ASViewController.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Classes/ASWrapperLayoutSpec.html b/docs/appledoc/Classes/ASWrapperLayoutSpec.html new file mode 100755 index 00000000..844114f8 --- /dev/null +++ b/docs/appledoc/Classes/ASWrapperLayoutSpec.html @@ -0,0 +1,123 @@ + + + + + + ASWrapperLayoutSpec Class Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASWrapperLayoutSpec Class Reference

+ + +
+ + + + + + + +
Inherits fromASLayoutSpec : NSObject
Declared inASLayoutSpec.h
+ + + + +
+ +

Overview

+

An ASLayoutSpec subclass that can wrap one or more ASLayoutElement and calculates the layout based on the +sizes of the children. If multiple children are provided the size of the biggest child will be used to for +size of this layout spec.

+
+ + + + + + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Constants/ASAbsoluteLayoutSpecSizing.html b/docs/appledoc/Constants/ASAbsoluteLayoutSpecSizing.html new file mode 100755 index 00000000..ae500f68 --- /dev/null +++ b/docs/appledoc/Constants/ASAbsoluteLayoutSpecSizing.html @@ -0,0 +1,175 @@ + + + + + + ASAbsoluteLayoutSpecSizing Constants Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASAbsoluteLayoutSpecSizing Constants Reference

+ + +
+ + + + +
Declared inASAbsoluteLayoutSpec.h
+ + + + + + + +

ASAbsoluteLayoutSpecSizing

+ + +
+

How much space the spec will take up.

+
+ + +
+ + +

Definition

+ typedef NS_ENUM(NSInteger, ASAbsoluteLayoutSpecSizing ) {
+ +    ASAbsoluteLayoutSpecSizingDefault,
+ +    ASAbsoluteLayoutSpecSizingSizeToFit,
+ + };
+ +
+ +
+

Constants

+
+ +
ASAbsoluteLayoutSpecSizingDefault
+
+ + +

The spec will take up the maximum size possible.

+ + + + + + +

+ Declared In ASAbsoluteLayoutSpec.h. +

+ +
+ +
ASAbsoluteLayoutSpecSizingSizeToFit
+
+ + +

Computes a size for the spec that is the union of all childrens' frames.

+ + + + + + +

+ Declared In ASAbsoluteLayoutSpec.h. +

+ +
+ +
+
+ + + + + + + + +
+

Declared In

+

ASAbsoluteLayoutSpec.h

+
+ + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Constants/ASButtonNodeImageAlignment.html b/docs/appledoc/Constants/ASButtonNodeImageAlignment.html new file mode 100755 index 00000000..d03b4195 --- /dev/null +++ b/docs/appledoc/Constants/ASButtonNodeImageAlignment.html @@ -0,0 +1,175 @@ + + + + + + ASButtonNodeImageAlignment Constants Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASButtonNodeImageAlignment Constants Reference

+ + +
+ + + + +
Declared inASButtonNode.h
+ + + + + + + +

ASButtonNodeImageAlignment

+ + +
+

Image alignment defines where the image will be placed relative to the text.

+
+ + +
+ + +

Definition

+ typedef NS_ENUM(NSInteger, ASButtonNodeImageAlignment ) {
+ +    ASButtonNodeImageAlignmentBeginning,
+ +    ASButtonNodeImageAlignmentEnd,
+ + };
+ +
+ +
+

Constants

+
+ +
ASButtonNodeImageAlignmentBeginning
+
+ + +

Places the image before the text.

+ + + + + + +

+ Declared In ASButtonNode.h. +

+ +
+ +
ASButtonNodeImageAlignmentEnd
+
+ + +

Places the image after the text.

+ + + + + + +

+ Declared In ASButtonNode.h. +

+ +
+ +
+
+ + + + + + + + +
+

Declared In

+

ASButtonNode.h

+
+ + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Constants/ASCellNodeVisibilityEvent.html b/docs/appledoc/Constants/ASCellNodeVisibilityEvent.html new file mode 100755 index 00000000..eefd793f --- /dev/null +++ b/docs/appledoc/Constants/ASCellNodeVisibilityEvent.html @@ -0,0 +1,218 @@ + + + + + + ASCellNodeVisibilityEvent Constants Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASCellNodeVisibilityEvent Constants Reference

+ + +
+ + + + +
Declared inASCellNode.h
+ + + + + + + +

ASCellNodeVisibilityEvent

+ +
+ + +

Definition

+ typedef NS_ENUM(NSUInteger, ASCellNodeVisibilityEvent ) {
+ +    ASCellNodeVisibilityEventVisible,
+ +    ASCellNodeVisibilityEventVisibleRectChanged,
+ +    ASCellNodeVisibilityEventInvisible,
+ +    ASCellNodeVisibilityEventWillBeginDragging,
+ +    ASCellNodeVisibilityEventDidEndDragging,
+ + };
+ +
+ +
+

Constants

+
+ +
ASCellNodeVisibilityEventVisible
+
+ + +

Indicates a cell has just became visible

+ + + + + + +

+ Declared In ASCellNode.h. +

+ +
+ +
ASCellNodeVisibilityEventVisibleRectChanged
+
+ + +

Its position (determined by scrollView.contentOffset) has changed while at least 1px remains visible. +It is possible that 100% of the cell is visible both before and after and only its position has changed, +or that the position change has resulted in more or less of the cell being visible. +Use CGRectIntersect between cellFrame and scrollView.bounds to get this rectangle

+ + + + + + +

+ Declared In ASCellNode.h. +

+ +
+ +
ASCellNodeVisibilityEventInvisible
+
+ + +

Indicates a cell is no longer visible

+ + + + + + +

+ Declared In ASCellNode.h. +

+ +
+ +
ASCellNodeVisibilityEventWillBeginDragging
+
+ + +

Indicates user has started dragging the visible cell

+ + + + + + +

+ Declared In ASCellNode.h. +

+ +
+ +
ASCellNodeVisibilityEventDidEndDragging
+
+ + +

Indicates user has ended dragging the visible cell

+ + + + + + +

+ Declared In ASCellNode.h. +

+ +
+ +
+
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Constants/ASCenterLayoutSpecCenteringOptions.html b/docs/appledoc/Constants/ASCenterLayoutSpecCenteringOptions.html new file mode 100755 index 00000000..d99b9e76 --- /dev/null +++ b/docs/appledoc/Constants/ASCenterLayoutSpecCenteringOptions.html @@ -0,0 +1,213 @@ + + + + + + ASCenterLayoutSpecCenteringOptions Constants Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASCenterLayoutSpecCenteringOptions Constants Reference

+ + +
+ + + + +
Declared inASCenterLayoutSpec.h
+ + + + + + + +

ASCenterLayoutSpecCenteringOptions

+ + +
+

How the child is centered within the spec.

+
+ + +
+ + +

Definition

+ typedef NS_OPTIONS(NSUInteger, ASCenterLayoutSpecCenteringOptions ) {
+ +    ASCenterLayoutSpecCenteringNone = 0,
+ +    ASCenterLayoutSpecCenteringX = 1 < < 0,
+ +    ASCenterLayoutSpecCenteringY = 1 < < 1,
+ +    ASCenterLayoutSpecCenteringXY = ASCenterLayoutSpecCenteringX | ASCenterLayoutSpecCenteringY,
+ + };
+ +
+ +
+

Constants

+
+ +
ASCenterLayoutSpecCenteringNone
+
+ + +

The child is positioned in {0,0} relatively to the layout bounds

+ + + + + + +

+ Declared In ASCenterLayoutSpec.h. +

+ +
+ +
ASCenterLayoutSpecCenteringX
+
+ + +

The child is centered along the X axis

+ + + + + + +

+ Declared In ASCenterLayoutSpec.h. +

+ +
+ +
ASCenterLayoutSpecCenteringY
+
+ + +

The child is centered along the Y axis

+ + + + + + +

+ Declared In ASCenterLayoutSpec.h. +

+ +
+ +
ASCenterLayoutSpecCenteringXY
+
+ + +

Convenience option to center both along the X and Y axis

+ + + + + + +

+ Declared In ASCenterLayoutSpec.h. +

+ +
+ +
+
+ + + + + + + + +
+

Declared In

+

ASCenterLayoutSpec.h

+
+ + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Constants/ASCenterLayoutSpecSizingOptions.html b/docs/appledoc/Constants/ASCenterLayoutSpecSizingOptions.html new file mode 100755 index 00000000..f7dea9c8 --- /dev/null +++ b/docs/appledoc/Constants/ASCenterLayoutSpecSizingOptions.html @@ -0,0 +1,213 @@ + + + + + + ASCenterLayoutSpecSizingOptions Constants Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASCenterLayoutSpecSizingOptions Constants Reference

+ + +
+ + + + +
Declared inASCenterLayoutSpec.h
+ + + + + + + +

ASCenterLayoutSpecSizingOptions

+ + +
+

How much space the spec will take up.

+
+ + +
+ + +

Definition

+ typedef NS_OPTIONS(NSUInteger, ASCenterLayoutSpecSizingOptions ) {
+ +    ASCenterLayoutSpecSizingOptionDefault = ASRelativeLayoutSpecSizingOptionDefault,
+ +    ASCenterLayoutSpecSizingOptionMinimumX = ASRelativeLayoutSpecSizingOptionMinimumWidth,
+ +    ASCenterLayoutSpecSizingOptionMinimumY = ASRelativeLayoutSpecSizingOptionMinimumHeight,
+ +    ASCenterLayoutSpecSizingOptionMinimumXY = ASRelativeLayoutSpecSizingOptionMinimumSize,
+ + };
+ +
+ +
+

Constants

+
+ +
ASCenterLayoutSpecSizingOptionDefault
+
+ + +

The spec will take up the maximum size possible

+ + + + + + +

+ Declared In ASCenterLayoutSpec.h. +

+ +
+ +
ASCenterLayoutSpecSizingOptionMinimumX
+
+ + +

The spec will take up the minimum size possible along the X axis

+ + + + + + +

+ Declared In ASCenterLayoutSpec.h. +

+ +
+ +
ASCenterLayoutSpecSizingOptionMinimumY
+
+ + +

The spec will take up the minimum size possible along the Y axis

+ + + + + + +

+ Declared In ASCenterLayoutSpec.h. +

+ +
+ +
ASCenterLayoutSpecSizingOptionMinimumXY
+
+ + +

Convenience option to take up the minimum size along both the X and Y axis

+ + + + + + +

+ Declared In ASCenterLayoutSpec.h. +

+ +
+ +
+
+ + + + + + + + +
+

Declared In

+

ASCenterLayoutSpec.h

+
+ + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Constants/ASControlNodeEvent.html b/docs/appledoc/Constants/ASControlNodeEvent.html new file mode 100755 index 00000000..fba63cea --- /dev/null +++ b/docs/appledoc/Constants/ASControlNodeEvent.html @@ -0,0 +1,308 @@ + + + + + + ASControlNodeEvent Constants Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASControlNodeEvent Constants Reference

+ + +
+ + + + +
Declared inASControlNode.h
+ + + + + + + +

ASControlNodeEvent

+ + +
+

These events are identical to their UIControl counterparts.

+
+ + +
+ + +

Definition

+ typedef NS_OPTIONS(NSUInteger, ASControlNodeEvent ) {
+ +    ASControlNodeEventTouchDown = 1 < < 0,
+ +    ASControlNodeEventTouchDownRepeat = 1 < < 1,
+ +    ASControlNodeEventTouchDragInside = 1 < < 2,
+ +    ASControlNodeEventTouchDragOutside = 1 < < 3,
+ +    ASControlNodeEventTouchUpInside = 1 < < 4,
+ +    ASControlNodeEventTouchUpOutside = 1 < < 5,
+ +    ASControlNodeEventTouchCancel = 1 < < 6,
+ +    ASControlNodeEventPrimaryActionTriggered = 1 < < 13,
+ +    ASControlNodeEventAllEvents = 0 xFFFFFFFF,
+ + };
+ +
+ +
+

Constants

+
+ +
ASControlNodeEventTouchDown
+
+ + +

A touch-down event in the control node.

+ + + + + + +

+ Declared In ASControlNode.h. +

+ +
+ +
ASControlNodeEventTouchDownRepeat
+
+ + +

A repeated touch-down event in the control node; for this event the value of the UITouch tapCount method is greater than one.

+ + + + + + +

+ Declared In ASControlNode.h. +

+ +
+ +
ASControlNodeEventTouchDragInside
+
+ + +

An event where a finger is dragged inside the bounds of the control node.

+ + + + + + +

+ Declared In ASControlNode.h. +

+ +
+ +
ASControlNodeEventTouchDragOutside
+
+ + +

An event where a finger is dragged just outside the bounds of the control.

+ + + + + + +

+ Declared In ASControlNode.h. +

+ +
+ +
ASControlNodeEventTouchUpInside
+
+ + +

A touch-up event in the control node where the finger is inside the bounds of the node.

+ + + + + + +

+ Declared In ASControlNode.h. +

+ +
+ +
ASControlNodeEventTouchUpOutside
+
+ + +

A touch-up event in the control node where the finger is outside the bounds of the node.

+ + + + + + +

+ Declared In ASControlNode.h. +

+ +
+ +
ASControlNodeEventTouchCancel
+
+ + +

A system event canceling the current touches for the control node.

+ + + + + + +

+ Declared In ASControlNode.h. +

+ +
+ +
ASControlNodeEventPrimaryActionTriggered
+
+ + +

A system event when the Play/Pause button on the Apple TV remote is pressed.

+ + + + + + +

+ Declared In ASControlNode.h. +

+ +
+ +
ASControlNodeEventAllEvents
+
+ + +

All events, including system events.

+ + + + + + +

+ Declared In ASControlNode.h. +

+ +
+ +
+
+ + + + + + + + +
+

Declared In

+

ASControlNode.h

+
+ + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Constants/ASControlState.html b/docs/appledoc/Constants/ASControlState.html new file mode 100755 index 00000000..64744c12 --- /dev/null +++ b/docs/appledoc/Constants/ASControlState.html @@ -0,0 +1,180 @@ + + + + + + ASControlState Constants Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASControlState Constants Reference

+ + +
+ + + + +
Declared inASControlNode.h
+ + + + + + + +

ASControlState

+ +
+ + +

Definition

+ typedef NS_OPTIONS(NSUInteger, ASControlState ) {
+ +    ASControlStateNormal = 0,
+ +    ASControlStateHighlighted = 1 < < 0,
+ +    ASControlStateDisabled = 1 < < 1,
+ +    ASControlStateSelected = 1 < < 2,
+ +    ASControlStateReserved = 0 xFF000000,
+ + };
+ +
+ +
+

Constants

+
+ +
ASControlStateNormal
+
+ + +

+ Declared In ASControlNode.h. +

+ +
+ +
ASControlStateHighlighted
+
+ + +

+ Declared In ASControlNode.h. +

+ +
+ +
ASControlStateDisabled
+
+ + +

+ Declared In ASControlNode.h. +

+ +
+ +
ASControlStateSelected
+
+ + +

+ Declared In ASControlNode.h. +

+ +
+ +
ASControlStateReserved
+
+ + +

+ Declared In ASControlNode.h. +

+ +
+ +
+
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Constants/ASDimensionUnit.html b/docs/appledoc/Constants/ASDimensionUnit.html new file mode 100755 index 00000000..aabf7a98 --- /dev/null +++ b/docs/appledoc/Constants/ASDimensionUnit.html @@ -0,0 +1,201 @@ + + + + + + ASDimensionUnit Constants Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASDimensionUnit Constants Reference

+ + +
+ + + + +
Declared inASDimension.h
+ + + + + + + +

ASDimensionUnit

+ + +
+

A dimension relative to constraints to be provided in the future. +A ASDimension can be one of three types:

+ +

“Auto” - This indicated “I have no opinion” and may be resolved in whatever way makes most sense given the circumstances.

+ +

“Points” - Just a number. It will always resolve to exactly this amount.

+ +

“Percent” - Multiplied to a provided parent amount to resolve a final amount.

+
+ + +
+ + +

Definition

+ typedef NS_ENUM(NSInteger, ASDimensionUnit ) {
+ +    ASDimensionUnitAuto,
+ +    ASDimensionUnitPoints,
+ +    ASDimensionUnitFraction,
+ + };
+ +
+ +
+

Constants

+
+ +
ASDimensionUnitAuto
+
+ + +

This indicates “I have no opinion” and may be resolved in whatever way makes most sense given the circumstances.

+ + + + + + +

+ Declared In ASDimension.h. +

+ +
+ +
ASDimensionUnitPoints
+
+ + +

Just a number. It will always resolve to exactly this amount. This is the default type.

+ + + + + + +

+ Declared In ASDimension.h. +

+ +
+ +
ASDimensionUnitFraction
+
+ + +

Multiplied to a provided parent amount to resolve a final amount.

+ + + + + + +

+ Declared In ASDimension.h. +

+ +
+ +
+
+ + + + + + + + +
+

Declared In

+

ASDimension.h

+
+ + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Constants/ASDisplayNodePerformanceMeasurementOptions.html b/docs/appledoc/Constants/ASDisplayNodePerformanceMeasurementOptions.html new file mode 100755 index 00000000..ea8cb0d7 --- /dev/null +++ b/docs/appledoc/Constants/ASDisplayNodePerformanceMeasurementOptions.html @@ -0,0 +1,175 @@ + + + + + + ASDisplayNodePerformanceMeasurementOptions Constants Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASDisplayNodePerformanceMeasurementOptions Constants Reference

+ + +
+ + + + +
Declared inASDisplayNode+Beta.h
+ + + + + + + +

ASDisplayNodePerformanceMeasurementOptions

+ + +
+

Bitmask to indicate what performance measurements the cell should record.

+
+ + +
+ + +

Definition

+ typedef NS_OPTIONS(NSUInteger, ASDisplayNodePerformanceMeasurementOptions ) {
+ +    ASDisplayNodePerformanceMeasurementOptionLayoutSpec = 1 < < 0,
+ +    ASDisplayNodePerformanceMeasurementOptionLayoutComputation = 1 < < 1,
+ + };
+ +
+ +
+

Constants

+
+ +
ASDisplayNodePerformanceMeasurementOptionLayoutSpec
+
+ + +

Bitmask to indicate what performance measurements the cell should record.

+ + + + + + +

+ Declared In ASDisplayNode+Beta.h. +

+ +
+ +
ASDisplayNodePerformanceMeasurementOptionLayoutComputation
+
+ + +

Bitmask to indicate what performance measurements the cell should record.

+ + + + + + +

+ Declared In ASDisplayNode+Beta.h. +

+ +
+ +
+
+ + + + + + + + +
+

Declared In

+

ASDisplayNode+Beta.h

+
+ + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Constants/ASHorizontalAlignment.html b/docs/appledoc/Constants/ASHorizontalAlignment.html new file mode 100755 index 00000000..cfc38bf0 --- /dev/null +++ b/docs/appledoc/Constants/ASHorizontalAlignment.html @@ -0,0 +1,270 @@ + + + + + + ASHorizontalAlignment Constants Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASHorizontalAlignment Constants Reference

+ + +
+ + + + +
Declared inASStackLayoutDefines.h
+ + + + + + + +

ASHorizontalAlignment

+ + +
+

Orientation of children along horizontal axis

+
+ + +
+ + +

Definition

+ typedef NS_ENUM(NSUInteger, ASHorizontalAlignment ) {
+ +    ASHorizontalAlignmentNone,
+ +    ASHorizontalAlignmentLeft,
+ +    ASHorizontalAlignmentMiddle,
+ +    ASHorizontalAlignmentRight,
+ +    ASAlignmentLeft = ASHorizontalAlignmentLeft,
+ +    ASAlignmentMiddle = ASHorizontalAlignmentMiddle,
+ +    ASAlignmentRight = ASHorizontalAlignmentRight,
+ + };
+ +
+ +
+

Constants

+
+ +
ASHorizontalAlignmentNone
+
+ + +

No alignment specified. Default value

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
ASHorizontalAlignmentLeft
+
+ + +

Left aligned

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
ASHorizontalAlignmentMiddle
+
+ + +

Center aligned

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
ASHorizontalAlignmentRight
+
+ + +

Right aligned

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
ASAlignmentLeft
+
+ + +

Use ASHorizontalAlignmentLeft instead (Deprecated: Use ASHorizontalAlignmentLeft instead)

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
ASAlignmentMiddle
+
+ + +

Use ASHorizontalAlignmentMiddle instead (Deprecated: Use ASHorizontalAlignmentMiddle instead)

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
ASAlignmentRight
+
+ + +

Use ASHorizontalAlignmentRight instead (Deprecated: Use ASHorizontalAlignmentRight instead)

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
+
+ + + + + + + + +
+

Declared In

+

ASStackLayoutDefines.h

+
+ + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Constants/ASInterfaceState.html b/docs/appledoc/Constants/ASInterfaceState.html new file mode 100755 index 00000000..ab0706f8 --- /dev/null +++ b/docs/appledoc/Constants/ASInterfaceState.html @@ -0,0 +1,254 @@ + + + + + + ASInterfaceState Constants Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASInterfaceState Constants Reference

+ + +
+ + + + +
Declared inASDisplayNode.h
+ + + + + + + +

ASInterfaceState

+ + +
+

Interface state is available on ASDisplayNode and ASViewController, and +allows checking whether a node is in an interface situation where it is prudent to trigger certain +actions: measurement, data loading, display, and visibility (the latter for animations or other onscreen-only effects).

+
+ + +
+ + +

Definition

+ typedef NS_OPTIONS(NSUInteger, ASInterfaceState ) {
+ +    ASInterfaceStateNone = 0,
+ +    ASInterfaceStateMeasureLayout = 1 < < 0,
+ +    ASInterfaceStatePreload = 1 < < 1,
+ +    ASInterfaceStateDisplay = 1 < < 2,
+ +    ASInterfaceStateVisible = 1 < < 3,
+ +    ASInterfaceStateInHierarchy = ASInterfaceStateMeasureLayout | ASInterfaceStatePreload | ASInterfaceStateDisplay | ASInterfaceStateVisible,
+ + };
+ +
+ +
+

Constants

+
+ +
ASInterfaceStateNone
+
+ + +

The element is not predicted to be onscreen soon and preloading should not be performed

+ + + + + + +

+ Declared In ASDisplayNode.h. +

+ +
+ +
ASInterfaceStateMeasureLayout
+
+ + +

The element may be added to a view soon that could become visible. Measure the layout, including size calculation.

+ + + + + + +

+ Declared In ASDisplayNode.h. +

+ +
+ +
ASInterfaceStatePreload
+
+ + +

The element is likely enough to come onscreen that disk and/or network data required for display should be fetched.

+ + + + + + +

+ Declared In ASDisplayNode.h. +

+ +
+ +
ASInterfaceStateDisplay
+
+ + +

The element is very likely to become visible, and concurrent rendering should be executed for any -setNeedsDisplay.

+ + + + + + +

+ Declared In ASDisplayNode.h. +

+ +
+ +
ASInterfaceStateVisible
+
+ + +

The element is physically onscreen by at least 1 pixel. + In practice, all other bit fields should also be set when this flag is set.

+ + + + + + +

+ Declared In ASDisplayNode.h. +

+ +
+ +
ASInterfaceStateInHierarchy
+
+ + +

The node is not contained in a cell but it is in a window.

+ + + + + + +

+ Declared In ASDisplayNode.h. +

+ +
+ +
+
+ + + + + + + + +
+

Declared In

+

ASDisplayNode.h

+
+ + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Constants/ASLayoutElementType.html b/docs/appledoc/Constants/ASLayoutElementType.html new file mode 100755 index 00000000..0cf6cc92 --- /dev/null +++ b/docs/appledoc/Constants/ASLayoutElementType.html @@ -0,0 +1,175 @@ + + + + + + ASLayoutElementType Constants Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASLayoutElementType Constants Reference

+ + +
+ + + + +
Declared inASLayoutElement.h
+ + + + + + + +

ASLayoutElementType

+ + +
+

Type of ASLayoutElement

+
+ + +
+ + +

Definition

+ typedef NS_ENUM(NSUInteger, ASLayoutElementType ) {
+ +    ASLayoutElementTypeLayoutSpec,
+ +    ASLayoutElementTypeDisplayNode,
+ + };
+ +
+ +
+

Constants

+
+ +
ASLayoutElementTypeLayoutSpec
+
+ + +

Type of ASLayoutElement

+ + + + + + +

+ Declared In ASLayoutElement.h. +

+ +
+ +
ASLayoutElementTypeDisplayNode
+
+ + +

Type of ASLayoutElement

+ + + + + + +

+ Declared In ASLayoutElement.h. +

+ +
+ +
+
+ + + + + + + + +
+

Declared In

+

ASLayoutElement.h

+
+ + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Constants/ASMapNodeShowAnnotationsOptions.html b/docs/appledoc/Constants/ASMapNodeShowAnnotationsOptions.html new file mode 100755 index 00000000..0f7414e7 --- /dev/null +++ b/docs/appledoc/Constants/ASMapNodeShowAnnotationsOptions.html @@ -0,0 +1,177 @@ + + + + + + ASMapNodeShowAnnotationsOptions Constants Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASMapNodeShowAnnotationsOptions Constants Reference

+ + +
+ + + + +
Declared inASMapNode.h
+ + + + + + + +

ASMapNodeShowAnnotationsOptions

+ +
+ + +

Definition

+ typedef NS_OPTIONS(NSUInteger, ASMapNodeShowAnnotationsOptions ) {
+ +    ASMapNodeShowAnnotationsOptionsIgnored = 0,
+ +    ASMapNodeShowAnnotationsOptionsZoomed = 1 < < 0,
+ +    ASMapNodeShowAnnotationsOptionsAnimated = 1 < < 1,
+ + };
+ +
+ +
+

Constants

+
+ +
ASMapNodeShowAnnotationsOptionsIgnored
+
+ + +

The annotations' positions are ignored, use the region or options specified instead.

+ + + + + + +

+ Declared In ASMapNode.h. +

+ +
+ +
ASMapNodeShowAnnotationsOptionsZoomed
+
+ + +

The annotations' positions are used to calculate the region to show in the map, equivalent to showAnnotations:animated.

+ + + + + + +

+ Declared In ASMapNode.h. +

+ +
+ +
ASMapNodeShowAnnotationsOptionsAnimated
+
+ + +

This will only have an effect if combined with the Zoomed state with liveMap turned on.

+ + + + + + +

+ Declared In ASMapNode.h. +

+ +
+ +
+
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Constants/ASMultiplexImageNodeErrorCode.html b/docs/appledoc/Constants/ASMultiplexImageNodeErrorCode.html new file mode 100755 index 00000000..3843f6a1 --- /dev/null +++ b/docs/appledoc/Constants/ASMultiplexImageNodeErrorCode.html @@ -0,0 +1,217 @@ + + + + + + ASMultiplexImageNodeErrorCode Constants Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASMultiplexImageNodeErrorCode Constants Reference

+ + +
+ + + + +
Declared inASMultiplexImageNode.h
+ + + + + + + +

ASMultiplexImageNodeErrorCode

+ + +
+

ASMultiplexImageNode error codes.

+
+ + + + +
+

Constants

+
+ +
ASMultiplexImageNodeErrorCodeNoSourceForImage
+
+ + +

Indicates that the data source didn’t provide a source for an image identifier.

+ + + + + + +

+ Declared In ASMultiplexImageNode.h. +

+ +
+ +
ASMultiplexImageNodeErrorCodeBestImageIdentifierChanged
+
+ + +

Indicates that the best image identifier changed before a download for a worse identifier began.

+ + + + + + +

+ Declared In ASMultiplexImageNode.h. +

+ +
+ +
ASMultiplexImageNodeErrorCodePhotosImageManagerFailedWithoutError
+
+ + +

Indicates that the Photos framework returned no image and no error. +This may happen if the image is in iCloud and the user did not specify allowsNetworkAccess +in their image request.

+ + + + + + +

+ Declared In ASMultiplexImageNode.h. +

+ +
+ +
ASMultiplexImageNodeErrorCodePHAssetIsUnavailable
+
+ + +

Indicates that the image node could not retrieve the PHAsset for a given asset identifier. +This typically means that the user has not given Photos framework permissions yet or the asset +has been removed from the device.

+ + + + + + +

+ Declared In ASMultiplexImageNode.h. +

+ +
+ +
+
+ + + + + + + + +
+

Declared In

+

ASMultiplexImageNode.h

+
+ + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Constants/ASRelativeDimensionType.html b/docs/appledoc/Constants/ASRelativeDimensionType.html new file mode 100755 index 00000000..f700916c --- /dev/null +++ b/docs/appledoc/Constants/ASRelativeDimensionType.html @@ -0,0 +1,201 @@ + + + + + + ASRelativeDimensionType Constants Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASRelativeDimensionType Constants Reference

+ + +
+ + + + +
Declared inASDimension.h
+ + + + + + + +

ASRelativeDimensionType

+ + +
+

A dimension relative to constraints to be provided in the future. +A ASDimension can be one of three types:

+ +

“Auto” - This indicated “I have no opinion” and may be resolved in whatever way makes most sense given the circumstances.

+ +

“Points” - Just a number. It will always resolve to exactly this amount.

+ +

“Percent” - Multiplied to a provided parent amount to resolve a final amount.

+
+ + +
+ + +

Definition

+ typedef NS_ENUM(NSInteger, ASRelativeDimensionType ) {
+ +    ASRelativeDimensionTypeAuto,
+ +    ASRelativeDimensionTypePoints,
+ +    ASRelativeDimensionTypeFraction,
+ + };
+ +
+ +
+

Constants

+
+ +
ASRelativeDimensionTypeAuto
+
+ + +

This indicates “I have no opinion” and may be resolved in whatever way makes most sense given the circumstances.

+ + + + + + +

+ Declared In ASDimension.h. +

+ +
+ +
ASRelativeDimensionTypePoints
+
+ + +

Just a number. It will always resolve to exactly this amount. This is the default type.

+ + + + + + +

+ Declared In ASDimension.h. +

+ +
+ +
ASRelativeDimensionTypeFraction
+
+ + +

Multiplied to a provided parent amount to resolve a final amount.

+ + + + + + +

+ Declared In ASDimension.h. +

+ +
+ +
+
+ + + + + + + + +
+

Declared In

+

ASDimension.h

+
+ + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Constants/ASRelativeLayoutSpecPosition.html b/docs/appledoc/Constants/ASRelativeLayoutSpecPosition.html new file mode 100755 index 00000000..3f78b744 --- /dev/null +++ b/docs/appledoc/Constants/ASRelativeLayoutSpecPosition.html @@ -0,0 +1,213 @@ + + + + + + ASRelativeLayoutSpecPosition Constants Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASRelativeLayoutSpecPosition Constants Reference

+ + +
+ + + + +
Declared inASRelativeLayoutSpec.h
+ + + + + + + +

ASRelativeLayoutSpecPosition

+ + +
+

How the child is positioned within the spec.

+
+ + +
+ + +

Definition

+ typedef NS_ENUM(NSUInteger, ASRelativeLayoutSpecPosition ) {
+ +    ASRelativeLayoutSpecPositionNone = 0,
+ +    ASRelativeLayoutSpecPositionStart = 1,
+ +    ASRelativeLayoutSpecPositionCenter = 2,
+ +    ASRelativeLayoutSpecPositionEnd = 3,
+ + };
+ +
+ +
+

Constants

+
+ +
ASRelativeLayoutSpecPositionNone
+
+ + +

The child is positioned at point 0

+ + + + + + +

+ Declared In ASRelativeLayoutSpec.h. +

+ +
+ +
ASRelativeLayoutSpecPositionStart
+
+ + +

The child is positioned at point 0 relatively to the layout axis (ie left / top most)

+ + + + + + +

+ Declared In ASRelativeLayoutSpec.h. +

+ +
+ +
ASRelativeLayoutSpecPositionCenter
+
+ + +

The child is centered along the specified axis

+ + + + + + +

+ Declared In ASRelativeLayoutSpec.h. +

+ +
+ +
ASRelativeLayoutSpecPositionEnd
+
+ + +

The child is positioned at the maximum point of the layout axis (ie right / bottom most)

+ + + + + + +

+ Declared In ASRelativeLayoutSpec.h. +

+ +
+ +
+
+ + + + + + + + +
+

Declared In

+

ASRelativeLayoutSpec.h

+
+ + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Constants/ASRelativeLayoutSpecSizingOption.html b/docs/appledoc/Constants/ASRelativeLayoutSpecSizingOption.html new file mode 100755 index 00000000..75d49d97 --- /dev/null +++ b/docs/appledoc/Constants/ASRelativeLayoutSpecSizingOption.html @@ -0,0 +1,213 @@ + + + + + + ASRelativeLayoutSpecSizingOption Constants Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASRelativeLayoutSpecSizingOption Constants Reference

+ + +
+ + + + +
Declared inASRelativeLayoutSpec.h
+ + + + + + + +

ASRelativeLayoutSpecSizingOption

+ + +
+

How much space the spec will take up.

+
+ + +
+ + +

Definition

+ typedef NS_OPTIONS(NSUInteger, ASRelativeLayoutSpecSizingOption ) {
+ +    ASRelativeLayoutSpecSizingOptionDefault,
+ +    ASRelativeLayoutSpecSizingOptionMinimumWidth = 1 < < 0,
+ +    ASRelativeLayoutSpecSizingOptionMinimumHeight = 1 < < 1,
+ +    ASRelativeLayoutSpecSizingOptionMinimumSize = ASRelativeLayoutSpecSizingOptionMinimumWidth | ASRelativeLayoutSpecSizingOptionMinimumHeight,
+ + };
+ +
+ +
+

Constants

+
+ +
ASRelativeLayoutSpecSizingOptionDefault
+
+ + +

The spec will take up the maximum size possible

+ + + + + + +

+ Declared In ASRelativeLayoutSpec.h. +

+ +
+ +
ASRelativeLayoutSpecSizingOptionMinimumWidth
+
+ + +

The spec will take up the minimum size possible along the X axis

+ + + + + + +

+ Declared In ASRelativeLayoutSpec.h. +

+ +
+ +
ASRelativeLayoutSpecSizingOptionMinimumHeight
+
+ + +

The spec will take up the minimum size possible along the Y axis

+ + + + + + +

+ Declared In ASRelativeLayoutSpec.h. +

+ +
+ +
ASRelativeLayoutSpecSizingOptionMinimumSize
+
+ + +

Convenience option to take up the minimum size along both the X and Y axis

+ + + + + + +

+ Declared In ASRelativeLayoutSpec.h. +

+ +
+ +
+
+ + + + + + + + +
+

Declared In

+

ASRelativeLayoutSpec.h

+
+ + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Constants/ASStackLayoutAlignItems.html b/docs/appledoc/Constants/ASStackLayoutAlignItems.html new file mode 100755 index 00000000..7a809bbe --- /dev/null +++ b/docs/appledoc/Constants/ASStackLayoutAlignItems.html @@ -0,0 +1,251 @@ + + + + + + ASStackLayoutAlignItems Constants Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASStackLayoutAlignItems Constants Reference

+ + +
+ + + + +
Declared inASStackLayoutDefines.h
+ + + + + + + +

ASStackLayoutAlignItems

+ + +
+

Orientation of children along cross axis

+
+ + +
+ + +

Definition

+ typedef NS_ENUM(NSUInteger, ASStackLayoutAlignItems ) {
+ +    ASStackLayoutAlignItemsStart,
+ +    ASStackLayoutAlignItemsEnd,
+ +    ASStackLayoutAlignItemsCenter,
+ +    ASStackLayoutAlignItemsStretch,
+ +    ASStackLayoutAlignItemsBaselineFirst,
+ +    ASStackLayoutAlignItemsBaselineLast,
+ + };
+ +
+ +
+

Constants

+
+ +
ASStackLayoutAlignItemsStart
+
+ + +

Align children to start of cross axis

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
ASStackLayoutAlignItemsEnd
+
+ + +

Align children with end of cross axis

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
ASStackLayoutAlignItemsCenter
+
+ + +

Center children on cross axis

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
ASStackLayoutAlignItemsStretch
+
+ + +

Expand children to fill cross axis

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
ASStackLayoutAlignItemsBaselineFirst
+
+ + +

Children align to their first baseline. Only available for horizontal stack spec

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
ASStackLayoutAlignItemsBaselineLast
+
+ + +

Children align to their last baseline. Only available for horizontal stack spec

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
+
+ + + + + + + + +
+

Declared In

+

ASStackLayoutDefines.h

+
+ + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Constants/ASStackLayoutAlignSelf.html b/docs/appledoc/Constants/ASStackLayoutAlignSelf.html new file mode 100755 index 00000000..45606fd4 --- /dev/null +++ b/docs/appledoc/Constants/ASStackLayoutAlignSelf.html @@ -0,0 +1,244 @@ + + + + + + ASStackLayoutAlignSelf Constants Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASStackLayoutAlignSelf Constants Reference

+ + +
+ + + + + + + +
Declared inASStackLayoutDefines.h
ReferencesASStackLayoutAlignItems
+ + + + + + + +

ASStackLayoutAlignSelf

+ + +
+

Each child may override their parent stack’s cross axis alignment.

+
+ + +
+ + +

Definition

+ typedef NS_ENUM(NSUInteger, ASStackLayoutAlignSelf ) {
+ +    ASStackLayoutAlignSelfAuto,
+ +    ASStackLayoutAlignSelfStart,
+ +    ASStackLayoutAlignSelfEnd,
+ +    ASStackLayoutAlignSelfCenter,
+ +    ASStackLayoutAlignSelfStretch,
+ + };
+ +
+ +
+

Constants

+
+ +
ASStackLayoutAlignSelfAuto
+
+ + +

Inherit alignment value from containing stack.

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
ASStackLayoutAlignSelfStart
+
+ + +

Align to start of cross axis

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
ASStackLayoutAlignSelfEnd
+
+ + +

Align with end of cross axis

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
ASStackLayoutAlignSelfCenter
+
+ + +

Center on cross axis

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
ASStackLayoutAlignSelfStretch
+
+ + +

Expand to fill cross axis

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
+
+ + + + + + +
+

See Also

+ +
+ + + +
+

Declared In

+

ASStackLayoutDefines.h

+
+ + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Constants/ASStackLayoutDirection.html b/docs/appledoc/Constants/ASStackLayoutDirection.html new file mode 100755 index 00000000..ac22df4f --- /dev/null +++ b/docs/appledoc/Constants/ASStackLayoutDirection.html @@ -0,0 +1,175 @@ + + + + + + ASStackLayoutDirection Constants Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASStackLayoutDirection Constants Reference

+ + +
+ + + + +
Declared inASStackLayoutDefines.h
+ + + + + + + +

ASStackLayoutDirection

+ + +
+

The direction children are stacked in

+
+ + +
+ + +

Definition

+ typedef NS_ENUM(NSUInteger, ASStackLayoutDirection ) {
+ +    ASStackLayoutDirectionVertical,
+ +    ASStackLayoutDirectionHorizontal,
+ + };
+ +
+ +
+

Constants

+
+ +
ASStackLayoutDirectionVertical
+
+ + +

Children are stacked vertically

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
ASStackLayoutDirectionHorizontal
+
+ + +

Children are stacked horizontally

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
+
+ + + + + + + + +
+

Declared In

+

ASStackLayoutDefines.h

+
+ + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Constants/ASStackLayoutJustifyContent.html b/docs/appledoc/Constants/ASStackLayoutJustifyContent.html new file mode 100755 index 00000000..946d43e0 --- /dev/null +++ b/docs/appledoc/Constants/ASStackLayoutJustifyContent.html @@ -0,0 +1,242 @@ + + + + + + ASStackLayoutJustifyContent Constants Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASStackLayoutJustifyContent Constants Reference

+ + +
+ + + + +
Declared inASStackLayoutDefines.h
+ + + + + + + +

ASStackLayoutJustifyContent

+ + +
+

If no children are flexible, how should this spec justify its children in the available space?

+
+ + +
+ + +

Definition

+ typedef NS_ENUM(NSUInteger, ASStackLayoutJustifyContent ) {
+ +    ASStackLayoutJustifyContentStart,
+ +    ASStackLayoutJustifyContentCenter,
+ +    ASStackLayoutJustifyContentEnd,
+ +    ASStackLayoutJustifyContentSpaceBetween,
+ +    ASStackLayoutJustifyContentSpaceAround,
+ + };
+ +
+ +
+

Constants

+
+ +
ASStackLayoutJustifyContentStart
+
+ + +

On overflow, children overflow out of this spec’s bounds on the right/bottom side. + On underflow, children are left/top-aligned within this spec’s bounds.

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
ASStackLayoutJustifyContentCenter
+
+ + +

On overflow, children are centered and overflow on both sides. + On underflow, children are centered within this spec’s bounds in the stacking direction.

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
ASStackLayoutJustifyContentEnd
+
+ + +

On overflow, children overflow out of this spec’s bounds on the left/top side. + On underflow, children are right/bottom-aligned within this spec’s bounds.

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
ASStackLayoutJustifyContentSpaceBetween
+
+ + +

On overflow or if the stack has only 1 child, this value is identical to ASStackLayoutJustifyContentStart. + Otherwise, the starting edge of the first child is at the starting edge of the stack, + the ending edge of the last child is at the ending edge of the stack, and the remaining children + are distributed so that the spacing between any two adjacent ones is the same. + If there is a remaining space after spacing division, it is combined with the last spacing (i.e the one between the last 2 children).

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
ASStackLayoutJustifyContentSpaceAround
+
+ + +

On overflow or if the stack has only 1 child, this value is identical to ASStackLayoutJustifyContentCenter. + Otherwise, children are distributed such that the spacing between any two adjacent ones is the same, + and the spacing between the first/last child and the stack edges is half the size of the spacing between children. + If there is a remaining space after spacing division, it is combined with the last spacing (i.e the one between the last child and the stack ending edge).

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
+
+ + + + + + + + +
+

Declared In

+

ASStackLayoutDefines.h

+
+ + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Constants/ASTextNodeHighlightStyle.html b/docs/appledoc/Constants/ASTextNodeHighlightStyle.html new file mode 100755 index 00000000..e47cd046 --- /dev/null +++ b/docs/appledoc/Constants/ASTextNodeHighlightStyle.html @@ -0,0 +1,175 @@ + + + + + + ASTextNodeHighlightStyle Constants Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASTextNodeHighlightStyle Constants Reference

+ + +
+ + + + +
Declared inASTextNode.h
+ + + + + + + +

ASTextNodeHighlightStyle

+ + +
+

Highlight styles.

+
+ + +
+ + +

Definition

+ typedef NS_ENUM(NSUInteger, ASTextNodeHighlightStyle ) {
+ +    ASTextNodeHighlightStyleLight,
+ +    ASTextNodeHighlightStyleDark,
+ + };
+ +
+ +
+

Constants

+
+ +
ASTextNodeHighlightStyleLight
+
+ + +

Highlight style for text on a light background.

+ + + + + + +

+ Declared In ASTextNode.h. +

+ +
+ +
ASTextNodeHighlightStyleDark
+
+ + +

Highlight style for text on a dark background.

+ + + + + + +

+ Declared In ASTextNode.h. +

+ +
+ +
+
+ + + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Constants/ASVerticalAlignment.html b/docs/appledoc/Constants/ASVerticalAlignment.html new file mode 100755 index 00000000..640a47dc --- /dev/null +++ b/docs/appledoc/Constants/ASVerticalAlignment.html @@ -0,0 +1,270 @@ + + + + + + ASVerticalAlignment Constants Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASVerticalAlignment Constants Reference

+ + +
+ + + + +
Declared inASStackLayoutDefines.h
+ + + + + + + +

ASVerticalAlignment

+ + +
+

Orientation of children along vertical axis

+
+ + +
+ + +

Definition

+ typedef NS_ENUM(NSUInteger, ASVerticalAlignment ) {
+ +    ASVerticalAlignmentNone,
+ +    ASVerticalAlignmentTop,
+ +    ASVerticalAlignmentCenter,
+ +    ASVerticalAlignmentBottom,
+ +    ASAlignmentTop = ASVerticalAlignmentTop,
+ +    ASAlignmentCenter = ASVerticalAlignmentCenter,
+ +    ASAlignmentBottom = ASVerticalAlignmentBottom,
+ + };
+ +
+ +
+

Constants

+
+ +
ASVerticalAlignmentNone
+
+ + +

No alignment specified. Default value

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
ASVerticalAlignmentTop
+
+ + +

Top aligned

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
ASVerticalAlignmentCenter
+
+ + +

Center aligned

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
ASVerticalAlignmentBottom
+
+ + +

Bottom aligned

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
ASAlignmentTop
+
+ + +

Use ASVerticalAlignmentTop instead (Deprecated: Use ASVerticalAlignmentTop instead)

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
ASAlignmentCenter
+
+ + +

Use ASVerticalAlignmentCenter instead (Deprecated: Use ASVerticalAlignmentCenter instead)

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
ASAlignmentBottom
+
+ + +

Use ASVerticalAlignmentBottom instead (Deprecated: Use ASVerticalAlignmentBottom instead)

+ + + + + + +

+ Declared In ASStackLayoutDefines.h. +

+ +
+ +
+
+ + + + + + + + +
+

Declared In

+

ASStackLayoutDefines.h

+
+ + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASAbsoluteLayoutElement.html b/docs/appledoc/Protocols/ASAbsoluteLayoutElement.html new file mode 100755 index 00000000..ecaff959 --- /dev/null +++ b/docs/appledoc/Protocols/ASAbsoluteLayoutElement.html @@ -0,0 +1,180 @@ + + + + + + ASAbsoluteLayoutElement Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASAbsoluteLayoutElement Protocol Reference

+ + +
+ + + + +
Declared inASAbsoluteLayoutElement.h
+ + + + +
+ +

Overview

+

Layout options that can be defined for an ASLayoutElement being added to a ASAbsoluteLayoutSpec.

+
+ + + + + +
+ + + + + + +
+
+ +

  layoutPosition +required method

+ +
+
+ +
+ + +
+

The position of this object within its parent spec.

+
+ + + +
@property (nonatomic, assign) CGPoint layoutPosition
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASAbsoluteLayoutElement.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASCellNodeInteractionDelegate.html b/docs/appledoc/Protocols/ASCellNodeInteractionDelegate.html new file mode 100755 index 00000000..70d2a926 --- /dev/null +++ b/docs/appledoc/Protocols/ASCellNodeInteractionDelegate.html @@ -0,0 +1,198 @@ + + + + + + ASCellNodeInteractionDelegate Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASCellNodeInteractionDelegate Protocol Reference

+ + +
+ + + + + + + +
Conforms toNSObject
Declared inASCellNode+Internal.h
+ + + + + + +
+ + + + + + +
+
+ +

– nodeDidRelayout:sizeChanged: +required method

+ +
+
+ +
+ + +
+

Notifies the delegate that the specified cell node has done a relayout. +The notification is done on main thread.

+
+ + + +
- (void)nodeDidRelayout:(ASCellNode *)node sizeChanged:(BOOL)sizeChanged
+ + + +
+

Parameters

+ + + + + + + + + + + + +
node

A node informing the delegate about the relayout.

sizeChanged

YES if the node’s calculatedSize changed during the relayout, NO otherwise.

+
+ + + + + + + +
+

Discussion

+

This will not be called due to measurement passes before the node has loaded +its view, even if triggered by -setNeedsLayout, as it is assumed these are +not relevant to UIKit. Indeed, these calls can cause consistency issues.

+
+ + + + + + + +
+

Declared In

+

ASCellNode+Internal.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASCollectionDataSource.html b/docs/appledoc/Protocols/ASCollectionDataSource.html new file mode 100755 index 00000000..1e4b1ec0 --- /dev/null +++ b/docs/appledoc/Protocols/ASCollectionDataSource.html @@ -0,0 +1,807 @@ + + + + + + ASCollectionDataSource Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASCollectionDataSource Protocol Reference

+ + +
+ + + + + + + +
Conforms toASCommonCollectionDataSource
Declared inASCollectionNode.h
+ + + + +
+ +

Overview

+

This is a node-based UICollectionViewDataSource.

+
+ + + + + +
+ + + + + + +
+
+ +

– collectionNode:numberOfItemsInSection: +

+ +
+
+ +
+ + +
+

Asks the data source for the number of items in the given section of the collection node.

+
+ + + +
- (NSInteger)collectionNode:(ASCollectionNode *)collectionNode numberOfItemsInSection:(NSInteger)section
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– numberOfSectionsInCollectionNode: +

+ +
+
+ +
+ + +
+

Asks the data source for the number of sections in the collection node.

+
+ + + +
- (NSInteger)numberOfSectionsInCollectionNode:(ASCollectionNode *)collectionNode
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– collectionNode:nodeBlockForItemAtIndexPath: +

+ +
+
+ +
+ + +
+

Similar to -collectionNode:nodeForItemAtIndexPath: +This method takes precedence over collectionNode:nodeForItemAtIndexPath: if implemented.

+
+ + + +
- (ASCellNodeBlock)collectionNode:(ASCollectionNode *)collectionNode nodeBlockForItemAtIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + + + + + + +
collectionNode

The sender.

indexPath

The index path of the item.

+
+ + + +
+

Return Value

+

a block that creates the node for display for this item. +Must be thread-safe (can be called on the main thread or a background +queue) and should not implement reuse (it will be called once per row).

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– collectionNode:nodeForItemAtIndexPath: +

+ +
+
+ +
+ + +
+

Similar to -collectionView:cellForItemAtIndexPath:.

+
+ + + +
- (ASCellNode *)collectionNode:(ASCollectionNode *)collectionNode nodeForItemAtIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + + + + + + +
indexPath

The index path of the item.

collectionView

The sender.

+
+ + + +
+

Return Value

+

A node to display for the given item. This will be called on the main thread and should +not implement reuse (it will be called once per item). Unlike UICollectionView’s version, +this method is not called when the item is about to display.

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– collectionNode:nodeForSupplementaryElementOfKind:atIndexPath: +

+ +
+
+ +
+ + +
+

Asks the data source to provide a node to display for the given supplementary element in the collection view.

+
+ + + +
- (ASCellNode *)collectionNode:(ASCollectionNode *)collectionNode nodeForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
collectionNode

The sender.

kind

The kind of supplementary element.

indexPath

The index path of the supplementary element.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– collectionNode:contextForSection: +

+ +
+
+ +
+ + +
+

Asks the data source to provide a context object for the given section. This object +can later be retrieved by calling @c contextForSection: and is useful when implementing +custom @c UICollectionViewLayout subclasses. The context object is ret

+
+ + + +
- (nullable id<ASSectionContext>)collectionNode:(ASCollectionNode *)collectionNode contextForSection:(NSInteger)section
+ + + +
+

Parameters

+ + + + + + + + + + + + +
collectionNode

The sender.

section

The index of the section to provide context for.

+
+ + + +
+

Return Value

+

A context object to assign to the given section, or @c nil.

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– collectionView:nodeForItemAtIndexPath: +

+ +
+
+ +
+ + +
+

Similar to -collectionView:cellForItemAtIndexPath:.

+
+ + + +
- (ASCellNode *)collectionView:(ASCollectionView *)collectionView nodeForItemAtIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + + + + + + +
collectionView

The sender.

indexPath

The index path of the requested node.

+
+ + + +
+

Return Value

+

a node for display at this indexpath. This will be called on the main thread and should +not implement reuse (it will be called once per row). Unlike UICollectionView’s version, +this method is not called when the row is about to display.

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– collectionView:nodeBlockForItemAtIndexPath: +

+ +
+
+ +
+ + +
+

Similar to -collectionView:nodeForItemAtIndexPath: +This method takes precedence over collectionView:nodeForItemAtIndexPath: if implemented.

+
+ + + +
- (ASCellNodeBlock)collectionView:(ASCollectionView *)collectionView nodeBlockForItemAtIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + + + + + + +
collectionView

The sender.

indexPath

The index path of the requested node.

+
+ + + +
+

Return Value

+

a block that creates the node for display at this indexpath. +Must be thread-safe (can be called on the main thread or a background +queue) and should not implement reuse (it will be called once per row).

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– collectionView:nodeForSupplementaryElementOfKind:atIndexPath: +

+ +
+
+ +
+ + +
+

Asks the collection view to provide a supplementary node to display in the collection view.

+
+ + + +
- (ASCellNode *)collectionView:(ASCollectionView *)collectionView nodeForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
collectionView

An object representing the collection view requesting this information.

kind

The kind of supplementary node to provide.

indexPath

The index path that specifies the location of the new supplementary node.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– collectionViewLockDataSource: +

+ +
+
+ +
+ + +
+

Indicator to lock the data source for data fetching in async mode. +We should not update the data source until the data source has been unlocked. Otherwise, it will incur data inconsistency or exception +due to the data access in async mode. (Deprecated: The data source is always accessed on the main thread, and this method will not be called.)

+
+ + + +
- (void)collectionViewLockDataSource:(ASCollectionView *)collectionView
+ + + +
+

Parameters

+ + + + + + + +
collectionView

The sender.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– collectionViewUnlockDataSource: +

+ +
+
+ +
+ + +
+

Indicator to unlock the data source for data fetching in async mode. +We should not update the data source until the data source has been unlocked. Otherwise, it will incur data inconsistency or exception +due to the data access in async mode. (Deprecated: The data source is always accessed on the main thread, and this method will not be called.)

+
+ + + +
- (void)collectionViewUnlockDataSource:(ASCollectionView *)collectionView
+ + + +
+

Parameters

+ + + + + + + +
collectionView

The sender.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASCollectionDelegate.html b/docs/appledoc/Protocols/ASCollectionDelegate.html new file mode 100755 index 00000000..8b401711 --- /dev/null +++ b/docs/appledoc/Protocols/ASCollectionDelegate.html @@ -0,0 +1,685 @@ + + + + + + ASCollectionDelegate Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASCollectionDelegate Protocol Reference

+ + +
+ + + + + + + +
Conforms toASCommonCollectionDelegate
NSObject
Declared inASCollectionNode.h
+ + + + +
+ +

Overview

+

This is a node-based UICollectionViewDelegate.

+
+ + + + + +
+ + + + + + +
+
+ +

– collectionNode:constrainedSizeForItemAtIndexPath: +

+ +
+
+ +
+ + +
+

Provides the constrained size range for measuring the given item.

+
+ + + +
- (ASSizeRange)collectionNode:(ASCollectionNode *)collectionNode constrainedSizeForItemAtIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + + + + + + +
collectionNode

The sender.

indexPath

The index path of the item.

+
+ + + +
+

Return Value

+

A constrained size range for layout for the item at this index path.

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– collectionNode:willBeginBatchFetchWithContext: +

+ +
+
+ +
+ + +
+

Receive a message that the collection node is near the end of its data set and more data should be fetched if +necessary.

+
+ + + +
- (void)collectionNode:(ASCollectionNode *)collectionNode willBeginBatchFetchWithContext:(ASBatchContext *)context
+ + + +
+

Parameters

+ + + + + + + + + + + + +
collectionNode

The sender.

context

A context object that must be notified when the batch fetch is completed.

+
+ + + + + + + +
+

Discussion

+

You must eventually call -completeBatchFetching: with an argument of YES in order to receive future +notifications to do batch fetches. This method is called on a background queue.

+ +

ASCollectionNode currently only supports batch events for tail loads. If you require a head load, consider +implementing a UIRefreshControl.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– shouldBatchFetchForCollectionNode: +

+ +
+
+ +
+ + +
+

Tell the collection node if batch fetching should begin.

+
+ + + +
- (BOOL)shouldBatchFetchForCollectionNode:(ASCollectionNode *)collectionNode
+ + + +
+

Parameters

+ + + + + + + +
collectionNode

The sender.

+
+ + + + + + + +
+

Discussion

+

Use this method to conditionally fetch batches. Example use cases are: limiting the total number of +objects that can be fetched or no network connection.

+ +

If not implemented, the collection node assumes that it should notify its asyncDelegate when batch fetching +should occur.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– collectionView:constrainedSizeForNodeAtIndexPath: +

+ +
+
+ +
+ + +
+

Provides the constrained size range for measuring the node at the index path.

+
+ + + +
- (ASSizeRange)collectionView:(ASCollectionView *)collectionView constrainedSizeForNodeAtIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + + + + + + +
collectionView

The sender.

indexPath

The index path of the node.

+
+ + + +
+

Return Value

+

A constrained size range for layout the node at this index path.

+
+ + + + + + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– collectionView:willDisplayNode:forItemAtIndexPath: +

+ +
+
+ +
+ + +
+

Informs the delegate that the collection view will add the given node +at the given index path to the view hierarchy.

+
+ + + +
- (void)collectionView:(ASCollectionView *)collectionView willDisplayNode:(ASCellNode *)node forItemAtIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
collectionView

The sender.

node

The node that will be displayed.

indexPath

The index path of the item that will be displayed.

+
+ + + + + + + +
+

Discussion

+

Warning: AsyncDisplayKit processes collection view edits asynchronously. The index path +passed into this method may not correspond to the same item in your data source +if your data source has been updated since the last edit was processed.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– collectionView:didEndDisplayingNode:forItemAtIndexPath: +

+ +
+
+ +
+ + +
+

Informs the delegate that the collection view did remove the provided node from the view hierarchy. +This may be caused by the node scrolling out of view, or by deleting the item +or its containing section with @c deleteItemsAtIndexPaths: or @c deleteSections: .

+
+ + + +
- (void)collectionView:(ASCollectionView *)collectionView didEndDisplayingNode:(ASCellNode *)node forItemAtIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
collectionView

The sender.

node

The node which was removed from the view hierarchy.

indexPath

The index path at which the node was located before it was removed.

+
+ + + + + + + +
+

Discussion

+

Warning: AsyncDisplayKit processes collection view edits asynchronously. The index path +passed into this method may not correspond to the same item in your data source +if your data source has been updated since the last edit was processed.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– shouldBatchFetchForCollectionView: +

+ +
+
+ +
+ + +
+

Tell the collectionView if batch fetching should begin.

+
+ + + +
- (BOOL)shouldBatchFetchForCollectionView:(ASCollectionView *)collectionView
+ + + +
+

Parameters

+ + + + + + + +
collectionView

The sender.

+
+ + + + + + + +
+

Discussion

+

Use this method to conditionally fetch batches. Example use cases are: limiting the total number of +objects that can be fetched or no network connection.

+ +

If not implemented, the collectionView assumes that it should notify its asyncDelegate when batch fetching +should occur.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+ +

– collectionView:willDisplayNodeForItemAtIndexPath: +

+ +
+
+ +
+ + +
+

Informs the delegate that the collection view will add the node +at the given index path to the view hierarchy.

+
+ + + +
- (void)collectionView:(ASCollectionView *)collectionView willDisplayNodeForItemAtIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + + + + + + +
collectionView

The sender.

indexPath

The index path of the item that will be displayed.

+
+ + + + + + + +
+

Discussion

+

Warning: AsyncDisplayKit processes collection view edits asynchronously. The index path +passed into this method may not correspond to the same item in your data source +if your data source has been updated since the last edit was processed.

+ +

This method is deprecated. Use @c collectionView:willDisplayNode:forItemAtIndexPath: instead.

+
+ + + + + + + +
+

Declared In

+

ASCollectionNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASCollectionViewDelegateFlowLayout.html b/docs/appledoc/Protocols/ASCollectionViewDelegateFlowLayout.html new file mode 100755 index 00000000..2185f480 --- /dev/null +++ b/docs/appledoc/Protocols/ASCollectionViewDelegateFlowLayout.html @@ -0,0 +1,286 @@ + + + + + + ASCollectionViewDelegateFlowLayout Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASCollectionViewDelegateFlowLayout Protocol Reference

+ + +
+ + + + + + + +
Conforms toASCollectionDelegate
Declared inASCollectionView.h
+ + + + +
+ +

Overview

+

Defines methods that let you coordinate with a UICollectionViewFlowLayout in combination with an ASCollectionView.

+
+ + + + + +
+ + + + + + +
+
+ +

– collectionView:layout:insetForSectionAtIndex: +

+ +
+
+ +
+ + +
+

This method is deprecated and does nothing from 1.9.7 and up +Previously it applies the section inset to every cells within the corresponding section. +The expected behavior is to apply the section inset to the whole section rather than +shrinking each cell individually. +If you want this behavior, you can integrate your insets calculation into +constrainedSizeForNodeAtIndexPath +please file a github issue if you would like this to be restored.

+
+ + + +
- (UIEdgeInsets)collectionView:(ASCollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section
+ + + + + + + + + +
+

Discussion

+

This method is deprecated and does nothing from 1.9.7 and up +Previously it applies the section inset to every cells within the corresponding section. +The expected behavior is to apply the section inset to the whole section rather than +shrinking each cell individually. +If you want this behavior, you can integrate your insets calculation into +constrainedSizeForNodeAtIndexPath +please file a github issue if you would like this to be restored.

+
+ + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– collectionView:layout:referenceSizeForHeaderInSection: +

+ +
+
+ +
+ + +
+

Asks the delegate for the size of the header in the specified section.

+
+ + + +
- (CGSize)collectionView:(ASCollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+ +

– collectionView:layout:referenceSizeForFooterInSection: +

+ +
+
+ +
+ + +
+

Asks the delegate for the size of the footer in the specified section.

+
+ + + +
- (CGSize)collectionView:(ASCollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASCollectionView.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASCollectionViewLayoutFacilitatorProtocol.html b/docs/appledoc/Protocols/ASCollectionViewLayoutFacilitatorProtocol.html new file mode 100755 index 00000000..946ec7bd --- /dev/null +++ b/docs/appledoc/Protocols/ASCollectionViewLayoutFacilitatorProtocol.html @@ -0,0 +1,308 @@ + + + + + + ASCollectionViewLayoutFacilitatorProtocol Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASCollectionViewLayoutFacilitatorProtocol Protocol Reference

+ + +
+ + + + + + + +
Conforms toNSObject
Declared inASCollectionViewLayoutFacilitatorProtocol.h
+ + + + +
+ +

Overview

+

This facilitator protocol is intended to help Layout to better +gel with the CollectionView

+
+ + + + + +
+ + + + + + +
+
+ +

– collectionViewWillEditCellsAtIndexPaths:batched: +required method

+ +
+
+ +
+ + +
+

Inform that the collectionView is editing the cells at a list of indexPaths

+
+ + + +
- (void)collectionViewWillEditCellsAtIndexPaths:(NSArray *)indexPaths batched:(BOOL)isBatched
+ + + +
+

Parameters

+ + + + + + + + + + + + +
indexPaths

an array of NSIndexPath objects of cells being/will be edited.

isBatched

indicates whether the editing operation will be batched by the collectionView

+ +

NOTE: when isBatched, used in combination with -collectionViewWillPerformBatchUpdates

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASCollectionViewLayoutFacilitatorProtocol.h

+
+ + +
+
+
+ +

– collectionViewWillEditSectionsAtIndexSet:batched: +required method

+ +
+
+ +
+ + +
+

Inform that the collectionView is editing the sections at a set of indexes

+
+ + + +
- (void)collectionViewWillEditSectionsAtIndexSet:(NSIndexSet *)indexes batched:(BOOL)batched
+ + + +
+

Parameters

+ + + + + + + + + + + + +
indexes

an NSIndexSet of section indexes being/will be edited.

batched

indicates whether the editing operation will be batched by the collectionView

+ +

NOTE: when batched, used in combination with -collectionViewWillPerformBatchUpdates

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASCollectionViewLayoutFacilitatorProtocol.h

+
+ + +
+
+
+ +

– collectionViewWillPerformBatchUpdates +required method

+ +
+
+ +
+ + +
+

Informs the delegate that the collectionView is about to call performBatchUpdates

+
+ + + +
- (void)collectionViewWillPerformBatchUpdates
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASCollectionViewLayoutFacilitatorProtocol.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASCommonCollectionDataSource.html b/docs/appledoc/Protocols/ASCommonCollectionDataSource.html new file mode 100755 index 00000000..0fef7a77 --- /dev/null +++ b/docs/appledoc/Protocols/ASCommonCollectionDataSource.html @@ -0,0 +1,121 @@ + + + + + + ASCommonCollectionDataSource Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASCommonCollectionDataSource Protocol Reference

+ + +
+ + + + + + + +
Conforms toNSObject
Declared inASCollectionViewProtocols.h
+ + + + +
+ +

Overview

+

This is a subset of UICollectionViewDataSource.

+
+ + + + + + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASCommonCollectionDelegate.html b/docs/appledoc/Protocols/ASCommonCollectionDelegate.html new file mode 100755 index 00000000..8901487e --- /dev/null +++ b/docs/appledoc/Protocols/ASCommonCollectionDelegate.html @@ -0,0 +1,121 @@ + + + + + + ASCommonCollectionDelegate Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASCommonCollectionDelegate Protocol Reference

+ + +
+ + + + + + + +
Conforms toNSObject
UIScrollViewDelegate
Declared inASCollectionViewProtocols.h
+ + + + +
+ +

Overview

+

This is a subset of UICollectionViewDelegate.

+
+ + + + + + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASCommonTableDataSource.html b/docs/appledoc/Protocols/ASCommonTableDataSource.html new file mode 100755 index 00000000..9068e3ec --- /dev/null +++ b/docs/appledoc/Protocols/ASCommonTableDataSource.html @@ -0,0 +1,121 @@ + + + + + + ASCommonTableDataSource Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASCommonTableDataSource Protocol Reference

+ + +
+ + + + + + + +
Conforms toNSObject
Declared inASTableViewProtocols.h
+ + + + +
+ +

Overview

+

This is a subset of UITableViewDataSource.

+
+ + + + + + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASCommonTableViewDelegate.html b/docs/appledoc/Protocols/ASCommonTableViewDelegate.html new file mode 100755 index 00000000..4032159d --- /dev/null +++ b/docs/appledoc/Protocols/ASCommonTableViewDelegate.html @@ -0,0 +1,121 @@ + + + + + + ASCommonTableViewDelegate Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASCommonTableViewDelegate Protocol Reference

+ + +
+ + + + + + + +
Conforms toNSObject
UIScrollViewDelegate
Declared inASTableViewProtocols.h
+ + + + +
+ +

Overview

+

This is a subset of UITableViewDelegate.

+
+ + + + + + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASContextTransitioning.html b/docs/appledoc/Protocols/ASContextTransitioning.html new file mode 100755 index 00000000..dde53dd1 --- /dev/null +++ b/docs/appledoc/Protocols/ASContextTransitioning.html @@ -0,0 +1,532 @@ + + + + + + ASContextTransitioning Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASContextTransitioning Protocol Reference

+ + +
+ + + + + + + +
Conforms toNSObject
Declared inASContextTransitioning.h
+ + + + + + +
+ + + + + + +
+
+ +

– isAnimated +required method

+ +
+
+ +
+ + +
+

Defines if the given transition is animated

+
+ + + +
- (BOOL)isAnimated
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASContextTransitioning.h

+
+ + +
+
+
+ +

– layoutForKey: +required method

+ +
+
+ +
+ + +
+

Retrieve either the “from” or “to” layout

+
+ + + +
- (nullable ASLayout *)layoutForKey:(NSString *)key
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASContextTransitioning.h

+
+ + +
+
+
+ +

– constrainedSizeForKey: +required method

+ +
+
+ +
+ + +
+

Retrieve either the “from” or “to” constrainedSize

+
+ + + +
- (ASSizeRange)constrainedSizeForKey:(NSString *)key
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASContextTransitioning.h

+
+ + +
+
+
+ +

– subnodesForKey: +required method

+ +
+
+ +
+ + +
+

Retrieve the subnodes from either the “from” or “to” layout

+
+ + + +
- (NSArray<ASDisplayNode*> *)subnodesForKey:(NSString *)key
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASContextTransitioning.h

+
+ + +
+
+
+ +

– insertedSubnodes +required method

+ +
+
+ +
+ + +
+

Subnodes that have been inserted in the layout transition

+
+ + + +
- (NSArray<ASDisplayNode*> *)insertedSubnodes
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASContextTransitioning.h

+
+ + +
+
+
+ +

– removedSubnodes +required method

+ +
+
+ +
+ + +
+

Subnodes that will be removed in the layout transition

+
+ + + +
- (NSArray<ASDisplayNode*> *)removedSubnodes
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASContextTransitioning.h

+
+ + +
+
+
+ +

– initialFrameForNode: +required method

+ +
+
+ +
+ + +
+

The frame for the given node before the transition began.

+
+ + + +
- (CGRect)initialFrameForNode:(ASDisplayNode *)node
+ + + + + + + + + +
+

Discussion

+

Returns CGRectNull if the node was not in the hierarchy before the transition.

+
+ + + + + + + +
+

Declared In

+

ASContextTransitioning.h

+
+ + +
+
+
+ +

– finalFrameForNode: +required method

+ +
+
+ +
+ + +
+

The frame for the given node when the transition completes.

+
+ + + +
- (CGRect)finalFrameForNode:(ASDisplayNode *)node
+ + + + + + + + + +
+

Discussion

+

Returns CGRectNull if the node is no longer in the hierarchy after the transition.

+
+ + + + + + + +
+

Declared In

+

ASContextTransitioning.h

+
+ + +
+
+
+ +

– completeTransition: +required method

+ +
+
+ +
+ + +
+

Invoke this method when the transition is completed in animateLayoutTransition:

+
+ + + +
- (void)completeTransition:(BOOL)didComplete
+ + + + + + + + + +
+

Discussion

+

Passing NO to didComplete will set the original layout as the new layout.

+
+ + + + + + + +
+

Declared In

+

ASContextTransitioning.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASEditableTextNodeDelegate.html b/docs/appledoc/Protocols/ASEditableTextNodeDelegate.html new file mode 100755 index 00000000..9fed8935 --- /dev/null +++ b/docs/appledoc/Protocols/ASEditableTextNodeDelegate.html @@ -0,0 +1,472 @@ + + + + + + ASEditableTextNodeDelegate Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASEditableTextNodeDelegate Protocol Reference

+ + +
+ + + + + + + +
Conforms toNSObject
Declared inASEditableTextNode.h
+ + + + +
+ +

Overview

+

The methods declared by the ASEditableTextNodeDelegate protocol allow the adopting delegate to +respond to notifications such as began and finished editing, selection changed and text updated; +and manage whether a specified text should be replaced.

+
+ + + + + +
+ + + + + + +
+
+ +

– editableTextNodeDidBeginEditing: +

+ +
+
+ +
+ + +
+

Indicates to the delegate that the text node began editing.

+
+ + + +
- (void)editableTextNodeDidBeginEditing:(ASEditableTextNode *)editableTextNode
+ + + +
+

Parameters

+ + + + + + + +
editableTextNode

An editable text node.

+
+ + + + + + + +
+

Discussion

+

The invocation of this method coincides with the keyboard animating to become visible.

+
+ + + + + + + +
+

Declared In

+

ASEditableTextNode.h

+
+ + +
+
+
+ +

– editableTextNode:shouldChangeTextInRange:replacementText: +

+ +
+
+ +
+ + +
+

Asks the delegate whether the specified text should be replaced in the editable text node.

+
+ + + +
- (BOOL)editableTextNode:(ASEditableTextNode *)editableTextNode shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
editableTextNode

An editable text node.

range

The current selection range. If the length of the range is 0, range reflects the current insertion point. If the user presses the Delete key, the length of the range is 1 and an empty string object replaces that single character.

text

The text to insert.

+
+ + + +
+

Return Value

+

The text node calls this method whenever the user types a new character or deletes an existing character. Implementation of this method is optional – the default implementation returns YES.

+
+ + + + + +
+

Discussion

+

YES if the old text should be replaced by the new text; NO if the replacement operation should be aborted.

+
+ + + + + + + +
+

Declared In

+

ASEditableTextNode.h

+
+ + +
+
+
+ +

– editableTextNodeDidChangeSelection:fromSelectedRange:toSelectedRange:dueToEditing: +

+ +
+
+ +
+ + +
+

Indicates to the delegate that the text node’s selection has changed.

+
+ + + +
- (void)editableTextNodeDidChangeSelection:(ASEditableTextNode *)editableTextNode fromSelectedRange:(NSRange)fromSelectedRange toSelectedRange:(NSRange)toSelectedRange dueToEditing:(BOOL)dueToEditing
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
editableTextNode

An editable text node.

fromSelectedRange

The previously selected range.

toSelectedRange

The current selected range. Equivalent to the property.

dueToEditing

YES if the selection change was due to editing; NO otherwise.

+
+ + + + + + + +
+

Discussion

+

You can access the selection of the receiver via .

+
+ + + + + + + +
+

Declared In

+

ASEditableTextNode.h

+
+ + +
+
+
+ +

– editableTextNodeDidUpdateText: +

+ +
+
+ +
+ + +
+

Indicates to the delegate that the text node’s text was updated.

+
+ + + +
- (void)editableTextNodeDidUpdateText:(ASEditableTextNode *)editableTextNode
+ + + +
+

Parameters

+ + + + + + + +
editableTextNode

An editable text node.

+
+ + + + + + + +
+

Discussion

+

This method is called each time the user updated the text node’s text. It is not called for programmatic changes made to the text via the property.

+
+ + + + + + + +
+

Declared In

+

ASEditableTextNode.h

+
+ + +
+
+
+ +

– editableTextNodeDidFinishEditing: +

+ +
+
+ +
+ + +
+

Indicates to the delegate that teh text node has finished editing.

+
+ + + +
- (void)editableTextNodeDidFinishEditing:(ASEditableTextNode *)editableTextNode
+ + + +
+

Parameters

+ + + + + + + +
editableTextNode

An editable text node.

+
+ + + + + + + +
+

Discussion

+

The invocation of this method coincides with the keyboard animating to become hidden.

+
+ + + + + + + +
+

Declared In

+

ASEditableTextNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASLayoutElement.html b/docs/appledoc/Protocols/ASLayoutElement.html new file mode 100755 index 00000000..fc275151 --- /dev/null +++ b/docs/appledoc/Protocols/ASLayoutElement.html @@ -0,0 +1,657 @@ + + + + + + ASLayoutElement Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASLayoutElement Protocol Reference

+ + +
+ + + + + + + +
Conforms toASEnvironment
ASLayoutElementExtensibility
ASLayoutElementPrivate
ASLayoutElementStylability
NSFastEnumeration
Declared inASLayoutElement.h
+ + + + +
+ +

Overview

+

The ASLayoutElement protocol declares a method for measuring the layout of an object. A layout +is defined by an ASLayout return value, and must specify 1) the size (but not position) of the +layoutElement object, and 2) the size and position of all of its immediate child objects. The tree +recursion is driven by parents requesting layouts from their children in order to determine their +size, followed by the parents setting the position of the children once the size is known

+ +

The protocol also implements a “family” of LayoutElement protocols. These protocols contain layout +options that can be used for specific layout specs. For example, ASStackLayoutSpec has options +defining how a layoutElement should shrink or grow based upon available space.

+ +

These layout options are all stored in an ASLayoutOptions class (that is defined in ASLayoutElementPrivate). +Generally you needn’t worry about the layout options class, as the layoutElement protocols allow all direct +access to the options via convenience properties. If you are creating custom layout spec, then you can +extend the backing layout options class to accommodate any new layout options.

+
+ + + + + +
+ + + + + + +
+
+ +

  layoutElementType +required method

+ +
+
+ +
+ + +
+

Returns type of layoutElement

+
+ + + +
@property (nonatomic, assign, readonly) ASLayoutElementType layoutElementType
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASLayoutElement.h

+
+ + +
+
+
+ +

  canLayoutAsynchronous +required method

+ +
+
+ +
+ + +
+

Returns if the layoutElement can be used to layout in an asynchronous way on a background thread.

+
+ + + +
@property (nonatomic, assign, readonly) BOOL canLayoutAsynchronous
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASLayoutElement.h

+
+ + +
+
+
+ +

  style +required method

+ +
+
+ +
+ + +
+

A size constraint that should apply to this ASLayoutElement.

+
+ + + +
@property (nonatomic, assign, readonly) ASLayoutElementStyle *style
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASLayoutElement.h

+
+ + +
+
+
+ +

  debugName +required method

+ +
+
+ +
+ + +
+

Optional name that is printed by ascii art string and displayed in description.

+
+ + + +
@property (nullable, nonatomic, copy) NSString *debugName
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASLayoutElement.h

+
+ + +
+
+
+ +

– layoutThatFits: +required method

+ +
+
+ +
+ + +
+

Asks the node to return a layout based on given size range.

+
+ + + +
- (ASLayout *)layoutThatFits:(ASSizeRange)constrainedSize
+ + + +
+

Parameters

+ + + + + + + +
constrainedSize

The minimum and maximum sizes the receiver should fit in.

+
+ + + +
+

Return Value

+

An ASLayout instance defining the layout of the receiver (and its children, if the box layout model is used).

+
+ + + + + +
+

Discussion

+

Though this method does not set the bounds of the view, it does have side effects–caching both the +constraint and the result.

Warning: Subclasses must not override this; it caches results from -calculateLayoutThatFits:. Calling this method may +be expensive if result is not cached.

+
+ + + + + + + + + +
+

Declared In

+

ASLayoutElement.h

+
+ + +
+
+
+ +

– layoutThatFits:parentSize: +required method

+ +
+
+ +
+ + +
+

Call this on children layoutElements to compute their layouts within your implementation of -calculateLayoutThatFits:.

+
+ + + +
- (ASLayout *)layoutThatFits:(ASSizeRange)constrainedSize parentSize:(CGSize)parentSize
+ + + +
+

Parameters

+ + + + + + + + + + + + +
constrainedSize

Specifies a minimum and maximum size. The receiver must choose a size that is in this range.

parentSize

The parent node’s size. If the parent component does not have a final size in a given dimension, +then it should be passed as ASLayoutElementParentDimensionUndefined (for example, if the parent’s width +depends on the child’s size).

+
+ + + +
+

Return Value

+

An ASLayout instance defining the layout of the receiver (and its children, if the box layout model is used).

+
+ + + + + +
+

Discussion

+

Warning: You may not override this method. Override -calculateLayoutThatFits: instead.

Warning: In almost all cases, prefer the use of ASCalculateLayout in ASLayout

Though this method does not set the bounds of the view, it does have side effects–caching both the +constraint and the result.

+
+ + + + + + + +
+

Declared In

+

ASLayoutElement.h

+
+ + +
+
+
+ +

– calculateLayoutThatFits: +required method

+ +
+
+ +
+ + +
+

Override this method to compute your layoutElement’s layout.

+
+ + + +
- (ASLayout *)calculateLayoutThatFits:(ASSizeRange)constrainedSize
+ + + +
+

Parameters

+ + + + + + + +
constrainedSize

A min and max size. This is computed as described in the description. The ASLayout you +return MUST have a size between these two sizes.

+
+ + + + + + + +
+

Discussion

+

Why do you need to override -calculateLayoutThatFits: instead of -layoutThatFits:parentSize:? +The base implementation of -layoutThatFits:parentSize: does the following for you: +1. First, it uses the parentSize parameter to resolve the nodes’s size (the one assigned to the size property). +2. Then, it intersects the resolved size with the constrainedSize parameter. If the two don’t intersect, +constrainedSize wins. This allows a component to always override its childrens' sizes when computing its layout. +(The analogy for UIView: you might return a certain size from -sizeThatFits:, but a parent view can always override +that size and set your frame to any size.) +3. It caches it result for reuse

+
+ + + + + + + +
+

Declared In

+

ASLayoutElement.h

+
+ + +
+
+
+ +

– calculateLayoutThatFits:restrictedToSize:relativeToParentSize: +required method

+ +
+
+ +
+ + +
+

In certain advanced cases, you may want to override this method. Overriding this method allows you to receive the +layoutElement’s size, parentSize, and constrained size. With these values you could calculate the final constrained size +and call -calculateLayoutThatFits: with the result.

+
+ + + +
- (ASLayout *)calculateLayoutThatFits:(ASSizeRange)constrainedSize restrictedToSize:(ASLayoutElementSize)size relativeToParentSize:(CGSize)parentSize
+ + + + + + + + + +
+

Discussion

+

Warning: Overriding this method should be done VERY rarely.

+
+ + + + + + + +
+

Declared In

+

ASLayoutElement.h

+
+ + +
+
+
+ +

– measureWithSizeRange: +required method

+ +
+
+ +
+ + +
+

Calculate a layout based on given size range. (Deprecated: Deprecated in version 2.0: Use layoutThatFits: or layoutThatFits:parentSize: if used in +ASLayoutSpec subclasses)

+
+ + + +
- (nonnull ASLayout *)measureWithSizeRange:(ASSizeRange)constrainedSize
+ + + +
+

Parameters

+ + + + + + + +
constrainedSize

The minimum and maximum sizes the receiver should fit in.

+
+ + + +
+

Return Value

+

An ASLayout instance defining the layout of the receiver and its children.

+
+ + + + + + + + + + + +
+

Declared In

+

ASLayoutElement.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASLayoutElementAsciiArtProtocol.html b/docs/appledoc/Protocols/ASLayoutElementAsciiArtProtocol.html new file mode 100755 index 00000000..c17c1fe7 --- /dev/null +++ b/docs/appledoc/Protocols/ASLayoutElementAsciiArtProtocol.html @@ -0,0 +1,225 @@ + + + + + + ASLayoutElementAsciiArtProtocol Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASLayoutElementAsciiArtProtocol Protocol Reference

+ + +
+ + + + + + + +
Conforms toNSObject
Declared inASAsciiArtBoxCreator.h
+ + + + + + +
+ + + + + + +
+
+ +

– asciiArtString +required method

+ +
+
+ +
+ + +
+

Returns an ascii-art representation of this object and its children. +For example, an ASInsetSpec may return something like this:

+
+ + + +
- (NSString *)asciiArtString
+ + + + + + + + + +
+

Discussion

+

–ASInsetLayoutSpec–

+ +

| ASTextNode |

+
+ + + + + + + +
+

Declared In

+

ASAsciiArtBoxCreator.h

+
+ + +
+
+
+ +

– asciiArtName +required method

+ +
+
+ +
+ + +
+

returns the name of this object that will display in the ascii art. Usually this can +simply be NSStringFromClass([self class]).

+
+ + + +
- (NSString *)asciiArtName
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASAsciiArtBoxCreator.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASLayoutElementPrivate.html b/docs/appledoc/Protocols/ASLayoutElementPrivate.html new file mode 100755 index 00000000..01647a4d --- /dev/null +++ b/docs/appledoc/Protocols/ASLayoutElementPrivate.html @@ -0,0 +1,243 @@ + + + + + + ASLayoutElementPrivate Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASLayoutElementPrivate Protocol Reference

+ + +
+ + + + + + + +
Conforms toNSObject
Declared inASLayoutElementPrivate.h
+ + + + +
+ +

Overview

+

The base protocol for ASLayoutElement. Generally the methods/properties in this class do not need to be +called by the end user and are only called internally. However, there may be a case where the methods are useful.

+
+ + + + + +
+ + + + + + +
+
+ +

– finalLayoutElement +required method

+ +
+
+ +
+ + +
+

This method can be used to give the user a chance to wrap an ASLayoutElement in an ASLayoutSpec +just before it is added to a parent ASLayoutSpec. For example, if you wanted an ASTextNode that was always +inside of an ASInsetLayoutSpec, you could subclass ASTextNode and implement finalLayoutElement so that it wraps +itself in an inset spec.

+ +

Note that any ASLayoutElement other than self that is returned MUST set isFinalLayoutElement to YES. Make sure +to do this BEFORE adding a child to the ASLayoutElement.

+
+ + + +
- (id<ASLayoutElement>)finalLayoutElement
+ + + + + +
+

Return Value

+

The layoutElement that will be added to the parent layout spec. Defaults to self.

+
+ + + + + + + + + + + +
+

Declared In

+

ASLayoutElementPrivate.h

+
+ + +
+
+
+ +

  isFinalLayoutElement +required method

+ +
+
+ +
+ + +
+

A flag to indicate that this ASLayoutElement was created in finalLayoutElement. This MUST be set to YES +before adding a child to this layoutElement.

+
+ + + +
@property (nonatomic, assign) BOOL isFinalLayoutElement
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASLayoutElementPrivate.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASManagesChildVisibilityDepth.html b/docs/appledoc/Protocols/ASManagesChildVisibilityDepth.html new file mode 100755 index 00000000..817097a2 --- /dev/null +++ b/docs/appledoc/Protocols/ASManagesChildVisibilityDepth.html @@ -0,0 +1,200 @@ + + + + + + ASManagesChildVisibilityDepth Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASManagesChildVisibilityDepth Protocol Reference

+ + +
+ + + + + + + +
Conforms toASVisibilityDepth
Declared inASVisibilityProtocols.h
+ + + + +
+ +

Overview

+

ASManagesChildVisibilityDepth

A protocol which should be implemented by container view controllers to allow proper +propagation of visibility depth

+
+ + + + + +
+ + + + + + +
+
+ +

– visibilityDepthOfChildViewController: +required method

+ +
+
+ +
+ + +
+

Container view controllers should adopt this protocol to indicate that they will manage their child’s +visibilityDepth. For example, ASNavigationController adopts this protocol and manages its childrens visibility +depth.

+ +

If you adopt this protocol, you must also emit visibilityDepthDidChange messages to child view controllers.

+
+ + + +
- (NSInteger)visibilityDepthOfChildViewController:(UIViewController *)childViewController
+ + + +
+

Parameters

+ + + + + + + +
childViewController

Expected to return the visibility depth of the child view controller.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASVisibilityProtocols.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASMultiplexImageNodeDataSource.html b/docs/appledoc/Protocols/ASMultiplexImageNodeDataSource.html new file mode 100755 index 00000000..b979e068 --- /dev/null +++ b/docs/appledoc/Protocols/ASMultiplexImageNodeDataSource.html @@ -0,0 +1,364 @@ + + + + + + ASMultiplexImageNodeDataSource Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASMultiplexImageNodeDataSource Protocol Reference

+ + +
+ + + + + + + +
Conforms toNSObject
Declared inASMultiplexImageNode.h
+ + + + +
+ +

Overview

+

The ASMultiplexImageNodeDataSource protocol is adopted by an object that provides the multiplex image node, +for each image identifier, an image or a URL the image node should load.

+
+ + + + + +
+ + + + + + +
+
+ +

– multiplexImageNode:imageForImageIdentifier: +

+ +
+
+ +
+ + +
+

An image for the specified identifier.

+
+ + + +
- (nullable UIImage *)multiplexImageNode:(ASMultiplexImageNode *)imageNode imageForImageIdentifier:(ASImageIdentifier)imageIdentifier
+ + + +
+

Parameters

+ + + + + + + + + + + + +
imageNode

The sender.

imageIdentifier

The identifier for the image that should be returned.

+
+ + + +
+

Return Value

+

A UIImage corresponding to imageIdentifier, or nil if none is available.

+
+ + + + + +
+

Discussion

+

If the image is already available to the data source, this method should be used in lieu of providing the +URL to the image via -multiplexImageNode:URLForImageIdentifier:.

+
+ + + + + + + +
+

Declared In

+

ASMultiplexImageNode.h

+
+ + +
+
+
+ +

– multiplexImageNode:URLForImageIdentifier: +

+ +
+
+ +
+ + +
+

An image URL for the specified identifier.

+
+ + + +
- (nullable NSURL *)multiplexImageNode:(ASMultiplexImageNode *)imageNode URLForImageIdentifier:(ASImageIdentifier)imageIdentifier
+ + + +
+

Parameters

+ + + + + + + + + + + + +
imageNode

The sender.

imageIdentifier

The identifier for the image that will be downloaded.

+
+ + + +
+

Return Value

+

An NSURL for the image identified by imageIdentifier, or nil if none is available.

+
+ + + + + +
+

Discussion

+

Supported URLs include HTTP, HTTPS, AssetsLibrary, and FTP URLs as well as Photos framework URLs (see note).

+ +

If the image is already available to the data source, it should be provided via [ASMultiplexImageNodeDataSource multiplexImageNode:imageForImageIdentifier:] instead.

+
+ + + + + +
+

See Also

+
    + +
  • [NSURL URLWithAssetLocalIdentifier:targetSize:contentMode:options:] below.

  • + +
+
+ + + +
+

Declared In

+

ASMultiplexImageNode.h

+
+ + +
+
+
+ +

– multiplexImageNode:assetForLocalIdentifier: +

+ +
+
+ +
+ + +
+

A PHAsset for the specific asset local identifier

+
+ + + +
- (nullable PHAsset *)multiplexImageNode:(ASMultiplexImageNode *)imageNode assetForLocalIdentifier:(NSString *)assetLocalIdentifier
+ + + +
+

Parameters

+ + + + + + + + + + + + +
imageNode

The sender.

assetLocalIdentifier

The local identifier for a PHAsset that this image node is loading.

+
+ + + +
+

Return Value

+

A PHAsset corresponding to assetLocalIdentifier, or nil if none is available.

+
+ + + + + +
+

Discussion

+

This optional method can improve image performance if your data source already has the PHAsset available. +If this method is not implemented, or returns nil, the image node will request the asset from the Photos framework.

Note: This method may be called from any thread.

+
+ + + + + + + +
+

Declared In

+

ASMultiplexImageNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASMultiplexImageNodeDelegate.html b/docs/appledoc/Protocols/ASMultiplexImageNodeDelegate.html new file mode 100755 index 00000000..100ffd60 --- /dev/null +++ b/docs/appledoc/Protocols/ASMultiplexImageNodeDelegate.html @@ -0,0 +1,550 @@ + + + + + + ASMultiplexImageNodeDelegate Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASMultiplexImageNodeDelegate Protocol Reference

+ + +
+ + + + + + + +
Conforms toNSObject
Declared inASMultiplexImageNode.h
+ + + + +
+ +

Overview

+

The methods declared by the ASMultiplexImageNodeDelegate protocol allow the adopting delegate to respond to +notifications such as began, progressed and finished downloading, updated and displayed an image.

+
+ + + + + +
+ + + + + + +
+
+ +

– multiplexImageNode:didStartDownloadOfImageWithIdentifier: +

+ +
+
+ +
+ + +
+

Notification that the image node began downloading an image.

+
+ + + +
- (void)multiplexImageNode:(ASMultiplexImageNode *)imageNode didStartDownloadOfImageWithIdentifier:(id)imageIdentifier
+ + + +
+

Parameters

+ + + + + + + + + + + + +
imageNode

The sender.

imageIdentifier

The identifier for the image that is downloading.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASMultiplexImageNode.h

+
+ + +
+
+
+ +

– multiplexImageNode:didUpdateDownloadProgress:forImageWithIdentifier: +

+ +
+
+ +
+ + +
+

Notification that the image node’s download progressed.

+
+ + + +
- (void)multiplexImageNode:(ASMultiplexImageNode *)imageNode didUpdateDownloadProgress:(CGFloat)downloadProgress forImageWithIdentifier:(ASImageIdentifier)imageIdentifier
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
imageNode

The sender.

downloadProgress

The progress of the download. Value is between 0.0 and 1.0.

imageIdentifier

The identifier for the image that is downloading.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASMultiplexImageNode.h

+
+ + +
+
+
+ +

– multiplexImageNode:didFinishDownloadingImageWithIdentifier:error: +

+ +
+
+ +
+ + +
+

Notification that the image node’s download has finished.

+
+ + + +
- (void)multiplexImageNode:(ASMultiplexImageNode *)imageNode didFinishDownloadingImageWithIdentifier:(ASImageIdentifier)imageIdentifier error:(nullable NSError *)error
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
imageNode

The sender.

imageIdentifier

The identifier for the image that finished downloading.

error

The error that occurred while downloading, if one occurred; nil otherwise.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASMultiplexImageNode.h

+
+ + +
+
+
+ +

– multiplexImageNode:didUpdateImage:withIdentifier:fromImage:withIdentifier: +

+ +
+
+ +
+ + +
+

Notification that the image node’s image was updated.

+
+ + + +
- (void)multiplexImageNode:(ASMultiplexImageNode *)imageNode didUpdateImage:(nullable UIImage *)image withIdentifier:(nullable ASImageIdentifier)imageIdentifier fromImage:(nullable UIImage *)previousImage withIdentifier:(nullable ASImageIdentifier)previousImageIdentifier
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
imageNode

The sender.

image

The new image, ready for display.

imageIdentifier

The identifier for image.

previousImage

The old, previously-loaded image.

previousImageIdentifier

The identifier for previousImage.

+
+ + + + + + + +
+

Discussion

+

Note: This method does not indicate that image has been displayed.

+
+ + + + + + + + + +
+

Declared In

+

ASMultiplexImageNode.h

+
+ + +
+
+
+ +

– multiplexImageNode:didDisplayUpdatedImage:withIdentifier: +

+ +
+
+ +
+ + +
+

Notification that the image node displayed a new image.

+
+ + + +
- (void)multiplexImageNode:(ASMultiplexImageNode *)imageNode didDisplayUpdatedImage:(nullable UIImage *)image withIdentifier:(nullable ASImageIdentifier)imageIdentifier
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
imageNode

The sender.

image

The new image, now being displayed.

imageIdentifier

The identifier for image.

+
+ + + + + + + +
+

Discussion

+

This method is only called when image changes, and not on subsequent redisplays of the same image.

+
+ + + + + + + +
+

Declared In

+

ASMultiplexImageNode.h

+
+ + +
+
+
+ +

– multiplexImageNodeDidFinishDisplay: +

+ +
+
+ +
+ + +
+

Notification that the image node finished displaying an image.

+
+ + + +
- (void)multiplexImageNodeDidFinishDisplay:(ASMultiplexImageNode *)imageNode
+ + + +
+

Parameters

+ + + + + + + +
imageNode

The sender.

+
+ + + + + + + +
+

Discussion

+

This method is called every time an image is displayed, whether or not it has changed.

+
+ + + + + + + +
+

Declared In

+

ASMultiplexImageNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASNetworkImageNodeDelegate.html b/docs/appledoc/Protocols/ASNetworkImageNodeDelegate.html new file mode 100755 index 00000000..993331c3 --- /dev/null +++ b/docs/appledoc/Protocols/ASNetworkImageNodeDelegate.html @@ -0,0 +1,386 @@ + + + + + + ASNetworkImageNodeDelegate Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASNetworkImageNodeDelegate Protocol Reference

+ + +
+ + + + + + + +
Conforms toNSObject
Declared inASNetworkImageNode.h
+ + + + +
+ +

Overview

+

The methods declared by the ASNetworkImageNodeDelegate protocol allow the adopting delegate to respond to +notifications such as finished decoding and downloading an image.

+
+ + + + + +
+ + + + + + +
+
+ +

– imageNode:didLoadImage: +

+ +
+
+ +
+ + +
+

Notification that the image node finished downloading an image.

+
+ + + +
- (void)imageNode:(ASNetworkImageNode *)imageNode didLoadImage:(UIImage *)image
+ + + +
+

Parameters

+ + + + + + + + + + + + +
imageNode

The sender.

image

The newly-loaded image.

+
+ + + + + + + +
+

Discussion

+

Called on a background queue.

+
+ + + + + + + +
+

Declared In

+

ASNetworkImageNode.h

+
+ + +
+
+
+ +

– imageNodeDidStartFetchingData: +

+ +
+
+ +
+ + +
+

Notification that the image node started to load

+
+ + + +
- (void)imageNodeDidStartFetchingData:(ASNetworkImageNode *)imageNode
+ + + +
+

Parameters

+ + + + + + + +
imageNode

The sender.

+
+ + + + + + + +
+

Discussion

+

Called on a background queue.

+
+ + + + + + + +
+

Declared In

+

ASNetworkImageNode.h

+
+ + +
+
+
+ +

– imageNode:didFailWithError: +

+ +
+
+ +
+ + +
+

Notification that the image node failed to download the image.

+
+ + + +
- (void)imageNode:(ASNetworkImageNode *)imageNode didFailWithError:(NSError *)error
+ + + +
+

Parameters

+ + + + + + + + + + + + +
imageNode

The sender.

error

The error with details.

+
+ + + + + + + +
+

Discussion

+

Called on a background queue.

+
+ + + + + + + +
+

Declared In

+

ASNetworkImageNode.h

+
+ + +
+
+
+ +

– imageNodeDidFinishDecoding: +

+ +
+
+ +
+ + +
+

Notification that the image node finished decoding an image.

+
+ + + +
- (void)imageNodeDidFinishDecoding:(ASNetworkImageNode *)imageNode
+ + + +
+

Parameters

+ + + + + + + +
imageNode

The sender.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASNetworkImageNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASPagerDataSource.html b/docs/appledoc/Protocols/ASPagerDataSource.html new file mode 100755 index 00000000..6cea3bee --- /dev/null +++ b/docs/appledoc/Protocols/ASPagerDataSource.html @@ -0,0 +1,325 @@ + + + + + + ASPagerDataSource Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASPagerDataSource Protocol Reference

+ + +
+ + + + + + + +
Conforms toNSObject
Declared inASPagerNode.h
+ + + + + + +
+ + + + + + +
+
+ +

– numberOfPagesInPagerNode: +required method

+ +
+
+ +
+ + +
+

This method replaces -collectionView:numberOfItemsInSection:

+
+ + + +
- (NSInteger)numberOfPagesInPagerNode:(ASPagerNode *)pagerNode
+ + + +
+

Parameters

+ + + + + + + +
pagerNode

The sender.

+
+ + + +
+

Return Value

+

The total number of pages that can display in the pagerNode.

+
+ + + + + + + + + + + +
+

Declared In

+

ASPagerNode.h

+
+ + +
+
+
+ +

– pagerNode:nodeAtIndex: +

+ +
+
+ +
+ + +
+

This method replaces -collectionView:nodeForItemAtIndexPath:

+
+ + + +
- (ASCellNode *)pagerNode:(ASPagerNode *)pagerNode nodeAtIndex:(NSInteger)index
+ + + +
+

Parameters

+ + + + + + + + + + + + +
pagerNode

The sender.

index

The index of the requested node.

+
+ + + +
+

Return Value

+

a node for display at this index. This will be called on the main thread and should +not implement reuse (it will be called once per row). Unlike UICollectionView’s version, +this method is not called when the row is about to display.

+
+ + + + + + + + + + + +
+

Declared In

+

ASPagerNode.h

+
+ + +
+
+
+ +

– pagerNode:nodeBlockAtIndex: +

+ +
+
+ +
+ + +
+

This method replaces -collectionView:nodeBlockForItemAtIndexPath: +This method takes precedence over pagerNode:nodeAtIndex: if implemented.

+
+ + + +
- (ASCellNodeBlock)pagerNode:(ASPagerNode *)pagerNode nodeBlockAtIndex:(NSInteger)index
+ + + +
+

Parameters

+ + + + + + + + + + + + +
pagerNode

The sender.

index

The index of the requested node.

+
+ + + +
+

Return Value

+

a block that creates the node for display at this index. +Must be thread-safe (can be called on the main thread or a background +queue) and should not implement reuse (it will be called once per row).

+
+ + + + + + + + + + + +
+

Declared In

+

ASPagerNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASPagerDelegate.html b/docs/appledoc/Protocols/ASPagerDelegate.html new file mode 100755 index 00000000..6f7e47f1 --- /dev/null +++ b/docs/appledoc/Protocols/ASPagerDelegate.html @@ -0,0 +1,195 @@ + + + + + + ASPagerDelegate Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASPagerDelegate Protocol Reference

+ + +
+ + + + + + + +
Conforms toASCollectionDelegate
Declared inASPagerNode.h
+ + + + + + +
+ + + + + + +
+
+ +

– pagerNode:constrainedSizeForNodeAtIndex: +

+ +
+
+ +
+ + +
+

Provides the constrained size range for measuring the node at the index.

+
+ + + +
- (ASSizeRange)pagerNode:(ASPagerNode *)pagerNode constrainedSizeForNodeAtIndex:(NSInteger)index
+ + + +
+

Parameters

+ + + + + + + + + + + + +
pagerNode

The sender.

index

The index of the node.

+
+ + + +
+

Return Value

+

A constrained size range for layout the node at this index.

+
+ + + + + + + + + + + +
+

Declared In

+

ASPagerNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASRangeControllerDataSource.html b/docs/appledoc/Protocols/ASRangeControllerDataSource.html new file mode 100755 index 00000000..2aa1157e --- /dev/null +++ b/docs/appledoc/Protocols/ASRangeControllerDataSource.html @@ -0,0 +1,385 @@ + + + + + + ASRangeControllerDataSource Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASRangeControllerDataSource Protocol Reference

+ + +
+ + + + + + + +
Conforms toNSObject
Declared inASRangeController.h
+ + + + +
+ +

Overview

+

Data source for ASRangeController.

+ +

Allows the range controller to perform external queries on the range. +Ex. range nodes, visible index paths, and viewport size.

+
+ + + + + +
+ + + + + + +
+
+ +

– visibleNodeIndexPathsForRangeController: +required method

+ +
+
+ +
+ + +
+

Sender.

+
+ + + +
- (NSArray<NSIndexPath*> *)visibleNodeIndexPathsForRangeController:(ASRangeController *)rangeController
+ + + +
+

Parameters

+ + + + + + + +
rangeController

Sender.

+
+ + + +
+

Return Value

+

an array of index paths corresponding to the nodes currently visible onscreen (i.e., the visible range).

+
+ + + + + + + + + + + +
+

Declared In

+

ASRangeController.h

+
+ + +
+
+
+ +

– scrollDirectionForRangeController: +required method

+ +
+
+ +
+ + +
+

Sender.

+
+ + + +
- (ASScrollDirection)scrollDirectionForRangeController:(ASRangeController *)rangeController
+ + + +
+

Parameters

+ + + + + + + +
rangeController

Sender.

+
+ + + +
+

Return Value

+

the current scroll direction of the view using this range controller.

+
+ + + + + + + + + + + +
+

Declared In

+

ASRangeController.h

+
+ + +
+
+
+ +

– viewportSizeForRangeController: +required method

+ +
+
+ +
+ + +
+

Sender.

+
+ + + +
- (CGSize)viewportSizeForRangeController:(ASRangeController *)rangeController
+ + + +
+

Parameters

+ + + + + + + +
rangeController

Sender.

+
+ + + +
+

Return Value

+

the receiver’s viewport size (i.e., the screen space occupied by the visible range).

+
+ + + + + + + + + + + +
+

Declared In

+

ASRangeController.h

+
+ + +
+
+
+ +

– interfaceStateForRangeController: +required method

+ +
+
+ +
+ + +
+

Sender.

+
+ + + +
- (ASInterfaceState)interfaceStateForRangeController:(ASRangeController *)rangeController
+ + + +
+

Parameters

+ + + + + + + +
rangeController

Sender.

+
+ + + +
+

Return Value

+

the ASInterfaceState of the node that this controller is powering. This allows nested range controllers +to collaborate with one another, as an outer controller may set bits in .interfaceState such as Visible. +If this controller is an orthogonally scrolling element, it waits until it is visible to preload outside the viewport.

+
+ + + + + + + + + + + +
+

Declared In

+

ASRangeController.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASRangeControllerDelegate.html b/docs/appledoc/Protocols/ASRangeControllerDelegate.html new file mode 100755 index 00000000..e97a5829 --- /dev/null +++ b/docs/appledoc/Protocols/ASRangeControllerDelegate.html @@ -0,0 +1,585 @@ + + + + + + ASRangeControllerDelegate Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASRangeControllerDelegate Protocol Reference

+ + +
+ + + + + + + +
Conforms toNSObject
Declared inASRangeController.h
+ + + + +
+ +

Overview

+

Delegate for ASRangeController.

+
+ + + + + +
+ + + + + + +
+
+ +

– didBeginUpdatesInRangeController: +required method

+ +
+
+ +
+ + +
+

Begin updates.

+
+ + + +
- (void)didBeginUpdatesInRangeController:(ASRangeController *)rangeController
+ + + +
+

Parameters

+ + + + + + + +
rangeController

Sender.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASRangeController.h

+
+ + +
+
+
+ +

– rangeController:didEndUpdatesAnimated:completion: +required method

+ +
+
+ +
+ + +
+

End updates.

+
+ + + +
- (void)rangeController:(ASRangeController *)rangeController didEndUpdatesAnimated:(BOOL)animated completion:(void ( ^ ) ( BOOL ))completion
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
rangeController

Sender.

animated

NO if all animations are disabled. YES otherwise.

completion

Completion block.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASRangeController.h

+
+ + +
+
+
+ +

– didCompleteUpdatesInRangeController: +required method

+ +
+
+ +
+ + +
+

Completed updates to cell node addition and removal.

+
+ + + +
- (void)didCompleteUpdatesInRangeController:(ASRangeController *)rangeController
+ + + +
+

Parameters

+ + + + + + + +
rangeController

Sender.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASRangeController.h

+
+ + +
+
+
+ +

– rangeController:didInsertNodes:atIndexPaths:withAnimationOptions: +required method

+ +
+
+ +
+ + +
+

Called for nodes insertion.

+
+ + + +
- (void)rangeController:(ASRangeController *)rangeController didInsertNodes:(NSArray<ASCellNode*> *)nodes atIndexPaths:(NSArray<NSIndexPath*> *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
rangeController

Sender.

nodes

Inserted nodes.

indexPaths

Index path of inserted nodes.

animationOptions

Animation options. See ASDataControllerAnimationOptions.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASRangeController.h

+
+ + +
+
+
+ +

– rangeController:didDeleteNodes:atIndexPaths:withAnimationOptions: +required method

+ +
+
+ +
+ + +
+

Called for nodes deletion.

+
+ + + +
- (void)rangeController:(ASRangeController *)rangeController didDeleteNodes:(NSArray<ASCellNode*> *)nodes atIndexPaths:(NSArray<NSIndexPath*> *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
rangeController

Sender.

nodes

Deleted nodes.

indexPaths

Index path of deleted nodes.

animationOptions

Animation options. See ASDataControllerAnimationOptions.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASRangeController.h

+
+ + +
+
+
+ +

– rangeController:didInsertSectionsAtIndexSet:withAnimationOptions: +required method

+ +
+
+ +
+ + +
+

Called for section insertion.

+
+ + + +
- (void)rangeController:(ASRangeController *)rangeController didInsertSectionsAtIndexSet:(NSIndexSet *)indexSet withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
rangeController

Sender.

indexSet

Index set of inserted sections.

animationOptions

Animation options. See ASDataControllerAnimationOptions.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASRangeController.h

+
+ + +
+
+
+ +

– rangeController:didDeleteSectionsAtIndexSet:withAnimationOptions: +required method

+ +
+
+ +
+ + +
+

Called for section deletion.

+
+ + + +
- (void)rangeController:(ASRangeController *)rangeController didDeleteSectionsAtIndexSet:(NSIndexSet *)indexSet withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
rangeController

Sender.

indexSet

Index set of deleted sections.

animationOptions

Animation options. See ASDataControllerAnimationOptions.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASRangeController.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASStackLayoutElement.html b/docs/appledoc/Protocols/ASStackLayoutElement.html new file mode 100755 index 00000000..97a44dd6 --- /dev/null +++ b/docs/appledoc/Protocols/ASStackLayoutElement.html @@ -0,0 +1,493 @@ + + + + + + ASStackLayoutElement Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASStackLayoutElement Protocol Reference

+ + +
+ + + + + + + +
Conforms toNSObject
Declared inASStackLayoutElement.h
+ + + + +
+ +

Overview

+

Layout options that can be defined for an ASLayoutElement being added to a ASStackLayoutSpec.

+
+ + + + + +
+ + + + + + +
+
+ +

  spacingBefore +required method

+ +
+
+ +
+ + +
+

Additional space to place before this object in the stacking direction. +Used when attached to a stack layout.

+
+ + + +
@property (nonatomic, readwrite) CGFloat spacingBefore
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASStackLayoutElement.h

+
+ + +
+
+
+ +

  spacingAfter +required method

+ +
+
+ +
+ + +
+

Additional space to place after this object in the stacking direction. +Used when attached to a stack layout.

+
+ + + +
@property (nonatomic, readwrite) CGFloat spacingAfter
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASStackLayoutElement.h

+
+ + +
+
+
+ +

  flexGrow +required method

+ +
+
+ +
+ + +
+

If the sum of childrens' stack dimensions is less than the minimum size, how much should this component grow? +This value represents the “flex grow factor” and determines how much this component should grow in relation to any +other flexible children.

+
+ + + +
@property (nonatomic, readwrite) CGFloat flexGrow
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASStackLayoutElement.h

+
+ + +
+
+
+ +

  flexShrink +required method

+ +
+
+ +
+ + +
+

If the sum of childrens' stack dimensions is greater than the maximum size, how much should this component shrink? +This value represents the “flex shrink factor” and determines how much this component should shink in relation to +other flexible children.

+
+ + + +
@property (nonatomic, readwrite) CGFloat flexShrink
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASStackLayoutElement.h

+
+ + +
+
+
+ +

  flexBasis +required method

+ +
+
+ +
+ + +
+

Specifies the initial size in the stack dimension for this object. +Default to ASDimensionAuto +Used when attached to a stack layout.

+
+ + + +
@property (nonatomic, readwrite) ASDimension flexBasis
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASStackLayoutElement.h

+
+ + +
+
+
+ +

  alignSelf +required method

+ +
+
+ +
+ + +
+

Orientation of the object along cross axis, overriding alignItems +Used when attached to a stack layout.

+
+ + + +
@property (nonatomic, readwrite) ASStackLayoutAlignSelf alignSelf
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASStackLayoutElement.h

+
+ + +
+
+
+ +

  ascender +required method

+ +
+
+ +
+ + +
+

Used for baseline alignment. The distance from the top of the object to its baseline.

+
+ + + +
@property (nonatomic, readwrite) CGFloat ascender
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASStackLayoutElement.h

+
+ + +
+
+
+ +

  descender +required method

+ +
+
+ +
+ + +
+

Used for baseline alignment. The distance from the baseline of the object to its bottom.

+
+ + + +
@property (nonatomic, readwrite) CGFloat descender
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASStackLayoutElement.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASTableDataSource.html b/docs/appledoc/Protocols/ASTableDataSource.html new file mode 100755 index 00000000..c6c4cc40 --- /dev/null +++ b/docs/appledoc/Protocols/ASTableDataSource.html @@ -0,0 +1,614 @@ + + + + + + ASTableDataSource Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASTableDataSource Protocol Reference

+ + +
+ + + + + + + +
Conforms toASCommonTableDataSource
NSObject
Declared inASTableNode.h
+ + + + +
+ +

Overview

+

This is a node-based UITableViewDataSource.

+
+ + + + + +
+ + + + + + +
+
+ +

– numberOfSectionsInTableNode: +

+ +
+
+ +
+ + +
+

Asks the data source for the number of sections in the table node.

+
+ + + +
- (NSInteger)numberOfSectionsInTableNode:(ASTableNode *)tableNode
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– tableNode:numberOfRowsInSection: +

+ +
+
+ +
+ + +
+

Asks the data source for the number of rows in the given section of the table node.

+
+ + + +
- (NSInteger)tableNode:(ASTableNode *)tableNode numberOfRowsInSection:(NSInteger)section
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– tableNode:nodeBlockForRowAtIndexPath: +

+ +
+
+ +
+ + +
+

Asks the data source for a block to create a node to represent the row at the given index path. +The block will be run by the table node concurrently in the background before the row is inserted +into the table view.

+
+ + + +
- (ASCellNodeBlock)tableNode:(ASTableNode *)tableNode nodeBlockForRowAtIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + + + + + + +
tableNode

The sender.

indexPath

The index path of the row.

+
+ + + +
+

Return Value

+

a block that creates the node for display at this indexpath. +Must be thread-safe (can be called on the main thread or a background +queue) and should not implement reuse (it will be called once per row).

+
+ + + + + +
+

Discussion

+

Note: This method takes precedence over tableNode:nodeForRowAtIndexPath: if implemented.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– tableNode:nodeForRowAtIndexPath: +

+ +
+
+ +
+ + +
+

Asks the data source for a node to represent the row at the given index path.

+
+ + + +
- (ASCellNode *)tableNode:(ASTableNode *)tableNode nodeForRowAtIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + + + + + + +
tableNode

The sender.

indexPath

The index path of the row.

+
+ + + +
+

Return Value

+

a node to display for this row. This will be called on the main thread and should not implement reuse (it will be called once per row). Unlike UITableView’s version, this method +is not called when the row is about to display.

+
+ + + + + + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– tableView:nodeForRowAtIndexPath: +

+ +
+
+ +
+ + +
+

Similar to -tableView:cellForRowAtIndexPath:.

+
+ + + +
- (ASCellNode *)tableView:(ASTableView *)tableView nodeForRowAtIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + + + + + + +
indexPath

The index path of the requested node.

tableNode

The sender.

+
+ + + +
+

Return Value

+

a node for display at this indexpath. This will be called on the main thread and should not implement reuse (it will be called once per row). Unlike UITableView’s version, this method +is not called when the row is about to display.

+
+ + + + + + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– tableView:nodeBlockForRowAtIndexPath: +

+ +
+
+ +
+ + +
+

Similar to -tableView:nodeForRowAtIndexPath: +This method takes precedence over tableView:nodeForRowAtIndexPath: if implemented.

+
+ + + +
- (ASCellNodeBlock)tableView:(ASTableView *)tableView nodeBlockForRowAtIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + + + + + + +
tableView

The sender.

indexPath

The index path of the requested node.

+
+ + + +
+

Return Value

+

a block that creates the node for display at this indexpath. +Must be thread-safe (can be called on the main thread or a background +queue) and should not implement reuse (it will be called once per row).

+
+ + + + + + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– tableViewLockDataSource: +

+ +
+
+ +
+ + +
+

Indicator to lock the data source for data fetching in async mode. +We should not update the data source until the data source has been unlocked. Otherwise, it will incur data inconsistency or exception +due to the data access in async mode. (Deprecated: The data source is always accessed on the main thread, and this method will not be called.)

+
+ + + +
- (void)tableViewLockDataSource:(ASTableView *)tableView
+ + + +
+

Parameters

+ + + + + + + +
tableView

The sender.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– tableViewUnlockDataSource: +

+ +
+
+ +
+ + +
+

Indicator to unlock the data source for data fetching in asyn mode. +We should not update the data source until the data source has been unlocked. Otherwise, it will incur data inconsistency or exception +due to the data access in async mode. (Deprecated: The data source is always accessed on the main thread, and this method will not be called.)

+
+ + + +
- (void)tableViewUnlockDataSource:(ASTableView *)tableView
+ + + +
+

Parameters

+ + + + + + + +
tableView

The sender.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASTableDelegate.html b/docs/appledoc/Protocols/ASTableDelegate.html new file mode 100755 index 00000000..993e7cac --- /dev/null +++ b/docs/appledoc/Protocols/ASTableDelegate.html @@ -0,0 +1,758 @@ + + + + + + ASTableDelegate Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASTableDelegate Protocol Reference

+ + +
+ + + + + + + +
Conforms toASCommonTableViewDelegate
NSObject
Declared inASTableNode.h
+ + + + +
+ +

Overview

+

This is a node-based UITableViewDelegate.

+ +

Note that -tableView:heightForRowAtIndexPath: has been removed; instead, your custom ASCellNode subclasses are +responsible for deciding their preferred onscreen height in -calculateSizeThatFits:.

+
+ + + + + +
+ + + + + + +
+
+ +

– tableNode:constrainedSizeForRowAtIndexPath: +

+ +
+
+ +
+ + +
+

Provides the constrained size range for measuring the row at the index path. +Note: the widths in the returned size range are ignored!

+
+ + + +
- (ASSizeRange)tableNode:(ASTableNode *)tableNode constrainedSizeForRowAtIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + + + + + + +
tableNode

The sender.

indexPath

The index path of the node.

+
+ + + +
+

Return Value

+

A constrained size range for layout the node at this index path.

+
+ + + + + + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– tableNode:willBeginBatchFetchWithContext: +

+ +
+
+ +
+ + +
+

Receive a message that the tableView is near the end of its data set and more data should be fetched if necessary.

+
+ + + +
- (void)tableNode:(ASTableNode *)tableNode willBeginBatchFetchWithContext:(ASBatchContext *)context
+ + + +
+

Parameters

+ + + + + + + + + + + + +
context

A context object that must be notified when the batch fetch is completed.

tableView

The sender.

+
+ + + + + + + +
+

Discussion

+

You must eventually call -completeBatchFetching: with an argument of YES in order to receive future +notifications to do batch fetches. This method is called on a background queue.

+ +

ASTableView currently only supports batch events for tail loads. If you require a head load, consider implementing a +UIRefreshControl.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– shouldBatchFetchForTableNode: +

+ +
+
+ +
+ + +
+

Tell the tableView if batch fetching should begin.

+
+ + + +
- (BOOL)shouldBatchFetchForTableNode:(ASTableNode *)tableNode
+ + + +
+

Parameters

+ + + + + + + +
tableView

The sender.

+
+ + + + + + + +
+

Discussion

+

Use this method to conditionally fetch batches. Example use cases are: limiting the total number of +objects that can be fetched or no network connection.

+ +

If not implemented, the tableView assumes that it should notify its asyncDelegate when batch fetching +should occur.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– tableView:willDisplayNode:forRowAtIndexPath: +

+ +
+
+ +
+ + +
+

Informs the delegate that the table view will add the given node +at the given index path to the view hierarchy.

+
+ + + +
- (void)tableView:(ASTableView *)tableView willDisplayNode:(ASCellNode *)node forRowAtIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
tableView

The sender.

node

The node that will be displayed.

indexPath

The index path of the row that will be displayed.

+
+ + + + + + + +
+

Discussion

+

Warning: AsyncDisplayKit processes table view edits asynchronously. The index path +passed into this method may not correspond to the same item in your data source +if your data source has been updated since the last edit was processed.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– tableView:didEndDisplayingNode:forRowAtIndexPath: +

+ +
+
+ +
+ + +
+

Informs the delegate that the table view did remove the provided node from the view hierarchy. +This may be caused by the node scrolling out of view, or by deleting the row +or its containing section with @c deleteRowsAtIndexPaths:withRowAnimation: or @c deleteSections:withRowAnimation: .

+
+ + + +
- (void)tableView:(ASTableView *)tableView didEndDisplayingNode:(ASCellNode *)node forRowAtIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
tableView

The sender.

node

The node which was removed from the view hierarchy.

indexPath

The index path at which the node was located before the removal.

+
+ + + + + + + +
+

Discussion

+

Warning: AsyncDisplayKit processes table view edits asynchronously. The index path +passed into this method may not correspond to the same item in your data source +if your data source has been updated since the last edit was processed.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– tableView:willBeginBatchFetchWithContext: +

+ +
+
+ +
+ + +
+

Receive a message that the tableView is near the end of its data set and more data should be fetched if necessary.

+
+ + + +
- (void)tableView:(ASTableView *)tableView willBeginBatchFetchWithContext:(ASBatchContext *)context
+ + + +
+

Parameters

+ + + + + + + + + + + + +
tableView

The sender.

context

A context object that must be notified when the batch fetch is completed.

+
+ + + + + + + +
+

Discussion

+

You must eventually call -completeBatchFetching: with an argument of YES in order to receive future +notifications to do batch fetches. This method is called on a background queue.

+ +

ASTableView currently only supports batch events for tail loads. If you require a head load, consider implementing a +UIRefreshControl.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– shouldBatchFetchForTableView: +

+ +
+
+ +
+ + +
+

Tell the tableView if batch fetching should begin.

+
+ + + +
- (BOOL)shouldBatchFetchForTableView:(ASTableView *)tableView
+ + + +
+

Parameters

+ + + + + + + +
tableView

The sender.

+
+ + + + + + + +
+

Discussion

+

Use this method to conditionally fetch batches. Example use cases are: limiting the total number of +objects that can be fetched or no network connection.

+ +

If not implemented, the tableView assumes that it should notify its asyncDelegate when batch fetching +should occur.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– tableView:constrainedSizeForRowAtIndexPath: +

+ +
+
+ +
+ + +
+

Provides the constrained size range for measuring the row at the index path. +Note: the widths in the returned size range are ignored!

+
+ + + +
- (ASSizeRange)tableView:(ASTableView *)tableView constrainedSizeForRowAtIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + + + + + + +
tableView

The sender.

indexPath

The index path of the node.

+
+ + + +
+

Return Value

+

A constrained size range for layout the node at this index path.

+
+ + + + + + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+ +

– tableView:willDisplayNodeForRowAtIndexPath: +

+ +
+
+ +
+ + +
+

Informs the delegate that the table view will add the node +at the given index path to the view hierarchy.

+
+ + + +
- (void)tableView:(ASTableView *)tableView willDisplayNodeForRowAtIndexPath:(NSIndexPath *)indexPath
+ + + +
+

Parameters

+ + + + + + + + + + + + +
tableView

The sender.

indexPath

The index path of the row that will be displayed.

+
+ + + + + + + +
+

Discussion

+

Warning: AsyncDisplayKit processes table view edits asynchronously. The index path +passed into this method may not correspond to the same item in your data source +if your data source has been updated since the last edit was processed.

+ +

This method is deprecated. Use @c tableView:willDisplayNode:forRowAtIndexPath: instead.

+
+ + + + + + + +
+

Declared In

+

ASTableNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASTextNodeDelegate.html b/docs/appledoc/Protocols/ASTextNodeDelegate.html new file mode 100755 index 00000000..a5945ed6 --- /dev/null +++ b/docs/appledoc/Protocols/ASTextNodeDelegate.html @@ -0,0 +1,450 @@ + + + + + + ASTextNodeDelegate Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASTextNodeDelegate Protocol Reference

+ + +
+ + + + + + + +
Conforms toNSObject
Declared inASTextNode.h
+ + + + + + + + +
+ + + + + + +
+
+ +

– textNode:tappedLinkAttribute:value:atPoint:textRange: +

+ +
+
+ +
+ + +
+

Indicates to the delegate that a link was tapped within a text node.

+
+ + + +
- (void)textNode:(ASTextNode *)textNode tappedLinkAttribute:(NSString *)attribute value:(id)value atPoint:(CGPoint)point textRange:(NSRange)textRange
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
textNode

The ASTextNode containing the link that was tapped.

attribute

The attribute that was tapped. Will not be nil.

value

The value of the tapped attribute.

point

The point within textNode, in textNode’s coordinate system, that was tapped.

textRange

The range of highlighted text.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+ +

– textNode:longPressedLinkAttribute:value:atPoint:textRange: +

+ +
+
+ +
+ + +
+

Indicates to the delegate that a link was tapped within a text node.

+
+ + + +
- (void)textNode:(ASTextNode *)textNode longPressedLinkAttribute:(NSString *)attribute value:(id)value atPoint:(CGPoint)point textRange:(NSRange)textRange
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
textNode

The ASTextNode containing the link that was tapped.

attribute

The attribute that was tapped. Will not be nil.

value

The value of the tapped attribute.

point

The point within textNode, in textNode’s coordinate system, that was tapped.

textRange

The range of highlighted text.

+
+ + + + + + + +
+

Discussion

+

In addition to implementing this method, the delegate must be set on the text + node before it is loaded (the recognizer is created in -didLoad)

+
+ + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+ +

– textNode:shouldHighlightLinkAttribute:value:atPoint: +

+ +
+
+ +
+ + +
+

Indicates to the text node if an attribute should be considered a link.

+
+ + + +
- (BOOL)textNode:(ASTextNode *)textNode shouldHighlightLinkAttribute:(NSString *)attribute value:(id)value atPoint:(CGPoint)point
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
textNode

The text node containing the entity attribute.

attribute

The attribute that was tapped. Will not be nil.

value

The value of the tapped attribute.

point

The point within textNode, in textNode’s coordinate system, that was touched to trigger a highlight.

+
+ + + +
+

Return Value

+

YES if the entity attribute should be a link, NO otherwise.

+
+ + + + + +
+

Discussion

+

If not implemented, the default value is YES.

+
+ + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+ +

– textNode:shouldLongPressLinkAttribute:value:atPoint: +

+ +
+
+ +
+ + +
+

Indicates to the text node if an attribute is a valid long-press target

+
+ + + +
- (BOOL)textNode:(ASTextNode *)textNode shouldLongPressLinkAttribute:(NSString *)attribute value:(id)value atPoint:(CGPoint)point
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + +
textNode

The text node containing the entity attribute.

attribute

The attribute that was tapped. Will not be nil.

value

The value of the tapped attribute.

point

The point within textNode, in textNode’s coordinate system, that was long-pressed.

+
+ + + +
+

Return Value

+

YES if the entity attribute should be treated as a long-press target, NO otherwise.

+
+ + + + + +
+

Discussion

+

If not implemented, the default value is NO.

+
+ + + + + + + +
+

Declared In

+

ASTextNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASVideoNodeDelegate.html b/docs/appledoc/Protocols/ASVideoNodeDelegate.html new file mode 100755 index 00000000..10b8f850 --- /dev/null +++ b/docs/appledoc/Protocols/ASVideoNodeDelegate.html @@ -0,0 +1,729 @@ + + + + + + ASVideoNodeDelegate Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASVideoNodeDelegate Protocol Reference

+ + +
+ + + + + + + +
Conforms toASNetworkImageNodeDelegate
Declared inASVideoNode.h
+ + + + + + +
+ + + + + + +
+
+ +

– videoDidPlayToEnd: +

+ +
+
+ +
+ + +
+

Delegate method invoked when the node’s video has played to its end time.

+
+ + + +
- (void)videoDidPlayToEnd:(ASVideoNode *)videoNode
+ + + +
+

Parameters

+ + + + + + + +
videoNode

The video node has played to its end time.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASVideoNode.h

+
+ + +
+
+
+ +

– didTapVideoNode: +

+ +
+
+ +
+ + +
+

Delegate method invoked the node is tapped.

+
+ + + +
- (void)didTapVideoNode:(ASVideoNode *)videoNode
+ + + +
+

Parameters

+ + + + + + + +
videoNode

The video node that was tapped.

+
+ + + + + + + +
+

Discussion

+

The video’s play state is toggled if this method is not implemented.

+
+ + + + + + + +
+

Declared In

+

ASVideoNode.h

+
+ + +
+
+
+ +

– videoNode:willChangePlayerState:toState: +

+ +
+
+ +
+ + +
+

Delegate method invoked when player changes state.

+
+ + + +
- (void)videoNode:(ASVideoNode *)videoNode willChangePlayerState:(ASVideoNodePlayerState)state toState:(ASVideoNodePlayerState)toState
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
videoNode

The video node.

state

player state before this change.

toState

player new state.

+
+ + + + + + + +
+

Discussion

+

This method is called after each state change

+
+ + + + + + + +
+

Declared In

+

ASVideoNode.h

+
+ + +
+
+
+ +

– videoNode:shouldChangePlayerStateTo: +

+ +
+
+ +
+ + +
+

Ssks delegate if state change is allowed +ASVideoNodePlayerStatePlaying or ASVideoNodePlayerStatePaused. +asks delegate if state change is allowed.

+
+ + + +
- (BOOL)videoNode:(ASVideoNode *)videoNode shouldChangePlayerStateTo:(ASVideoNodePlayerState)state
+ + + +
+

Parameters

+ + + + + + + + + + + + +
videoNode

The video node.

state

player state that is going to be set.

+
+ + + + + + + +
+

Discussion

+

Delegate method invoked when player changes it’s state to +ASVideoNodePlayerStatePlaying or ASVideoNodePlayerStatePaused +and asks delegate if state change is valid

+
+ + + + + + + +
+

Declared In

+

ASVideoNode.h

+
+ + +
+
+
+ +

– videoNode:didPlayToTimeInterval: +

+ +
+
+ +
+ + +
+

Delegate method invoked when player playback time is updated.

+
+ + + +
- (void)videoNode:(ASVideoNode *)videoNode didPlayToTimeInterval:(NSTimeInterval)timeInterval
+ + + +
+

Parameters

+ + + + + + + + + + + + +
videoNode

The video node.

second

current playback time in seconds.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASVideoNode.h

+
+ + +
+
+
+ +

– videoNode:didStallAtTimeInterval: +

+ +
+
+ +
+ + +
+

Delegate method invoked when the video player stalls.

+
+ + + +
- (void)videoNode:(ASVideoNode *)videoNode didStallAtTimeInterval:(NSTimeInterval)timeInterval
+ + + +
+

Parameters

+ + + + + + + + + + + + +
videoNode

The video node that has experienced the stall

second

Current playback time when the stall happens

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASVideoNode.h

+
+ + +
+
+
+ +

– videoNodeDidStartInitialLoading: +

+ +
+
+ +
+ + +
+

Delegate method invoked when the video player starts the inital asset loading

+
+ + + +
- (void)videoNodeDidStartInitialLoading:(ASVideoNode *)videoNode
+ + + +
+

Parameters

+ + + + + + + +
videoNode

The videoNode

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASVideoNode.h

+
+ + +
+
+
+ +

– videoNodeDidFinishInitialLoading: +

+ +
+
+ +
+ + +
+

Delegate method invoked when the video is done loading the asset and can start the playback

+
+ + + +
- (void)videoNodeDidFinishInitialLoading:(ASVideoNode *)videoNode
+ + + +
+

Parameters

+ + + + + + + +
videoNode

The videoNode

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASVideoNode.h

+
+ + +
+
+
+ +

– videoNode:didSetCurrentItem: +

+ +
+
+ +
+ + +
+

Delegate method invoked when the AVPlayerItem for the asset has been set up and can be accessed throught currentItem.

+
+ + + +
- (void)videoNode:(ASVideoNode *)videoNode didSetCurrentItem:(AVPlayerItem *)currentItem
+ + + +
+

Parameters

+ + + + + + + + + + + + +
videoNode

The videoNode.

currentItem

The AVPlayerItem that was constructed from the asset.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASVideoNode.h

+
+ + +
+
+
+ +

– videoNodeDidRecoverFromStall: +

+ +
+
+ +
+ + +
+

Delegate method invoked when the video node has recovered from the stall

+
+ + + +
- (void)videoNodeDidRecoverFromStall:(ASVideoNode *)videoNode
+ + + +
+

Parameters

+ + + + + + + +
videoNode

The videoNode

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASVideoNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASVideoPlayerNodeDelegate.html b/docs/appledoc/Protocols/ASVideoPlayerNodeDelegate.html new file mode 100755 index 00000000..89faa403 --- /dev/null +++ b/docs/appledoc/Protocols/ASVideoPlayerNodeDelegate.html @@ -0,0 +1,940 @@ + + + + + + ASVideoPlayerNodeDelegate Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASVideoPlayerNodeDelegate Protocol Reference

+ + +
+ + + + + + + +
Conforms toNSObject
Declared inASVideoPlayerNode.h
+ + + + + + +
+ + + + + + +
+
+ +

– videoPlayerNodeNeededDefaultControls: +

+ +
+
+ +
+ + +
+

Delegate method invoked before creating controlbar controls +@param videoPlayer

+
+ + + +
- (NSArray *)videoPlayerNodeNeededDefaultControls:(ASVideoPlayerNode *)videoPlayer
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASVideoPlayerNode.h

+
+ + +
+
+
+ +

– videoPlayerNodeCustomControls: +

+ +
+
+ +
+ + +
+

Delegate method invoked before creating default controls, asks delegate for custom controls dictionary. +This dictionary must constain only ASDisplayNode subclass objects. +@param videoPlayer

+
+ + + +
- (NSDictionary *)videoPlayerNodeCustomControls:(ASVideoPlayerNode *)videoPlayer
+ + + + + + + + + +
+

Discussion

+
    +
  • This method is invoked only when developer implements videoPlayerNodeLayoutSpec:forControls:forMaximumSize: +and gives ability to add custom constrols to ASVideoPlayerNode, for example mute button.
  • +
+ +
+ + + + + + + +
+

Declared In

+

ASVideoPlayerNode.h

+
+ + +
+
+
+ +

– videoPlayerNodeLayoutSpec:forControls:forMaximumSize: +

+ +
+
+ +
+ + +
+

Delegate method invoked in layoutSpecThatFits: +@param videoPlayer

+
+ + + +
- (ASLayoutSpec *)videoPlayerNodeLayoutSpec:(ASVideoPlayerNode *)videoPlayer forControls:(NSDictionary *)controls forMaximumSize:(CGSize)maxSize
+ + + +
+

Parameters

+ + + + + + + + + + + + +
controls
    +
  • Dictionary of controls which are used in videoPlayer; Dictionary keys are ASVideoPlayerNodeControlType
  • +
+
maxSize
    +
  • Maximum size for ASVideoPlayerNode
  • +
+
+
+ + + + + + + +
+

Discussion

+
    +
  • Developer can layout whole ASVideoPlayerNode as he wants. ASVideoNode is locked and it can’t be changed
  • +
+ +
+ + + + + + + +
+

Declared In

+

ASVideoPlayerNode.h

+
+ + +
+
+
+ +

– videoPlayerNodeTimeLabelAttributes:timeLabelType: +

+ +
+
+ +
+ + +
+

Delegate method invoked before creating ASVideoPlayerNodeControlTypeElapsedText and ASVideoPlayerNodeControlTypeDurationText +@param videoPlayer +@param timeLabelType

+
+ + + +
- (NSDictionary *)videoPlayerNodeTimeLabelAttributes:(ASVideoPlayerNode *)videoPlayerNode timeLabelType:(ASVideoPlayerNodeControlType)timeLabelType
+ + + + + + + + + + + + + + + +
+

Declared In

+

ASVideoPlayerNode.h

+
+ + +
+
+
+ +

– didTapVideoPlayerNode: +

+ +
+
+ +
+ + +
+

Delegate method invoked when ASVideoPlayerNode is taped.

+
+ + + +
- (void)didTapVideoPlayerNode:(ASVideoPlayerNode *)videoPlayer
+ + + +
+

Parameters

+ + + + + + + +
videoPlayerNode

The ASVideoPlayerNode that was tapped.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASVideoPlayerNode.h

+
+ + +
+
+
+ +

– videoPlayerNode:didPlayToTime: +

+ +
+
+ +
+ + +
+

Delegate method invoked when ASVideoNode playback time is updated.

+
+ + + +
- (void)videoPlayerNode:(ASVideoPlayerNode *)videoPlayer didPlayToTime:(CMTime)time
+ + + +
+

Parameters

+ + + + + + + + + + + + +
second

current playback time.

videoPlayerNode

The video player node

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASVideoPlayerNode.h

+
+ + +
+
+
+ +

– videoPlayerNode:willChangeVideoNodeState:toVideoNodeState: +

+ +
+
+ +
+ + +
+

Delegate method invoked when ASVideoNode changes state.

+
+ + + +
- (void)videoPlayerNode:(ASVideoPlayerNode *)videoPlayer willChangeVideoNodeState:(ASVideoNodePlayerState)state toVideoNodeState:(ASVideoNodePlayerState)toState
+ + + +
+

Parameters

+ + + + + + + + + + + + + + + + + +
state

ASVideoNode state before this change.

videoPlayerNode

The ASVideoPlayerNode whose ASVideoNode is changing state.

toSate

ASVideoNode new state.

+
+ + + + + + + +
+

Discussion

+

This method is called after each state change

+
+ + + + + + + +
+

Declared In

+

ASVideoPlayerNode.h

+
+ + +
+
+
+ +

– videoPlayerNode:shouldChangeVideoNodeStateTo: +

+ +
+
+ +
+ + +
+

Delegate method is invoked when ASVideoNode decides to change state.

+
+ + + +
- (BOOL)videoPlayerNode:(ASVideoPlayerNode *)videoPlayer shouldChangeVideoNodeStateTo:(ASVideoNodePlayerState)state
+ + + +
+

Parameters

+ + + + + + + + + + + + +
state

ASVideoNode that is going to be set.

videoPlayerNode

The ASVideoPlayerNode whose ASVideoNode is changing state.

+
+ + + + + + + +
+

Discussion

+

Delegate method invoked when player changes it’s state to +ASVideoNodePlayerStatePlaying or ASVideoNodePlayerStatePaused +and asks delegate if state change is valid

+
+ + + + + + + +
+

Declared In

+

ASVideoPlayerNode.h

+
+ + +
+
+
+ +

– videoPlayerNodeDidPlayToEnd: +

+ +
+
+ +
+ + +
+

Delegate method invoked when the ASVideoNode has played to its end time.

+
+ + + +
- (void)videoPlayerNodeDidPlayToEnd:(ASVideoPlayerNode *)videoPlayer
+ + + +
+

Parameters

+ + + + + + + +
videoPlayer

The video node has played to its end time.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASVideoPlayerNode.h

+
+ + +
+
+
+ +

– videoPlayerNode:didSetCurrentItem: +

+ +
+
+ +
+ + +
+

Delegate method invoked when the ASVideoNode has constructed its AVPlayerItem for the asset.

+
+ + + +
- (void)videoPlayerNode:(ASVideoPlayerNode *)videoPlayer didSetCurrentItem:(AVPlayerItem *)currentItem
+ + + +
+

Parameters

+ + + + + + + + + + + + +
videoPlayer

The video player node.

currentItem

The AVPlayerItem that was constructed from the asset.

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASVideoPlayerNode.h

+
+ + +
+
+
+ +

– videoPlayerNode:didStallAtTimeInterval: +

+ +
+
+ +
+ + +
+

Delegate method invoked when the ASVideoNode stalls.

+
+ + + +
- (void)videoPlayerNode:(ASVideoPlayerNode *)videoPlayer didStallAtTimeInterval:(NSTimeInterval)timeInterval
+ + + +
+

Parameters

+ + + + + + + + + + + + +
videoPlayer

The video player node that has experienced the stall

second

Current playback time when the stall happens

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASVideoPlayerNode.h

+
+ + +
+
+
+ +

– videoPlayerNodeDidStartInitialLoading: +

+ +
+
+ +
+ + +
+

Delegate method invoked when the ASVideoNode starts the inital asset loading

+
+ + + +
- (void)videoPlayerNodeDidStartInitialLoading:(ASVideoPlayerNode *)videoPlayer
+ + + +
+

Parameters

+ + + + + + + +
videoPlayer

The videoPlayer

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASVideoPlayerNode.h

+
+ + +
+
+
+ +

– videoPlayerNodeDidFinishInitialLoading: +

+ +
+
+ +
+ + +
+

Delegate method invoked when the ASVideoNode is done loading the asset and can start the playback

+
+ + + +
- (void)videoPlayerNodeDidFinishInitialLoading:(ASVideoPlayerNode *)videoPlayer
+ + + +
+

Parameters

+ + + + + + + +
videoPlayer

The videoPlayer

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASVideoPlayerNode.h

+
+ + +
+
+
+ +

– videoPlayerNodeDidRecoverFromStall: +

+ +
+
+ +
+ + +
+

Delegate method invoked when the ASVideoNode has recovered from the stall

+
+ + + +
- (void)videoPlayerNodeDidRecoverFromStall:(ASVideoPlayerNode *)videoPlayer
+ + + +
+

Parameters

+ + + + + + + +
videoPlayer

The videoplayer

+
+ + + + + + + + + + + + + +
+

Declared In

+

ASVideoPlayerNode.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/Protocols/ASVisibilityDepth.html b/docs/appledoc/Protocols/ASVisibilityDepth.html new file mode 100755 index 00000000..b9e2772a --- /dev/null +++ b/docs/appledoc/Protocols/ASVisibilityDepth.html @@ -0,0 +1,269 @@ + + + + + + ASVisibilityDepth Protocol Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

ASVisibilityDepth Protocol Reference

+ + +
+ + + + + + + +
Conforms toNSObject
Declared inASVisibilityProtocols.h
+ + + + +
+ +

Overview

+

ASVisibilityDepth

“Visibility Depth” represents the number of user actions required to make an ASDisplayNode or +ASViewController visibile. AsyncDisplayKit uses this information to intelligently manage memory and focus +resources where they are most visible to the user.

+ +

The ASVisibilityDepth protocol describes how custom view controllers can integrate with this system.

+ +

Parent view controllers should also implement @c ASManagesChildVisibilityDepth

+
+ + + + + +
+ + + + + + +
+
+ +

– visibilityDepth +required method

+ +
+
+ +
+ + +
+

Visibility depth

+
+ + + +
- (NSInteger)visibilityDepth
+ + + + + + + + + +
+

Discussion

+

Represents the number of user actions necessary to reach the view controller. An increased visibility +depth indicates a higher number of user interactions for the view controller to be visible again. For example, +an onscreen navigation controller’s top view controller should have a visibility depth of 0. The view controller +one from the top should have a visibility deptch of 1 as should the root view controller in the stack (because +the user can hold the back button to pop to the root view controller).

+ +

Visibility depth is used to automatically adjust ranges on range controllers (and thus free up memory) and can +be used to reduce memory usage of other items as well.

+
+ + + + + + + +
+

Declared In

+

ASVisibilityProtocols.h

+
+ + +
+
+
+ +

– visibilityDepthDidChange +required method

+ +
+
+ +
+ + +
+

Called when visibility depth changes

+
+ + + +
- (void)visibilityDepthDidChange
+ + + + + + + + + +
+

Discussion

+

@c visibilityDepthDidChange is called whenever the visibility depth of the represented view controller +has changed.

+ +

If implemented by a view controller container, use this method to notify child view controllers that their view +depth has changed @see ASNavigationController.m

+ +

If implemented on an ASViewController, use this method to reduce or increase the resources that your +view controller uses. A higher visibility depth view controller should decrease it’s resource usage, a lower +visibility depth controller should pre-warm resources in preperation for a display at 0 depth.

+ +

ASViewController implements this method and reduces / increases range mode of supporting nodes (such as ASCollectionNode +and ASTableNode).

+
+ + + + + +
+

See Also

+ +
+ + + +
+

Declared In

+

ASVisibilityProtocols.h

+
+ + +
+
+
+
+ +
+ + + + + + +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/css/scss/_index.scss b/docs/appledoc/css/scss/_index.scss new file mode 100755 index 00000000..6a57ec5d --- /dev/null +++ b/docs/appledoc/css/scss/_index.scss @@ -0,0 +1,17 @@ +.index-container { + -webkit-flex-direction: column; + flex-direction: column; + + @media (min-width: $desktop-min-width) { + display: flex; + -webkit-flex-direction: row; + flex-direction: row; + -webkit-flex-wrap: wrap; + flex-wrap: wrap; + } + + .index-column { + -webkit-flex: 1 1 33%; + flex: 1 1 33%; + } +} diff --git a/docs/appledoc/css/scss/_layout.scss b/docs/appledoc/css/scss/_layout.scss new file mode 100755 index 00000000..da46aef0 --- /dev/null +++ b/docs/appledoc/css/scss/_layout.scss @@ -0,0 +1,302 @@ +* { + box-sizing: border-box; +} + +.clear { + clear: both; +} + +.clearfix { + &:before, &:after { + clear: both; + display: table; + content: ""; + } +} + +.xcode .hide-in-xcode { + display: none; +} + +body { + font: 62.5% $body-font; + background: $body-background; + + @media (max-width: $mobile-max-width) { + background-color: $content-background; + } +} + +h1, h2, h3 { + font-weight: 300; + color: #808080; +} + +h1 { + font-size: 2em; + color: #000; +} + +h4 { + font-size: 13px; + line-height: 1.5; + margin: 21px 0 0 0; +} + +a { + color: $tint-color; + text-decoration: none; +} + +pre, code { + font-family: $code-font; + word-wrap: break-word; +} + +pre > code, .method-declaration code { + display: inline-block; + font-size: .85em; + padding: 4px 0 4px 10px; + border-left: 5px solid rgba(0, 155, 51, .2); + + &:before { + content: "Objective-C"; + display: block; + + font: 9px/1 $body-font; + color: #009b33; + text-transform: uppercase; + letter-spacing: 2px; + padding-bottom: 6px; + } +} + +pre > code { + font-size: inherit; +} + +table, th, td { + border: 1px solid #e9e9e9; +} + +table { + width: 100%; +} + +th, td { + padding: 7px; + + > :first-child { + margin-top: 0; + } + + > :last-child { + margin-bottom: 0; + } +} + +.container { + @extend .clearfix; + + max-width: 980px; + padding: 0 10px; + margin: 0 auto; + + @media (max-width: $mobile-max-width) { + padding: 0; + } +} + +header { + position: fixed; + top: 0; + left: 0; + width: 100%; + z-index: 2; + + background: #414141; + color: #fff; + font-size: 1.1em; + line-height: 25px; + letter-spacing: .05em; + + #library-title { + float: left; + } + + #developer-home { + float: right; + } + + h1 { + font-size: inherit; + font-weight: inherit; + margin: 0; + } + + p { + margin: 0; + } + + h1, a { + color: inherit; + } + + @media (max-width: $mobile-max-width) { + .container { + padding: 0 10px; + } + } +} + +aside { + position: fixed; + top: 25px; + left: 0; + width: 100%; + height: 25px; + z-index: 2; + + font-size: 1.1em; + + #header-buttons { + background: rgba(255, 255, 255, .8); + margin: 0 1px; + padding: 0; + list-style: none; + text-align: right; + line-height: 32px; + + li { + display: inline-block; + cursor: pointer; + padding: 0 10px; + } + + label, select { + cursor: inherit; + } + + #on-this-page { + position: relative; + + .chevron { + display: inline-block; + width: 14px; + height: 4px; + position: relative; + + .chevy { + background: #878787; + height: 2px; + position: absolute; + width: 10px; + + &.chevron-left { + left: 0; + transform: rotateZ(45deg) scale(0.6); + } + + &.chevron-right { + right: 0; + transform: rotateZ(-45deg) scale(0.6); + } + } + } + + #jump-to { + opacity: 0; + font-size: 16px; + + position: absolute; + top: 5px; + left: 0; + width: 100%; + height: 100%; + } + } + } +} + +article { + margin-top: 25px; + + #content { + @extend .clearfix; + + background: $content-background; + border: 1px solid $content-border; + padding: 15px 25px 30px 25px; + + font-size: 1.4em; + line-height: 1.45; + + position: relative; + + @media (max-width: $mobile-max-width) { + padding: 15px 10px 20px 10px; + border: none; + } + + .navigation-top { + position: absolute; + top: 15px; + right: 25px; + } + + .title { + margin: 21px 0 0 0; + padding: 15px 0; + } + + p { + color: #414141; + margin: 0 0 15px 0; + } + + th, td { + p:last-child { + margin-bottom: 0; + } + } + + main { + ul { + list-style: none; + margin-left: 24px; + margin-bottom: 12px; + padding: 0; + + li { + position: relative; + padding-left: 1.3em; + + &:before { + content: "\02022"; + + color: #414141; + font-size: 1.08em; + line-height: 1; + + position: absolute; + left: 0; + padding-top: 2px; + } + } + } + } + + footer { + @extend .clearfix; + + .footer-copyright { + margin: 70px 25px 10px 0; + } + + p { + font-size: .71em; + color: #a0a0a0; + } + } + } +} diff --git a/docs/appledoc/css/scss/_normalize.scss b/docs/appledoc/css/scss/_normalize.scss new file mode 100755 index 00000000..9b8848a5 --- /dev/null +++ b/docs/appledoc/css/scss/_normalize.scss @@ -0,0 +1,581 @@ +/* ========================================================================== + Normalize.scss settings + ========================================================================== */ +/** + * Includes legacy browser support IE6/7 + * + * Set to false if you want to drop support for IE6 and IE7 + */ + +$legacy_browser_support: false !default; + +/* Base + ========================================================================== */ + +/** + * 1. Set default font family to sans-serif. + * 2. Prevent iOS text size adjust after orientation change, without disabling + * user zoom. + * 3. Corrects text resizing oddly in IE 6/7 when body `font-size` is set using + * `em` units. + */ + +html { + font-family: sans-serif; /* 1 */ + -ms-text-size-adjust: 100%; /* 2 */ + -webkit-text-size-adjust: 100%; /* 2 */ + @if $legacy_browser_support { + *font-size: 100%; /* 3 */ + } +} + +/** + * Remove default margin. + */ + +body { + margin: 0; +} + +/* HTML5 display definitions + ========================================================================== */ + +/** + * Correct `block` display not defined for any HTML5 element in IE 8/9. + * Correct `block` display not defined for `details` or `summary` in IE 10/11 + * and Firefox. + * Correct `block` display not defined for `main` in IE 11. + */ + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +menu, +nav, +section, +summary { + display: block; +} + +/** + * 1. Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3. + * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. + */ + +audio, +canvas, +progress, +video { + display: inline-block; /* 1 */ + vertical-align: baseline; /* 2 */ + @if $legacy_browser_support { + *display: inline; + *zoom: 1; + } +} + +/** + * Prevents modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Address `[hidden]` styling not present in IE 8/9/10. + * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. + */ + +[hidden], +template { + display: none; +} + +/* Links + ========================================================================== */ + +/** + * Remove the gray background color from active links in IE 10. + */ + +a { + background-color: transparent; +} + +/** + * Improve readability when focused and also mouse hovered in all browsers. + */ + +a { + &:active, &:hover { + outline: 0; + }; +} + +/* Text-level semantics + ========================================================================== */ + +/** + * Address styling not present in IE 8/9/10/11, Safari, and Chrome. + */ + +abbr[title] { + border-bottom: 1px dotted; +} + +/** + * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. + */ + +b, +strong { + font-weight: bold; +} + +@if $legacy_browser_support { + blockquote { + margin: 1em 40px; + } +} + +/** + * Address styling not present in Safari and Chrome. + */ + +dfn { + font-style: italic; +} + +/** + * Address variable `h1` font-size and margin within `section` and `article` + * contexts in Firefox 4+, Safari, and Chrome. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +@if $legacy_browser_support { + h2 { + font-size: 1.5em; + margin: 0.83em 0; + } + + h3 { + font-size: 1.17em; + margin: 1em 0; + } + + h4 { + font-size: 1em; + margin: 1.33em 0; + } + + h5 { + font-size: 0.83em; + margin: 1.67em 0; + } + + h6 { + font-size: 0.67em; + margin: 2.33em 0; + } +} + +/** + * Addresses styling not present in IE 8/9. + */ + +mark { + background: #ff0; + color: #000; +} + +@if $legacy_browser_support { + + /** + * Addresses margins set differently in IE 6/7. + */ + + p, + pre { + *margin: 1em 0; + } + + /* + * Addresses CSS quotes not supported in IE 6/7. + */ + + q { + *quotes: none; + } + + /* + * Addresses `quotes` property not supported in Safari 4. + */ + + q:before, + q:after { + content: ''; + content: none; + } +} + +/** + * Address inconsistent and variable font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +@if $legacy_browser_support { + + /* ========================================================================== + Lists + ========================================================================== */ + + /* + * Addresses margins set differently in IE 6/7. + */ + + dl, + menu, + ol, + ul { + *margin: 1em 0; + } + + dd { + *margin: 0 0 0 40px; + } + + /* + * Addresses paddings set differently in IE 6/7. + */ + + menu, + ol, + ul { + *padding: 0 0 0 40px; + } + + /* + * Corrects list images handled incorrectly in IE 7. + */ + + nav ul, + nav ol { + *list-style: none; + *list-style-image: none; + } + +} + +/* Embedded content + ========================================================================== */ + +/** + * 1. Remove border when inside `a` element in IE 8/9/10. + * 2. Improves image quality when scaled in IE 7. + */ + +img { + border: 0; + @if $legacy_browser_support { + *-ms-interpolation-mode: bicubic; /* 2 */ + } +} + +/** + * Correct overflow not hidden in IE 9/10/11. + */ + +svg:not(:root) { + overflow: hidden; +} + +/* Grouping content + ========================================================================== */ + +/** + * Address margin not present in IE 8/9 and Safari. + */ + +figure { + margin: 1em 40px; +} + +/** + * Address differences between Firefox and other browsers. + */ + +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} + +/** + * Contain overflow in all browsers. + */ + +pre { + overflow: auto; +} + +/** + * Address odd `em`-unit font size rendering in all browsers. + * Correct font family set oddly in IE 6, Safari 4/5, and Chrome. + */ + +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + @if $legacy_browser_support { + _font-family: 'courier new', monospace; + } + font-size: 1em; +} + +/* Forms + ========================================================================== */ + +/** + * Known limitation: by default, Chrome and Safari on OS X allow very limited + * styling of `select`, unless a `border` property is set. + */ + +/** + * 1. Correct color not being inherited. + * Known issue: affects color of disabled elements. + * 2. Correct font properties not being inherited. + * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. + * 4. Improves appearance and consistency in all browsers. + */ + +button, +input, +optgroup, +select, +textarea { + color: inherit; /* 1 */ + font: inherit; /* 2 */ + margin: 0; /* 3 */ + @if $legacy_browser_support { + vertical-align: baseline; /* 3 */ + *vertical-align: middle; /* 3 */ + } +} + +/** + * Address `overflow` set to `hidden` in IE 8/9/10/11. + */ + +button { + overflow: visible; +} + +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. + * Correct `select` style inheritance in Firefox. + */ + +button, +select { + text-transform: none; +} + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + * 4. Removes inner spacing in IE 7 without affecting normal text inputs. + * Known issue: inner spacing remains in IE 6. + */ + +button, +html input[type="button"], /* 1 */ +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; /* 2 */ + cursor: pointer; /* 3 */ + @if $legacy_browser_support { + *overflow: visible; /* 4 */ + } +} + +/** + * Re-set default cursor for disabled elements. + */ + +button[disabled], +html input[disabled] { + cursor: default; +} + +/** + * Remove inner padding and border in Firefox 4+. + */ + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/** + * Address Firefox 4+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ + +input { + line-height: normal; +} + +/** + * 1. Address box sizing set to `content-box` in IE 8/9/10. + * 2. Remove excess padding in IE 8/9/10. + * Known issue: excess padding remains in IE 6. + */ + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ + @if $legacy_browser_support { + *height: 13px; /* 3 */ + *width: 13px; /* 3 */ + } +} + +/** + * Fix the cursor style for Chrome's increment/decrement buttons. For certain + * `font-size` values of the `input`, it causes the cursor style of the + * decrement button to change from `default` to `text`. + */ + +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Address `appearance` set to `searchfield` in Safari and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari and Chrome + * (include `-moz` to future-proof). + */ + +input[type="search"] { + -webkit-appearance: textfield; /* 1 */ + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; /* 2 */ + box-sizing: content-box; +} + +/** + * Remove inner padding and search cancel button in Safari and Chrome on OS X. + * Safari (but not Chrome) clips the cancel button when the search input has + * padding (and `textfield` appearance). + */ + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * Define consistent border, margin, and padding. + */ + +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/** + * 1. Correct `color` not being inherited in IE 8/9/10/11. + * 2. Remove padding so people aren't caught out if they zero out fieldsets. + * 3. Corrects text not wrapping in Firefox 3. + * 4. Corrects alignment displayed oddly in IE 6/7. + */ + +legend { + border: 0; /* 1 */ + padding: 0; /* 2 */ + @if $legacy_browser_support { + white-space: normal; /* 3 */ + *margin-left: -7px; /* 4 */ + } +} + +/** + * Remove default vertical scrollbar in IE 8/9/10/11. + */ + +textarea { + overflow: auto; +} + +/** + * Don't inherit the `font-weight` (applied by a rule above). + * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. + */ + +optgroup { + font-weight: bold; +} + +/* Tables + ========================================================================== */ + +/** + * Remove most spacing between table cells. + */ + +table { + border-collapse: collapse; + border-spacing: 0; +} + +td, +th { + padding: 0; +} diff --git a/docs/appledoc/css/scss/_object.scss b/docs/appledoc/css/scss/_object.scss new file mode 100755 index 00000000..22eebd87 --- /dev/null +++ b/docs/appledoc/css/scss/_object.scss @@ -0,0 +1,89 @@ +.section-specification { + table { + width: auto; + + th { + text-align: left; + } + } +} + +.method-title { + margin-left: -15px; + margin-bottom: 8px; + transition: margin-left .3s ease-out; + + .section-method.hide & { + margin-left: 0; + } + + code { + font-weight: 400; + font-size: .85em; + } +} + +.method-info { + background: $object-background; + border-bottom: 1px solid $object-border; + margin: 0 -25px; + padding: 20px 25px 0 25px; + transition: height .3s ease-out; + + position: relative; + + .pointy-thing { + background: $content-background; + height: 10px; + border-bottom: 1px solid $object-border; + margin: -20px -25px 16px -25px; + + &:before { + display: inline-block; + content: ""; + + background: $object-background; + border: 1px solid $object-border; + border-bottom: 0; + border-right: 0; + + position: absolute; + left: 21px; + top: 3px; + width: 12px; + height: 12px; + transform: rotate(45deg); + } + } + + .method-subsection { + margin-bottom: 15px; + + .argument-name { + width: 1px; + text-align: right; + + code { + color: #808080; + font-style: italic; + font-weight: 400; + } + } + } +} + +.section-method { + &.hide .method-info { + height: 0 !important; + overflow: hidden; + display: none; + } + + &.hide.animating .method-info { + display: block; + } + + &.animating .method-info { + overflow: hidden; + } +} diff --git a/docs/appledoc/css/scss/_print.scss b/docs/appledoc/css/scss/_print.scss new file mode 100755 index 00000000..61bdf99f --- /dev/null +++ b/docs/appledoc/css/scss/_print.scss @@ -0,0 +1,42 @@ +@media print { + body { + background: #fff; + padding: 8px; + } + + header { + position: static; + background: #fff; + color: #000; + } + + aside { + display: none; + } + + .container { + max-width: none; + padding: 0; + } + + article { + margin-top: 0; + + #content { + border: 0; + background: #fff; + padding: 15px 0 0 0; + + .title { + margin-top: 0; + padding-top: 0; + } + } + } + + .method-info { + &, & .pointy-thing { + background: #fff; + } + } +} diff --git a/docs/appledoc/css/scss/_variables.scss b/docs/appledoc/css/scss/_variables.scss new file mode 100755 index 00000000..38e072d3 --- /dev/null +++ b/docs/appledoc/css/scss/_variables.scss @@ -0,0 +1,12 @@ +$body-font: -apple-system-font, "Helvetica Neue", Helvetica, sans-serif; +$code-font: "Source Code Pro", Monaco, Menlo, Consolas, monospace; + +$body-background: #f2f2f2; +$content-background: #fff; +$content-border: #e9e9e9; +$tint-color: #08c; +$object-background: #f9f9f9; +$object-border: #e9e9e9; + +$mobile-max-width: 650px; +$desktop-min-width: 768px; \ No newline at end of file diff --git a/docs/appledoc/css/scss/_xcode.scss b/docs/appledoc/css/scss/_xcode.scss new file mode 100755 index 00000000..340b1f6b --- /dev/null +++ b/docs/appledoc/css/scss/_xcode.scss @@ -0,0 +1,29 @@ +.xcode { + header, aside { + display: none; + } + + .container { + padding: 0; + } + + article { + margin-top: 0; + + #content { + border: 0; + margin: 0; + } + } + + .method-info { + &, .section-method.hide & { + max-height: auto; + overflow: visible; + + &.hiding { + display: block; + } + } + } +} diff --git a/docs/appledoc/css/scss/style.scss b/docs/appledoc/css/scss/style.scss new file mode 100755 index 00000000..648a6086 --- /dev/null +++ b/docs/appledoc/css/scss/style.scss @@ -0,0 +1 @@ +@import "variables", "normalize", "layout", "index", "object", "print", "xcode"; diff --git a/docs/appledoc/css/style.css b/docs/appledoc/css/style.css new file mode 100755 index 00000000..d9d59dd0 --- /dev/null +++ b/docs/appledoc/css/style.css @@ -0,0 +1,2 @@ +html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}*{box-sizing:border-box}.clear{clear:both}.clearfix:before,.container:before,article #content:before,article #content footer:before,.clearfix:after,.container:after,article #content:after,article #content footer:after{clear:both;display:table;content:""}.xcode .hide-in-xcode{display:none}body{font:62.5% -apple-system-font,"Helvetica Neue",Helvetica,sans-serif;background:#f2f2f2}@media (max-width: 650px){body{background-color:#fff}}h1,h2,h3{font-weight:300;color:#808080}h1{font-size:2em;color:#000}h4{font-size:13px;line-height:1.5;margin:21px 0 0 0}a{color:#08c;text-decoration:none}pre,code{font-family:"Source Code Pro",Monaco,Menlo,Consolas,monospace;word-wrap:break-word}pre>code,.method-declaration code{display:inline-block;font-size:.85em;padding:4px 0 4px 10px;border-left:5px solid rgba(0,155,51,0.2)}pre>code:before,.method-declaration code:before{content:"Objective-C";display:block;font:9px/1 -apple-system-font,"Helvetica Neue",Helvetica,sans-serif;color:#009b33;text-transform:uppercase;letter-spacing:2px;padding-bottom:6px}pre>code{font-size:inherit}table,th,td{border:1px solid #e9e9e9}table{width:100%}th,td{padding:7px}th>:first-child,td>:first-child{margin-top:0}th>:last-child,td>:last-child{margin-bottom:0}.container{max-width:980px;padding:0 10px;margin:0 auto}@media (max-width: 650px){.container{padding:0}}header{position:fixed;top:0;left:0;width:100%;z-index:2;background:#414141;color:#fff;font-size:1.1em;line-height:25px;letter-spacing:.05em}header #library-title{float:left}header #developer-home{float:right}header h1{font-size:inherit;font-weight:inherit;margin:0}header p{margin:0}header h1,header a{color:inherit}@media (max-width: 650px){header .container{padding:0 10px}}aside{position:fixed;top:25px;left:0;width:100%;height:25px;z-index:2;font-size:1.1em}aside #header-buttons{background:rgba(255,255,255,0.8);margin:0 1px;padding:0;list-style:none;text-align:right;line-height:32px}aside #header-buttons li{display:inline-block;cursor:pointer;padding:0 10px}aside #header-buttons label,aside #header-buttons select{cursor:inherit}aside #header-buttons #on-this-page{position:relative}aside #header-buttons #on-this-page .chevron{display:inline-block;width:14px;height:4px;position:relative}aside #header-buttons #on-this-page .chevron .chevy{background:#878787;height:2px;position:absolute;width:10px}aside #header-buttons #on-this-page .chevron .chevy.chevron-left{left:0;transform:rotateZ(45deg) scale(0.6)}aside #header-buttons #on-this-page .chevron .chevy.chevron-right{right:0;transform:rotateZ(-45deg) scale(0.6)}aside #header-buttons #on-this-page #jump-to{opacity:0;font-size:16px;position:absolute;top:5px;left:0;width:100%;height:100%}article{margin-top:25px}article #content{background:#fff;border:1px solid #e9e9e9;padding:15px 25px 30px 25px;font-size:1.4em;line-height:1.45;position:relative}@media (max-width: 650px){article #content{padding:15px 10px 20px 10px;border:none}}article #content .navigation-top{position:absolute;top:15px;right:25px}article #content .title{margin:21px 0 0 0;padding:15px 0}article #content p{color:#414141;margin:0 0 15px 0}article #content th p:last-child,article #content td p:last-child{margin-bottom:0}article #content main ul{list-style:none;margin-left:24px;margin-bottom:12px;padding:0}article #content main ul li{position:relative;padding-left:1.3em}article #content main ul li:before{content:"\02022";color:#414141;font-size:1.08em;line-height:1;position:absolute;left:0;padding-top:2px}article #content footer .footer-copyright{margin:70px 25px 10px 0}article #content footer p{font-size:.71em;color:#a0a0a0}.index-container{-webkit-flex-direction:column;flex-direction:column}@media (min-width: 768px){.index-container{display:flex;-webkit-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;flex-wrap:wrap}}.index-container .index-column{-webkit-flex:1 1 33%;flex:1 1 33%}.section-specification table{width:auto}.section-specification table th{text-align:left}.method-title{margin-left:-15px;margin-bottom:8px;transition:margin-left .3s ease-out}.section-method.hide .method-title{margin-left:0}.method-title code{font-weight:400;font-size:.85em}.method-info{background:#f9f9f9;border-bottom:1px solid #e9e9e9;margin:0 -25px;padding:20px 25px 0 25px;transition:height .3s ease-out;position:relative}.method-info .pointy-thing{background:#fff;height:10px;border-bottom:1px solid #e9e9e9;margin:-20px -25px 16px -25px}.method-info .pointy-thing:before{display:inline-block;content:"";background:#f9f9f9;border:1px solid #e9e9e9;border-bottom:0;border-right:0;position:absolute;left:21px;top:3px;width:12px;height:12px;-webkit-transform:rotate(45deg);transform:rotate(45deg) }.method-info .method-subsection{margin-bottom:15px}.method-info .method-subsection .argument-name{width:1px;text-align:right}.method-info .method-subsection .argument-name code{color:#808080;font-style:italic;font-weight:400}.section-method.hide .method-info{height:0 !important;overflow:hidden;display:none}.section-method.hide.animating .method-info{display:block}.section-method.animating .method-info{overflow:hidden}@media print{body{background:#fff;padding:8px}header{position:static;background:#fff;color:#000}aside{display:none}.container{max-width:none;padding:0}article{margin-top:0}article #content{border:0;background:#fff;padding:15px 0 0 0}article #content .title{margin-top:0;padding-top:0}.method-info,.method-info .pointy-thing{background:#fff}}.xcode header,.xcode aside{display:none}.xcode .container{padding:0}.xcode article{margin-top:0}.xcode article #content{border:0;margin:0}.xcode .method-info,.section-method.hide .xcode .method-info{max-height:auto;overflow:visible}.xcode .method-info.hiding,.section-method.hide .xcode .method-info.hiding{display:block} + diff --git a/docs/appledoc/hierarchy.html b/docs/appledoc/hierarchy.html new file mode 100755 index 00000000..f9eb6113 --- /dev/null +++ b/docs/appledoc/hierarchy.html @@ -0,0 +1,402 @@ + + + + + + Hierarchy + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

Hierarchy

+ + +
+

Class Hierarchy

+ + + +
+ + + +
+ +

Protocol References

+ + + +

Constant References

+ + + +

Category References

+ + +
+ + +
+ +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/img/button_bar_background.png b/docs/appledoc/img/button_bar_background.png new file mode 100755 index 00000000..71d1019b Binary files /dev/null and b/docs/appledoc/img/button_bar_background.png differ diff --git a/docs/appledoc/img/disclosure.png b/docs/appledoc/img/disclosure.png new file mode 100755 index 00000000..4c5cbf44 Binary files /dev/null and b/docs/appledoc/img/disclosure.png differ diff --git a/docs/appledoc/img/disclosure_open.png b/docs/appledoc/img/disclosure_open.png new file mode 100755 index 00000000..82396fed Binary files /dev/null and b/docs/appledoc/img/disclosure_open.png differ diff --git a/docs/appledoc/img/library_background.png b/docs/appledoc/img/library_background.png new file mode 100755 index 00000000..3006248a Binary files /dev/null and b/docs/appledoc/img/library_background.png differ diff --git a/docs/appledoc/img/title_background.png b/docs/appledoc/img/title_background.png new file mode 100755 index 00000000..846e4968 Binary files /dev/null and b/docs/appledoc/img/title_background.png differ diff --git a/docs/appledoc/index.html b/docs/appledoc/index.html new file mode 100755 index 00000000..27076d4f --- /dev/null +++ b/docs/appledoc/index.html @@ -0,0 +1,340 @@ + + + + + + Reference + + + + + + +
+
+ +

+ +

+ +

+ AsyncDisplayKit +

+ +
+
+ + + +
+
+
+
+

Reference

+ + + +
+ + + + + + + +
+ +

Protocol References

+ + + + +

Constant References

+ + + + +

Category References

+ + +
+ +
+ +
+ +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/docs/appledoc/js/script.js b/docs/appledoc/js/script.js new file mode 100755 index 00000000..4074361c --- /dev/null +++ b/docs/appledoc/js/script.js @@ -0,0 +1,59 @@ +function $() { + return document.querySelector.apply(document, arguments); +} + +if (navigator.userAgent.indexOf("Xcode") != -1) { + document.documentElement.classList.add("xcode"); +} + +var jumpTo = $("#jump-to"); + +if (jumpTo) { + jumpTo.addEventListener("change", function(e) { + location.hash = this.options[this.selectedIndex].value; + }); +} + +function hashChanged() { + if (/^#\/\/api\//.test(location.hash)) { + var element = document.querySelector("a[name='" + location.hash.substring(1) + "']"); + + if (!element) { + return; + } + + element = element.parentNode; + + element.classList.remove("hide"); + fixScrollPosition(element); + } +} + +function fixScrollPosition(element) { + var scrollTop = element.offsetTop - 150; + document.documentElement.scrollTop = scrollTop; + document.body.scrollTop = scrollTop; +} + +[].forEach.call(document.querySelectorAll(".section-method"), function(element) { + element.classList.add("hide"); + + element.querySelector(".method-title a").addEventListener("click", function(e) { + var info = element.querySelector(".method-info"), + infoContainer = element.querySelector(".method-info-container"); + + element.classList.add("animating"); + info.style.height = (infoContainer.clientHeight + 40) + "px"; + fixScrollPosition(element); + element.classList.toggle("hide"); + if (element.classList.contains("hide")) { + e.preventDefault(); + } + setTimeout(function() { + element.classList.remove("animating"); + }, 300); + }); +}); + +window.addEventListener("hashchange", hashChanged); +hashChanged(); diff --git a/docs/appledocs.md b/docs/appledocs.md new file mode 100755 index 00000000..541ea17c --- /dev/null +++ b/docs/appledocs.md @@ -0,0 +1,7 @@ +--- +title: api +layout: appledocs +permalink: /appledocs.html +--- + + diff --git a/docs/index.md b/docs/index.md new file mode 100755 index 00000000..5168c91c --- /dev/null +++ b/docs/index.md @@ -0,0 +1,23 @@ +--- +layout: default +title: A UI Framework for Effortless Responsiveness +id: home +--- + +
+
+
Keeps the most complex iOS user interfaces smooth and responsive.
+ Get Started + View on GitHub +
+
+ +
+
+

AsyncDisplayKit is an iOS framework built on top of UIKit that keeps even the most complex user interfaces smooth and responsive. It was originally built to make Facebook's Paper possible, and goes hand-in-hand with pop's physics-based animations — but it's just as powerful with UIKit Dynamics and conventional app designs. More recently, it was used to power Pinterest's app rewrite.

+ +

As the framework has grown, many features have been added that can save developers tons of time by eliminating common boilerplate style structures common in modern iOS apps. If you've ever dealt with cell reuse bugs, tried to performantly preload data for a page or scroll style interface or even just tried to keep your app from dropping too many frames you can benefit from integrating ASDK.

+ +

To learn more, check out our docs!

+
+
diff --git a/docs/showcase.md b/docs/showcase.md new file mode 100755 index 00000000..21b361cf --- /dev/null +++ b/docs/showcase.md @@ -0,0 +1,200 @@ +--- +title: Showcase +layout: default +permalink: /showcase.html +--- + +
+ +
+

Who's using AsyncDisplayKit?

+

If you're curious to see what can be accomplished with AsyncDisplayKit, check out these apps.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ Facebook +
+ Introducing AsyncDisplayKit: For smooth and responsive apps on iOS +
+ +
+ Pinterest +
+ Re-architecting Pinterest's iOS app +
+ +
+ Buffer +
+ Smooth Scrolling in Buffer for iOS: How (and Why) We Implemented AsyncDisplayKit +
+ +
+ Auxy +
+ 2016 Apple Design Award Winner +
+ +
+ NYT +
+ +
+ NFL +
+ +
+ Yahoo +
+ +
+ Kwaver Music +
+ +
+ This is Money +
+ +
+ JSwipe +
+ +
+ Peloton Cycle +
+ +
+ 即刻 - 不错过你惦记的每一件小事 +
+ +
+ Tripstr +
+ +
+ Fyuse +
+ +
+ ClassDojo +
+ +
+ GitBucket +
+ +
+ Roposo +
+ +
+ Mishu +
+ +
+ InstaBuy +
+ +
+ Eniro +
+ +
+ Kayako +
+ +
+ Yep +
+ +
+ HakkerJobs +
+ +
+

If you built an app using AsyncDisplayKit, we'd love to have your app in this showcase!

+

If you would like to have your app added or do not want your app featured on this page, please email asyncdisplaykit@gmail.com.

+ +
+ +
diff --git a/docs/slack.md b/docs/slack.md new file mode 100755 index 00000000..6bb7f2e0 --- /dev/null +++ b/docs/slack.md @@ -0,0 +1,10 @@ +--- +title: slack +layout: slack +permalink: /slack.html +--- + + + + +If the auto-invite link above does not work for you, please email asyncdisplaykit@gmail.com for an invite. diff --git a/docs/static/images/1-shuffle-crop.png b/docs/static/images/1-shuffle-crop.png new file mode 100755 index 00000000..d1e0a83b Binary files /dev/null and b/docs/static/images/1-shuffle-crop.png differ diff --git a/docs/static/images/ASDKLogo.png b/docs/static/images/ASDKLogo.png new file mode 100755 index 00000000..429bcc35 Binary files /dev/null and b/docs/static/images/ASDKLogo.png differ diff --git a/docs/static/images/asdk-logo.png b/docs/static/images/asdk-logo.png new file mode 100755 index 00000000..b82f6b0a Binary files /dev/null and b/docs/static/images/asdk-logo.png differ diff --git a/docs/static/images/basicMap.png b/docs/static/images/basicMap.png new file mode 100755 index 00000000..b387adc0 Binary files /dev/null and b/docs/static/images/basicMap.png differ diff --git a/docs/static/images/catsButt.png b/docs/static/images/catsButt.png new file mode 100755 index 00000000..0d442faf Binary files /dev/null and b/docs/static/images/catsButt.png differ diff --git a/docs/static/images/catsFace.png b/docs/static/images/catsFace.png new file mode 100755 index 00000000..4be93671 Binary files /dev/null and b/docs/static/images/catsFace.png differ diff --git a/docs/static/images/catsMiddle.png b/docs/static/images/catsMiddle.png new file mode 100755 index 00000000..f6526eeb Binary files /dev/null and b/docs/static/images/catsMiddle.png differ diff --git a/docs/static/images/clip-corners.png b/docs/static/images/clip-corners.png new file mode 100755 index 00000000..cc43a0a9 Binary files /dev/null and b/docs/static/images/clip-corners.png differ diff --git a/docs/static/images/component-controllers.png b/docs/static/images/component-controllers.png new file mode 100755 index 00000000..e882cd1f Binary files /dev/null and b/docs/static/images/component-controllers.png differ diff --git a/docs/static/images/corner-rounding-flowchart-v2.png b/docs/static/images/corner-rounding-flowchart-v2.png new file mode 100755 index 00000000..71b50848 Binary files /dev/null and b/docs/static/images/corner-rounding-flowchart-v2.png differ diff --git a/docs/static/images/corner-rounding-movement.png b/docs/static/images/corner-rounding-movement.png new file mode 100755 index 00000000..1749d668 Binary files /dev/null and b/docs/static/images/corner-rounding-movement.png differ diff --git a/docs/static/images/corner-rounding-overlap.png b/docs/static/images/corner-rounding-overlap.png new file mode 100755 index 00000000..b69b3825 Binary files /dev/null and b/docs/static/images/corner-rounding-overlap.png differ diff --git a/docs/static/images/corner-rounding-scrolling.png b/docs/static/images/corner-rounding-scrolling.png new file mode 100755 index 00000000..ef291517 Binary files /dev/null and b/docs/static/images/corner-rounding-scrolling.png differ diff --git a/docs/static/images/example-app-screenshots/ASCollectionView.png b/docs/static/images/example-app-screenshots/ASCollectionView.png new file mode 100755 index 00000000..3aaff368 Binary files /dev/null and b/docs/static/images/example-app-screenshots/ASCollectionView.png differ diff --git a/docs/static/images/example-app-screenshots/ASDKLayoutTransition.gif b/docs/static/images/example-app-screenshots/ASDKLayoutTransition.gif new file mode 100755 index 00000000..c7546716 Binary files /dev/null and b/docs/static/images/example-app-screenshots/ASDKLayoutTransition.gif differ diff --git a/docs/static/images/example-app-screenshots/ASDKTube.gif b/docs/static/images/example-app-screenshots/ASDKTube.gif new file mode 100755 index 00000000..956a5c04 Binary files /dev/null and b/docs/static/images/example-app-screenshots/ASDKTube.gif differ diff --git a/docs/static/images/example-app-screenshots/ASDKgram.png b/docs/static/images/example-app-screenshots/ASDKgram.png new file mode 100755 index 00000000..358dae38 Binary files /dev/null and b/docs/static/images/example-app-screenshots/ASDKgram.png differ diff --git a/docs/static/images/example-app-screenshots/ASMapNode.png b/docs/static/images/example-app-screenshots/ASMapNode.png new file mode 100755 index 00000000..aa605349 Binary files /dev/null and b/docs/static/images/example-app-screenshots/ASMapNode.png differ diff --git a/docs/static/images/example-app-screenshots/ASTableViewStressTest.png b/docs/static/images/example-app-screenshots/ASTableViewStressTest.png new file mode 100755 index 00000000..cd7aae2d Binary files /dev/null and b/docs/static/images/example-app-screenshots/ASTableViewStressTest.png differ diff --git a/docs/static/images/example-app-screenshots/ASViewController.png b/docs/static/images/example-app-screenshots/ASViewController.png new file mode 100755 index 00000000..545f3c8d Binary files /dev/null and b/docs/static/images/example-app-screenshots/ASViewController.png differ diff --git a/docs/static/images/example-app-screenshots/AsyncDisplayKitOverview.png b/docs/static/images/example-app-screenshots/AsyncDisplayKitOverview.png new file mode 100755 index 00000000..4941292c Binary files /dev/null and b/docs/static/images/example-app-screenshots/AsyncDisplayKitOverview.png differ diff --git a/docs/static/images/example-app-screenshots/BackgroundPropertySetting.gif b/docs/static/images/example-app-screenshots/BackgroundPropertySetting.gif new file mode 100755 index 00000000..e2655ef2 Binary files /dev/null and b/docs/static/images/example-app-screenshots/BackgroundPropertySetting.gif differ diff --git a/docs/static/images/example-app-screenshots/CatDealsCollectionView.png b/docs/static/images/example-app-screenshots/CatDealsCollectionView.png new file mode 100755 index 00000000..72f9179e Binary files /dev/null and b/docs/static/images/example-app-screenshots/CatDealsCollectionView.png differ diff --git a/docs/static/images/example-app-screenshots/CollectionViewWithViewControllerCells.png b/docs/static/images/example-app-screenshots/CollectionViewWithViewControllerCells.png new file mode 100755 index 00000000..078b7b94 Binary files /dev/null and b/docs/static/images/example-app-screenshots/CollectionViewWithViewControllerCells.png differ diff --git a/docs/static/images/example-app-screenshots/CustomCollectionView.gif b/docs/static/images/example-app-screenshots/CustomCollectionView.gif new file mode 100755 index 00000000..8d8a2aed Binary files /dev/null and b/docs/static/images/example-app-screenshots/CustomCollectionView.gif differ diff --git a/docs/static/images/example-app-screenshots/EditableText.png b/docs/static/images/example-app-screenshots/EditableText.png new file mode 100755 index 00000000..1aa8d6db Binary files /dev/null and b/docs/static/images/example-app-screenshots/EditableText.png differ diff --git a/docs/static/images/example-app-screenshots/HorizontalwithinVerticalScrolling.gif b/docs/static/images/example-app-screenshots/HorizontalwithinVerticalScrolling.gif new file mode 100755 index 00000000..fe722a30 Binary files /dev/null and b/docs/static/images/example-app-screenshots/HorizontalwithinVerticalScrolling.gif differ diff --git a/docs/static/images/example-app-screenshots/Kittens.png b/docs/static/images/example-app-screenshots/Kittens.png new file mode 100755 index 00000000..91d9bf36 Binary files /dev/null and b/docs/static/images/example-app-screenshots/Kittens.png differ diff --git a/docs/static/images/example-app-screenshots/LayoutSpecPlayground.png b/docs/static/images/example-app-screenshots/LayoutSpecPlayground.png new file mode 100755 index 00000000..9ed4db7c Binary files /dev/null and b/docs/static/images/example-app-screenshots/LayoutSpecPlayground.png differ diff --git a/docs/static/images/example-app-screenshots/Multiplex.gif b/docs/static/images/example-app-screenshots/Multiplex.gif new file mode 100755 index 00000000..fcb98cad Binary files /dev/null and b/docs/static/images/example-app-screenshots/Multiplex.gif differ diff --git a/docs/static/images/example-app-screenshots/PagerNode.gif b/docs/static/images/example-app-screenshots/PagerNode.gif new file mode 100755 index 00000000..8c13a0fa Binary files /dev/null and b/docs/static/images/example-app-screenshots/PagerNode.gif differ diff --git a/docs/static/images/example-app-screenshots/SocialAppLayout.png b/docs/static/images/example-app-screenshots/SocialAppLayout.png new file mode 100755 index 00000000..33d66721 Binary files /dev/null and b/docs/static/images/example-app-screenshots/SocialAppLayout.png differ diff --git a/docs/static/images/example-app-screenshots/Swift.png b/docs/static/images/example-app-screenshots/Swift.png new file mode 100755 index 00000000..b099a172 Binary files /dev/null and b/docs/static/images/example-app-screenshots/Swift.png differ diff --git a/docs/static/images/example-app-screenshots/SynchronousConcurrency.png b/docs/static/images/example-app-screenshots/SynchronousConcurrency.png new file mode 100755 index 00000000..e0eac378 Binary files /dev/null and b/docs/static/images/example-app-screenshots/SynchronousConcurrency.png differ diff --git a/docs/static/images/example-app-screenshots/VerticalWithinHorizontalScrolling.gif b/docs/static/images/example-app-screenshots/VerticalWithinHorizontalScrolling.gif new file mode 100755 index 00000000..c50474b1 Binary files /dev/null and b/docs/static/images/example-app-screenshots/VerticalWithinHorizontalScrolling.gif differ diff --git a/docs/static/images/example-app-screenshots/VideoTableView.png b/docs/static/images/example-app-screenshots/VideoTableView.png new file mode 100755 index 00000000..ddeefdc7 Binary files /dev/null and b/docs/static/images/example-app-screenshots/VideoTableView.png differ diff --git a/docs/static/images/example-app-screenshots/Videos.gif b/docs/static/images/example-app-screenshots/Videos.gif new file mode 100755 index 00000000..5e5c5f2c Binary files /dev/null and b/docs/static/images/example-app-screenshots/Videos.gif differ diff --git a/docs/static/images/favicon/android-icon-144x144.png b/docs/static/images/favicon/android-icon-144x144.png new file mode 100755 index 00000000..68d4423f Binary files /dev/null and b/docs/static/images/favicon/android-icon-144x144.png differ diff --git a/docs/static/images/favicon/android-icon-192x192.png b/docs/static/images/favicon/android-icon-192x192.png new file mode 100755 index 00000000..c7e107a2 Binary files /dev/null and b/docs/static/images/favicon/android-icon-192x192.png differ diff --git a/docs/static/images/favicon/android-icon-36x36.png b/docs/static/images/favicon/android-icon-36x36.png new file mode 100755 index 00000000..b0da36b5 Binary files /dev/null and b/docs/static/images/favicon/android-icon-36x36.png differ diff --git a/docs/static/images/favicon/android-icon-48x48.png b/docs/static/images/favicon/android-icon-48x48.png new file mode 100755 index 00000000..ed535105 Binary files /dev/null and b/docs/static/images/favicon/android-icon-48x48.png differ diff --git a/docs/static/images/favicon/android-icon-72x72.png b/docs/static/images/favicon/android-icon-72x72.png new file mode 100755 index 00000000..97a2a207 Binary files /dev/null and b/docs/static/images/favicon/android-icon-72x72.png differ diff --git a/docs/static/images/favicon/android-icon-96x96.png b/docs/static/images/favicon/android-icon-96x96.png new file mode 100755 index 00000000..1ea7ba41 Binary files /dev/null and b/docs/static/images/favicon/android-icon-96x96.png differ diff --git a/docs/static/images/favicon/apple-icon-114x114.png b/docs/static/images/favicon/apple-icon-114x114.png new file mode 100755 index 00000000..c4f63ca5 Binary files /dev/null and b/docs/static/images/favicon/apple-icon-114x114.png differ diff --git a/docs/static/images/favicon/apple-icon-120x120.png b/docs/static/images/favicon/apple-icon-120x120.png new file mode 100755 index 00000000..5e1cf1af Binary files /dev/null and b/docs/static/images/favicon/apple-icon-120x120.png differ diff --git a/docs/static/images/favicon/apple-icon-144x144.png b/docs/static/images/favicon/apple-icon-144x144.png new file mode 100755 index 00000000..68d4423f Binary files /dev/null and b/docs/static/images/favicon/apple-icon-144x144.png differ diff --git a/docs/static/images/favicon/apple-icon-152x152.png b/docs/static/images/favicon/apple-icon-152x152.png new file mode 100755 index 00000000..d9a225aa Binary files /dev/null and b/docs/static/images/favicon/apple-icon-152x152.png differ diff --git a/docs/static/images/favicon/apple-icon-180x180.png b/docs/static/images/favicon/apple-icon-180x180.png new file mode 100755 index 00000000..6c40cd7b Binary files /dev/null and b/docs/static/images/favicon/apple-icon-180x180.png differ diff --git a/docs/static/images/favicon/apple-icon-57x57.png b/docs/static/images/favicon/apple-icon-57x57.png new file mode 100755 index 00000000..c9d74b6b Binary files /dev/null and b/docs/static/images/favicon/apple-icon-57x57.png differ diff --git a/docs/static/images/favicon/apple-icon-60x60.png b/docs/static/images/favicon/apple-icon-60x60.png new file mode 100755 index 00000000..7b440c60 Binary files /dev/null and b/docs/static/images/favicon/apple-icon-60x60.png differ diff --git a/docs/static/images/favicon/apple-icon-72x72.png b/docs/static/images/favicon/apple-icon-72x72.png new file mode 100755 index 00000000..97a2a207 Binary files /dev/null and b/docs/static/images/favicon/apple-icon-72x72.png differ diff --git a/docs/static/images/favicon/apple-icon-76x76.png b/docs/static/images/favicon/apple-icon-76x76.png new file mode 100755 index 00000000..0d5dd5f9 Binary files /dev/null and b/docs/static/images/favicon/apple-icon-76x76.png differ diff --git a/docs/static/images/favicon/apple-icon-precomposed.png b/docs/static/images/favicon/apple-icon-precomposed.png new file mode 100755 index 00000000..43549d71 Binary files /dev/null and b/docs/static/images/favicon/apple-icon-precomposed.png differ diff --git a/docs/static/images/favicon/apple-icon.png b/docs/static/images/favicon/apple-icon.png new file mode 100755 index 00000000..43549d71 Binary files /dev/null and b/docs/static/images/favicon/apple-icon.png differ diff --git a/docs/static/images/favicon/browserconfig.xml b/docs/static/images/favicon/browserconfig.xml new file mode 100755 index 00000000..c5541482 --- /dev/null +++ b/docs/static/images/favicon/browserconfig.xml @@ -0,0 +1,2 @@ + +#ffffff \ No newline at end of file diff --git a/docs/static/images/favicon/favicon-16x16.png b/docs/static/images/favicon/favicon-16x16.png new file mode 100755 index 00000000..4dc8bcf4 Binary files /dev/null and b/docs/static/images/favicon/favicon-16x16.png differ diff --git a/docs/static/images/favicon/favicon-32x32.png b/docs/static/images/favicon/favicon-32x32.png new file mode 100755 index 00000000..3ebcbef1 Binary files /dev/null and b/docs/static/images/favicon/favicon-32x32.png differ diff --git a/docs/static/images/favicon/favicon-96x96.png b/docs/static/images/favicon/favicon-96x96.png new file mode 100755 index 00000000..1ea7ba41 Binary files /dev/null and b/docs/static/images/favicon/favicon-96x96.png differ diff --git a/docs/static/images/favicon/favicon.ico b/docs/static/images/favicon/favicon.ico new file mode 100755 index 00000000..ecafdea6 Binary files /dev/null and b/docs/static/images/favicon/favicon.ico differ diff --git a/docs/static/images/favicon/manifest.json b/docs/static/images/favicon/manifest.json new file mode 100755 index 00000000..013d4a6a --- /dev/null +++ b/docs/static/images/favicon/manifest.json @@ -0,0 +1,41 @@ +{ + "name": "App", + "icons": [ + { + "src": "\/android-icon-36x36.png", + "sizes": "36x36", + "type": "image\/png", + "density": "0.75" + }, + { + "src": "\/android-icon-48x48.png", + "sizes": "48x48", + "type": "image\/png", + "density": "1.0" + }, + { + "src": "\/android-icon-72x72.png", + "sizes": "72x72", + "type": "image\/png", + "density": "1.5" + }, + { + "src": "\/android-icon-96x96.png", + "sizes": "96x96", + "type": "image\/png", + "density": "2.0" + }, + { + "src": "\/android-icon-144x144.png", + "sizes": "144x144", + "type": "image\/png", + "density": "3.0" + }, + { + "src": "\/android-icon-192x192.png", + "sizes": "192x192", + "type": "image\/png", + "density": "4.0" + } + ] +} \ No newline at end of file diff --git a/docs/static/images/favicon/ms-icon-144x144.png b/docs/static/images/favicon/ms-icon-144x144.png new file mode 100755 index 00000000..68d4423f Binary files /dev/null and b/docs/static/images/favicon/ms-icon-144x144.png differ diff --git a/docs/static/images/favicon/ms-icon-150x150.png b/docs/static/images/favicon/ms-icon-150x150.png new file mode 100755 index 00000000..8c1fc25b Binary files /dev/null and b/docs/static/images/favicon/ms-icon-150x150.png differ diff --git a/docs/static/images/favicon/ms-icon-310x310.png b/docs/static/images/favicon/ms-icon-310x310.png new file mode 100755 index 00000000..8d43edcd Binary files /dev/null and b/docs/static/images/favicon/ms-icon-310x310.png differ diff --git a/docs/static/images/favicon/ms-icon-70x70.png b/docs/static/images/favicon/ms-icon-70x70.png new file mode 100755 index 00000000..498e41ba Binary files /dev/null and b/docs/static/images/favicon/ms-icon-70x70.png differ diff --git a/docs/static/images/flexbasis.png b/docs/static/images/flexbasis.png new file mode 100755 index 00000000..28a9ad0b Binary files /dev/null and b/docs/static/images/flexbasis.png differ diff --git a/docs/static/images/intelligent-preloading-ranges-screenfuls.png b/docs/static/images/intelligent-preloading-ranges-screenfuls.png new file mode 100755 index 00000000..07b08f25 Binary files /dev/null and b/docs/static/images/intelligent-preloading-ranges-screenfuls.png differ diff --git a/docs/static/images/intelligent-preloading-ranges-with-names.png b/docs/static/images/intelligent-preloading-ranges-with-names.png new file mode 100755 index 00000000..b2ef62a7 Binary files /dev/null and b/docs/static/images/intelligent-preloading-ranges-with-names.png differ diff --git a/docs/static/images/intelligent-preloading-ranges.png b/docs/static/images/intelligent-preloading-ranges.png new file mode 100755 index 00000000..de884a13 Binary files /dev/null and b/docs/static/images/intelligent-preloading-ranges.png differ diff --git a/docs/static/images/intelligent-preloading.png b/docs/static/images/intelligent-preloading.png new file mode 100755 index 00000000..a24f31c8 Binary files /dev/null and b/docs/static/images/intelligent-preloading.png differ diff --git a/docs/static/images/kittenLink.png b/docs/static/images/kittenLink.png new file mode 100755 index 00000000..1c46390e Binary files /dev/null and b/docs/static/images/kittenLink.png differ diff --git a/docs/static/images/layout-api-sizing-1.png b/docs/static/images/layout-api-sizing-1.png new file mode 100755 index 00000000..dd004c3a Binary files /dev/null and b/docs/static/images/layout-api-sizing-1.png differ diff --git a/docs/static/images/layout-api-sizing-2.png b/docs/static/images/layout-api-sizing-2.png new file mode 100755 index 00000000..20814d84 Binary files /dev/null and b/docs/static/images/layout-api-sizing-2.png differ diff --git a/docs/static/images/layout-example-1.png b/docs/static/images/layout-example-1.png new file mode 100755 index 00000000..aac85798 Binary files /dev/null and b/docs/static/images/layout-example-1.png differ diff --git a/docs/static/images/layout-example-2.png b/docs/static/images/layout-example-2.png new file mode 100755 index 00000000..673c1672 Binary files /dev/null and b/docs/static/images/layout-example-2.png differ diff --git a/docs/static/images/layout-example-3.png b/docs/static/images/layout-example-3.png new file mode 100755 index 00000000..72f9179e Binary files /dev/null and b/docs/static/images/layout-example-3.png differ diff --git a/docs/static/images/layout-examples-photo-with-inset-text-overlay-diagram.png b/docs/static/images/layout-examples-photo-with-inset-text-overlay-diagram.png new file mode 100755 index 00000000..dbf95847 Binary files /dev/null and b/docs/static/images/layout-examples-photo-with-inset-text-overlay-diagram.png differ diff --git a/docs/static/images/layout-examples-photo-with-inset-text-overlay-photo.png b/docs/static/images/layout-examples-photo-with-inset-text-overlay-photo.png new file mode 100755 index 00000000..2465aaa3 Binary files /dev/null and b/docs/static/images/layout-examples-photo-with-inset-text-overlay-photo.png differ diff --git a/docs/static/images/layout-examples-photo-with-inset-text-overlay.png b/docs/static/images/layout-examples-photo-with-inset-text-overlay.png new file mode 100755 index 00000000..020685ae Binary files /dev/null and b/docs/static/images/layout-examples-photo-with-inset-text-overlay.png differ diff --git a/docs/static/images/layout-examples-photo-with-outset-icon-overlay-icon.png b/docs/static/images/layout-examples-photo-with-outset-icon-overlay-icon.png new file mode 100755 index 00000000..22a1652b Binary files /dev/null and b/docs/static/images/layout-examples-photo-with-outset-icon-overlay-icon.png differ diff --git a/docs/static/images/layout-examples-photo-with-outset-icon-overlay-photo.png b/docs/static/images/layout-examples-photo-with-outset-icon-overlay-photo.png new file mode 100755 index 00000000..7d7bef7e Binary files /dev/null and b/docs/static/images/layout-examples-photo-with-outset-icon-overlay-photo.png differ diff --git a/docs/static/images/layout-examples-photo-with-outset-icon-overlay.png b/docs/static/images/layout-examples-photo-with-outset-icon-overlay.png new file mode 100755 index 00000000..46669c86 Binary files /dev/null and b/docs/static/images/layout-examples-photo-with-outset-icon-overlay.png differ diff --git a/docs/static/images/layout-examples-simple-header-with-left-right-justified-text-diagram.png b/docs/static/images/layout-examples-simple-header-with-left-right-justified-text-diagram.png new file mode 100755 index 00000000..c81e6f51 Binary files /dev/null and b/docs/static/images/layout-examples-simple-header-with-left-right-justified-text-diagram.png differ diff --git a/docs/static/images/layout-examples-simple-header-with-left-right-justified-text.png b/docs/static/images/layout-examples-simple-header-with-left-right-justified-text.png new file mode 100755 index 00000000..12966201 Binary files /dev/null and b/docs/static/images/layout-examples-simple-header-with-left-right-justified-text.png differ diff --git a/docs/static/images/layout-examples-simple-inset-text-cell-closeup.png b/docs/static/images/layout-examples-simple-inset-text-cell-closeup.png new file mode 100755 index 00000000..1b5b0d55 Binary files /dev/null and b/docs/static/images/layout-examples-simple-inset-text-cell-closeup.png differ diff --git a/docs/static/images/layout-examples-simple-inset-text-cell.png b/docs/static/images/layout-examples-simple-inset-text-cell.png new file mode 100755 index 00000000..b161af9e Binary files /dev/null and b/docs/static/images/layout-examples-simple-inset-text-cell.png differ diff --git a/docs/static/images/layout-examples-top-bottom-separator-line-diagram.png b/docs/static/images/layout-examples-top-bottom-separator-line-diagram.png new file mode 100755 index 00000000..eac57973 Binary files /dev/null and b/docs/static/images/layout-examples-top-bottom-separator-line-diagram.png differ diff --git a/docs/static/images/layout-examples-top-bottom-separator-line.png b/docs/static/images/layout-examples-top-bottom-separator-line.png new file mode 100755 index 00000000..38f1fd95 Binary files /dev/null and b/docs/static/images/layout-examples-top-bottom-separator-line.png differ diff --git a/docs/static/images/layout-spec-relationship-1.png b/docs/static/images/layout-spec-relationship-1.png new file mode 100755 index 00000000..a6ca2945 Binary files /dev/null and b/docs/static/images/layout-spec-relationship-1.png differ diff --git a/docs/static/images/layout-spec-relationship-2.png b/docs/static/images/layout-spec-relationship-2.png new file mode 100755 index 00000000..a21f0524 Binary files /dev/null and b/docs/static/images/layout-spec-relationship-2.png differ diff --git a/docs/static/images/layout2-api-sizing.png b/docs/static/images/layout2-api-sizing.png new file mode 100755 index 00000000..0a7f0543 Binary files /dev/null and b/docs/static/images/layout2-api-sizing.png differ diff --git a/docs/static/images/layoutSpec-examples/layout-example-inset-overlay.png b/docs/static/images/layoutSpec-examples/layout-example-inset-overlay.png new file mode 100755 index 00000000..f10f8f0f Binary files /dev/null and b/docs/static/images/layoutSpec-examples/layout-example-inset-overlay.png differ diff --git a/docs/static/images/layoutSpec-types/ASBackgroundLayoutSpec-diagram.png b/docs/static/images/layoutSpec-types/ASBackgroundLayoutSpec-diagram.png new file mode 100755 index 00000000..5b365c02 Binary files /dev/null and b/docs/static/images/layoutSpec-types/ASBackgroundLayoutSpec-diagram.png differ diff --git a/docs/static/images/layoutSpec-types/ASCenterLayoutSpec-diagram-text.png b/docs/static/images/layoutSpec-types/ASCenterLayoutSpec-diagram-text.png new file mode 100755 index 00000000..7559e73d Binary files /dev/null and b/docs/static/images/layoutSpec-types/ASCenterLayoutSpec-diagram-text.png differ diff --git a/docs/static/images/layoutSpec-types/ASCenterLayoutSpec-diagram.png b/docs/static/images/layoutSpec-types/ASCenterLayoutSpec-diagram.png new file mode 100755 index 00000000..040b5ce8 Binary files /dev/null and b/docs/static/images/layoutSpec-types/ASCenterLayoutSpec-diagram.png differ diff --git a/docs/static/images/layoutSpec-types/ASInsetLayoutSpec-diagram-text.png b/docs/static/images/layoutSpec-types/ASInsetLayoutSpec-diagram-text.png new file mode 100755 index 00000000..f4e3810a Binary files /dev/null and b/docs/static/images/layoutSpec-types/ASInsetLayoutSpec-diagram-text.png differ diff --git a/docs/static/images/layoutSpec-types/ASInsetLayoutSpec-diagram.png b/docs/static/images/layoutSpec-types/ASInsetLayoutSpec-diagram.png new file mode 100755 index 00000000..6ee3642f Binary files /dev/null and b/docs/static/images/layoutSpec-types/ASInsetLayoutSpec-diagram.png differ diff --git a/docs/static/images/layoutSpec-types/ASInsetLayoutSpec-example-complex.png b/docs/static/images/layoutSpec-types/ASInsetLayoutSpec-example-complex.png new file mode 100755 index 00000000..ca08d0c9 Binary files /dev/null and b/docs/static/images/layoutSpec-types/ASInsetLayoutSpec-example-complex.png differ diff --git a/docs/static/images/layoutSpec-types/ASOverlayLayouSpec-diagram.png b/docs/static/images/layoutSpec-types/ASOverlayLayouSpec-diagram.png new file mode 100755 index 00000000..7bba2cf0 Binary files /dev/null and b/docs/static/images/layoutSpec-types/ASOverlayLayouSpec-diagram.png differ diff --git a/docs/static/images/layoutSpec-types/ASOverlayLayoutSpec-example-diagram.png b/docs/static/images/layoutSpec-types/ASOverlayLayoutSpec-example-diagram.png new file mode 100755 index 00000000..deda779f Binary files /dev/null and b/docs/static/images/layoutSpec-types/ASOverlayLayoutSpec-example-diagram.png differ diff --git a/docs/static/images/layoutSpec-types/ASRatioLayoutSpec-diagram.png b/docs/static/images/layoutSpec-types/ASRatioLayoutSpec-diagram.png new file mode 100755 index 00000000..eac1fd3b Binary files /dev/null and b/docs/static/images/layoutSpec-types/ASRatioLayoutSpec-diagram.png differ diff --git a/docs/static/images/layoutable-types.png b/docs/static/images/layoutable-types.png new file mode 100755 index 00000000..6ac3e9d1 Binary files /dev/null and b/docs/static/images/layoutable-types.png differ diff --git a/docs/static/images/liveMap.gif b/docs/static/images/liveMap.gif new file mode 100755 index 00000000..633d1fb3 Binary files /dev/null and b/docs/static/images/liveMap.gif differ diff --git a/docs/static/images/logo.png b/docs/static/images/logo.png new file mode 100755 index 00000000..f00f5ba5 Binary files /dev/null and b/docs/static/images/logo.png differ diff --git a/docs/static/images/mapWithAnnotation.png b/docs/static/images/mapWithAnnotation.png new file mode 100755 index 00000000..e6316293 Binary files /dev/null and b/docs/static/images/mapWithAnnotation.png differ diff --git a/docs/static/images/node-hierarchy.png b/docs/static/images/node-hierarchy.png new file mode 100755 index 00000000..8f0c021b Binary files /dev/null and b/docs/static/images/node-hierarchy.png differ diff --git a/docs/static/images/node-view-layer.png b/docs/static/images/node-view-layer.png new file mode 100755 index 00000000..544294af Binary files /dev/null and b/docs/static/images/node-view-layer.png differ diff --git a/docs/static/images/overlay-vs-inset-spec.png b/docs/static/images/overlay-vs-inset-spec.png new file mode 100755 index 00000000..2da1be2d Binary files /dev/null and b/docs/static/images/overlay-vs-inset-spec.png differ diff --git a/docs/static/images/satelliteMap.png b/docs/static/images/satelliteMap.png new file mode 100755 index 00000000..702f12b2 Binary files /dev/null and b/docs/static/images/satelliteMap.png differ diff --git a/docs/static/images/textNodeTruncation.png b/docs/static/images/textNodeTruncation.png new file mode 100755 index 00000000..a5125a81 Binary files /dev/null and b/docs/static/images/textNodeTruncation.png differ diff --git a/docs/static/images/video.gif b/docs/static/images/video.gif new file mode 100755 index 00000000..dd9bab6a Binary files /dev/null and b/docs/static/images/video.gif differ diff --git a/docs/static/linkify.js b/docs/static/linkify.js new file mode 100755 index 00000000..b6adfbd5 --- /dev/null +++ b/docs/static/linkify.js @@ -0,0 +1,22 @@ +[].slice.apply( + document.querySelectorAll( + 'article h2, article h3, article h4' + ) +).forEach(function(header) { + var slug = header.innerText + .toLowerCase() + .replace(/[^a-z0-9]/g, '-') + .replace(/-+/g, '-') + .replace(/^-|-$/g, ''); + + var hashref = document.createElement('a'); + hashref.id = slug; + hashref.className = 'hashref'; + header.appendChild(hashref); + + var hash = document.createElement('a'); + hash.className = 'hash'; + hash.href = '#' + slug; + hash.innerText = '#'; + header.appendChild(hash); +}); diff --git a/docs/static/main-old.css b/docs/static/main-old.css new file mode 100755 index 00000000..0b995e40 --- /dev/null +++ b/docs/static/main-old.css @@ -0,0 +1,806 @@ +* { + padding: 0; + margin: 0; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-text-size-adjust: 100%; +} + +html { + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + background-color: #FFFFFF; +} + +body { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-family: proxima-nova, "Helvetica Neue", Helvetica, Arial, sans-serif; + font-weight: 300; + color: #444; + margin: 0; + padding-top: 50px; + line-height: 22px; + +} + +h1, h2, h3, h4 { + font-weight: normal; + margin: 1.3em 0 0.2em; + line-height: 1.4em; + position: relative; +} + +td { + vertical-align: top; +} + +h1:first-child, h2:first-child, h3:first-child, h4:first-child { + margin-top: 0; +} + +h1 { + font-size: 2em; + font-weight: bold; +} + +h2 { + font-size: 1.5em; +} + +h3 { + font-size: 1.3em; +} + +h4 { + font-size: 1.1em; +} + +p, ul, ol { + margin: 0 0 1em 0; +} + +.wrap { + width: 960px; + margin-left: auto; + margin-right: auto; + padding-left: 20px; + padding-right: 20px +} + +.subhero .wrap { + width: auto; + max-width: 960px; +} + +.home-section { + width: 500px; + margin-left: auto; + margin-right: auto; +} + +code { + letter-spacing: 0.02em; + padding: 2px 4px; + border-radius: 3px; + /*font-weight: 700; + color: #008ED4; + font-size: 14px; + vertical-align: baseline; + font-family: 'Droid Sans Mono',sans-serif;*/ +} + +p code, span code, li code { + border: 1px solid rgb(220, 220, 220); + background-color: rgba(135, 215, 255, 0.2); +} + +.highlight pre, .redhighlight pre { + font-size: 13px; + line-height: 20px; + padding: 0 10px 20px 10px; +} + +.highlighttable { + margin-left: 10px; + margin-bottom: 20px; + margin-right: 10px; + border-collapse: separate !important; +} + +.highlighttable .highlight pre, .highlighttable .redhighlight pre { + padding: 0; +} + +.highlighttable code { + padding-right: 10px; + margin: 0; + padding-left: 2px; + font-size: 12px; + display: block; + line-height: 20px; + white-space: pre; + color: hsl(210, 100%, 8%); +} + +.highlight pre code, .redhighlight pre code, .highlighttable { + overflow-x: scroll; + display: block; + padding: 0; + font-size: 13px; + border: 1px solid rgb(220, 220, 220); + padding: 5px 10px; + box-sizing: border-box; + border-radius: 3; +} + +.highlight pre code, .highlighttable { + background-color: rgba(90, 140, 140, 0.1); +} + +.redhighlight pre code { + background-color: rgba(180, 80, 80, 0.1); +} + + +.highlight pre code, .redhighlight pre code { + width: 100%; + white-space: pre; +} + +.lineno { + color: rgb(214, 139, 0); +} + +.lineno::after { + content: ';'; + font-size: 0; +} + +.highlight + .highlight + .highlight, +.highlighttable + .highlight + .highlight, +.redhighlight + .redhighlight + .redhighlight +.highlighttable + .redhighlight + .redhighlight { + margin-top: -20px; +} + + +ul, ol { + list-style-position: outside; + margin-left: 1em; + padding-left: 1em; +} + + +a { + text-decoration: none; + color: #1C9BC7; +} + +nav.toc a { + color: #444; +} +nav.toc a.active { + color: #1C9BC7; +} + +a.hash-link { + color: #ccc; +} + +a.hash-link:hover { + color: #1C9BC7; +} + +.width { + margin: 0 auto; + padding: 0 20px; +} + +header:after, section.content:after, footer:after { + clear: both; + content: "."; + display: block; + font-size: 0; + height: 0; + line-height: 0; + visibility: hidden; +} + +header.topbar { + background: #F8F8F8; + color: #424242; + position: fixed; + top: 0; + height: 50px; + box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); + width: 100%; + z-index: 100; +} + +header.topbar .logo { + margin-top: 9px; + height: 30px; +} + +.componentkit-header { + background-image: url(componentkit-hero-logo.png); + background-size: 660px; + background-position: 50% 50%; + background-repeat: no-repeat; + height: 280px; +} + +header.topbar nav ul { + float: right; + text-align: right; + padding: 0; + margin: 0; +} + +header.topbar nav ul li { + display: inline; + font-weight: bold; +} + +header.topbar nav ul li a { + padding: 0 8px; + line-height: 50px; + display: inline-block; + height: 50px; + color: #828282; + font-size: 15px; +} + +header.topbar nav ul li a.active { + color: #111111; + font-style: underline; +} + +header.topbar nav ul li a:hover { + color: #111111; + font-style: underline; +} + +header.hero { + padding: 20px 0; +} + +header.hero .width { + text-align: center; +} + +footer.copyright .width { + text-align: center; +} +header.hero h1 { + font-size: 4em; + font-weight: normal; + color: #bb2910; + margin: 0; + line-height: 1.5em; +} + +header.hero p { + font-size: 1.4em; + margin-bottom: 40px; +} + +header.hero a.button { + background-color: #20AECF; + border: 1px solid #1D9CC8; + border-radius: 3px; + color: #ffffff; + font-weight: bold; + padding: 10px 20px; + display: inline-block; + margin: 1em; +} + +header.subhero { + padding: 10px 0; + padding-top: 30px; +} + +section.content { + padding: 20px 0; +} + +section.content article ul li, +section.content article ol li { + margin-bottom: 0.5em; +} + + +section.content article img { + display: block; + margin: 1em auto; + max-width: 100%; +} + +section.content article blockquote { + padding: 5px 10px; + margin-left: 20px; + margin-bottom: 10px; + font-weight: bold; +} + +section.content article blockquote p { + margin: 0; +} + +section.content article blockquote p:first-child { + float: left; + margin-right: 5px; + color: hsl(19, 100%, 42%); +} + +section.content article blockquote p { + font-style: italic; +} + +section.content article blockquote small:before { + content: '\2014 \00A0'; +} + +section.content article.withtoc { + position: relative; +} + +section.content article .read-more { + font-weight: bold; + text-align: right; +} + +section.content article hr.blogpostend { + margin-bottom: 20px; + margin-top: 20px; +} + +section.content aside .fb-like { + top: 4px; + left: 4px; +} + +.edit-page-link { + float: right; + font-size: 12px; + font-weight: normal; + line-height: 20px; + opacity: 0.6; + transition: opacity 0.5s; +} + +.edit-page-link:hover { + opacity: 1; +} + +nav.toc { + font-size: 14px; + line-height: 18px; + margin-bottom: 20px; +} + +nav.toc h3 { + margin: 0.5em 0; + padding-top: 0.5em; + font-size: 14px; + font-weight: bold; + line-height: 40px; +} + +nav.toc section:first-child h3 { + border-top: none; + margin-top: 0; + padding-top: 0; +} + +nav.toc ul { + list-style: none; + margin: 0; + padding-left: 0; +} + +nav.toc ul li { + line-height: 20px; +} + +footer { + padding: 5px 0; + padding-bottom: 10px; + font-size: 13px; + text-align: right; +} + +.right { + float: right; +} + +.right a { + color: #cd4e34; + padding: 0 5px; +} + +.hash { + margin-left: 3px; + visibility: hidden; +} + +*:hover > .hash { + visibility: visible; +} + +.hashref { + position: absolute; + top: -60px; + left: 0; +} + +.note { + padding: 10px; + border-radius: 3px; + background-color: #EFF7FF; + border: 1px solid #CCDDFF; + margin-bottom: 20px; +} + +.note p:before { + content: "NOTE:"; + font-weight: bold; +} + +.note p { + margin-bottom: 0px; +} + +.note-important { + padding: 10px; + border-radius: 3px; + background-color: #FFCCCC; + border: 1px solid #FF8899; + margin-bottom: 20px; +} + +.note-important p:before { + content: "IMPORTANT:"; + font-weight: bold; +} + +.note-important p { + margin-bottom: 0px; +} + +/* desktopish */ + +@media (min-width: 481px) { + + .width { + max-width: 960px; + /* make columns add to <880 for 60 gutter */ + } + .content .width { + width: 960px; + } + + .panel3 { + width: 29%; + margin: 1em 2% 0; + display:inline-block; + vertical-align: top; + font-size: 14px; + } + + section.content article { + margin: 0 auto; + width: 660px; + } + + section.content nav.toc { + float: left; + } + + + section.content article.withtoc { + float: right; + } + + section.content aside { + float: left; + width: 220px; + } + +} + +/* phoneish */ + +@media (max-width: 480px) { + .wrap, .content .width, .home-section, section.content article { + width: auto; + max-width: 100%; + overflow-x: scroll; + } + + header.topbar .width { + padding: 0 5px; + } + + .highlighttable, section.content article blockquote { + margin-left: 0; + } + .highlight pre { + padding-left: 0; + } + body { + padding-bottom: 20px; + } + + #\_ { + display: block; + position: absolute; + top: -60px; + left: 0; + } +} + +.video-thumbnail { + margin-top: 1em; + margin-bottom: 1em; + background-image: url(atscaletalk.jpg); + background-size: 660px; + background-position: 50% 50%; + background-repeat: no-repeat; + height: 320px; + width: 100%; + cursor: pointer; +} + +.site-title { + font-size: 26px; + line-height: 56px; + letter-spacing: -1px; + margin-bottom: 0; + float: left; } + .site-title, .site-title:visited { + color: #424242; } + .site-title:hover { + text-decoration: none; } + +/** + * Links + */ +a { + color: #21b6ff; + text-decoration: none; } + a:visited { + color: #008ed4; } + a:hover { + color: #111; + text-decoration: underline; } + +/** + * Syntax highlighting styles + */ +/* not official Xcode colors, but looks better on the web */ +.highlight { + background: #fff; } + .highlight .c { + color: #008d14; + font-style: italic; } + .highlight .err { + color: #a61717; + background-color: #e3d2d2; } + .highlight .k { + color: #103ffb; } + .highlight .cm { + color: #008d14; + font-style: italic; } + .highlight .cp { + color: #b72748; } + .highlight .c1 { + color: #008d14; + font-style: italic; } + .highlight .cs { + color: #008d14; + font-weight: bold; + font-style: italic; } + .highlight .gd { + color: #000; + background-color: #fdd; } + .highlight .gd .x { + color: #000; + background-color: #faa; } + .highlight .ge { + font-style: italic; } + .highlight .gr { + color: #a00; } + .highlight .gh { + color: #999; } + .highlight .gi { + color: #000; + background-color: #dfd; } + .highlight .gi .x { + color: #000; + background-color: #afa; } + .highlight .go { + color: #888; } + .highlight .gp { + color: #555; } + .highlight .gs { + font-weight: bold; } + .highlight .gu { + color: #aaa; } + .highlight .gt { + color: #a00; } + .highlight .kc { + color: orange; } + .highlight .kd { + color: orange; } + .highlight .kp { + color: #008d14; } + .highlight .kr { + color: #008d14; } + .highlight .kt { + color: #103ffb; } + .highlight .m { + color: orange; } + .highlight .s { + color: #b72748; } + .highlight .na { + color: orange; } + .highlight .nb { + color: #103ffb; } + .highlight .nc { + color: #3a95ba; } + .highlight .no { + color: orange; } + .highlight .ni { + color: orange; } + .highlight .ne { + color: orange; } + .highlight .nn { + color: orange; } + .highlight .nt { + color: orange; } + .highlight .w { + color: #bbb; } + .highlight .mh { + color: black; } + .highlight .mi { + color: black; } + .highlight .mo { + color: black; } + .highlight .il { + color: black; } + .highlight .sb { + color: #d14; } + .highlight .sc { + color: #d14; } + .highlight .sd { + color: #d14; } + .highlight .s2 { + color: #d14; } + .highlight .se { + color: #d14; } + .highlight .sh { + color: #d14; } + .highlight .si { + color: #d14; } + .highlight .sx { + color: #d14; } + .highlight .sr { + color: orange; } + .highlight .s1 { + color: #b72748; } + .highlight .ss { + color: #b72748; } + .highlight .bp { + color: #3a95ba; } + .highlight .vc { + color: #3a95ba; } + .highlight .vg { + color: black; } + .highlight .vi { + color: orange; } + .highlight .nl { + color: #3a95ba; } + +.site-header { + border-top: 5px solid #424242; + border-bottom: 1px solid #e8e8e8; + min-height: 56px; + background-color: #f8f8f8; + position: relative; +} + +.post-title { + font-size: 42px; + letter-spacing: -1px; + line-height: 1; } + @media screen and (max-width: 800px) { + .post-title { + font-size: 36px; } } + .post-title .edit-page-link { + font-size: 18px; } + + +body { + background-color: #fff; + color: #333; + font-family: "Helvetica Neue",Helvetica,Roboto,Arial,sans-serif; + font-size: 1em; + line-height: 1.5; +} + +.language-toggle { + display: block; + box-sizing: border-box; + font-size: 125% + -webkit-font-smoothing: antialiased; + line-height: 1.5; + margin-bottom: 1em; + padding-right: 10px; +} +.language-toggle a.active { + color: #222220 !important; +} +.language-toggle a { + cursor: pointer; + display: block; + float: right; + padding-left: 0.5em; + + color: #a3a39e !important; + text-decoration: none; + transition: color 0.1s linear; +} +.language-toggle:after { + content: ""; + display: table; + clear: both; +} + +.highlight-group { + margin-top: 1em; + font-family: BodyFontFamily,"Georgia Pro",Georgia,Times; + margin: 0; + border-top: 3px #1C9BC7 solid; + background: #f8f7f5; + border-radius: 4px; +} + +.hidden { + display: none; +} +.code { + padding-left: 20px; + padding-bottom: 10px; + overflow: auto; +} +pre { + font-family: 'Inconsolata' !important; + font-weight: 500; + color: #333333; +} + +.paddingBetweenCols th { + text-align: left; + padding: 15px 15px 15px 15px; +} + +.paddingBetweenCols td { + padding: 15px 15px 15px 15px; +/* border: 1 px solid black;*/ +} + +.paddingBetweenCols tr:nth-child(even){ + background-color: #f2f2f2 +} + +.paddingBetweenColsNoColor th { + text-align: left; + padding: 15px 15px 15px 15px; +} + +.paddingBetweenColsNoColor td { + padding: 15px 15px 15px 15px; +} diff --git a/docs/static/main.css b/docs/static/main.css new file mode 100755 index 00000000..0c9ea8f6 --- /dev/null +++ b/docs/static/main.css @@ -0,0 +1,531 @@ +* { + padding: 0; + margin: 0; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-text-size-adjust: 100%; +} + +html { + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + background-color: #FFFFFF; +} + +body { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-family: proxima-nova, "Helvetica Neue", Helvetica, Arial, sans-serif; + font-weight: 400; + color: #444; + margin: 0; + line-height: 22px; + +} + +h1, h2, h3, h4 { + font-weight: normal; + margin: 1.3em 0 0.2em; + line-height: 1.4em; + position: relative; +} + +td { + vertical-align: top; +} + +h1:first-child, h2:first-child, h3:first-child, h4:first-child { + margin-top: 0; +} + +h1 { + font-size: 2em; + font-weight: bold; +} + +h2 { + font-size: 1.5em; +} + +h3 { + font-size: 1.3em; +} + +h4 { + font-size: 1.1em; +} + +p, ul, ol { + margin: 0 0 1em 0; +} + +a { + color: #0484f2; + text-decoration: none; +} + +.btn { + padding: 10px 20px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + background: #0f70dd; + color: #fff; + display: inline-block; + text-decoration: none; + font-weight: bold; +} + +.container { + width: 90%; + margin: 0 auto; + clear: both; +} + +#logo { + +} + +header { + padding: 30px 0 10px 0; + background: #f8f8f8; +} + +header h1 { + position: relative; + top: -5px; +} + +header nav { + margin-top: 10px; + font-size: 18px; +} + +header nav ul { + list-style: none; +} + +header nav ul li { + float: left; + margin-right: 20px; +} + +header nav ul li a { + color: #0484f2; + text-decoration: none; +} + +.hero { + background: #0f70dd; + margin-bottom: 30px; + padding: 30px 0; +} +.hero .hero-title { + text-shadow: 5px 5px #1476A2; + font-size: 45px; + line-height: 110%; + color: #fff; + margin-bottom: 20px; +} +.hero .btn { + background: #fff; + color: #0f70dd; + border: 2px solid #fff; + margin-right: 10px; +} + + +.hero .btn.btn-outlined { + background: none; + border: 2px solid #fff; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + color: #fff; +} + +.container-margin { + margin-top: 30px; +} + +.container .sidebar { + font-size: 14px; +} +.container .sidebar ul { + list-style: none; +} +.container .sidebar ul li { + list-style: none; +} +.container .sidebar a.active { + font-weight: bold; +} + +.container .content { +} + + +.container tr > td { + padding-bottom: 30px; +} + +.container tr td img { + display: inline-block; + margin-bottom: 5px; +} + +.container tr td b { + padding-bottom: 5px; + display: inline-block; +} + +.roundrect { + border: 1px solid #f4f4f4; + -webkit-border-radius: 20px; + -moz-border-radius: 20px; + border-radius: 20px; +} + + +.container .content ul, .container .content ol { + margin-left: 20px; + margin-bottom: 30px; +} + +.content p img { + display: block; + margin: 1em auto; + max-width: 100%; +} + +.edit-page-link { + font-size: 14px; +} + + + +code { + letter-spacing: 0.02em; + padding: 2px 4px; + /*font-weight: 700; + color: #008ED4; + font-size: 14px; + vertical-align: baseline; + font-family: 'Droid Sans Mono',sans-serif;*/ +} + +p code, span code, li code { + background-color: rgba(135, 215, 255, 0.2); +} + +.paddingBetweenCols th { + text-align: left; + padding: 15px 15px 15px 15px; +} + +.paddingBetweenCols td { + padding: 15px 15px 15px 15px; +/* border: 1 px solid black;*/ +} + +.highlight pre, .redhighlight pre { + font-size: 13px; + line-height: 20px; + padding: 0 10px 20px 10px; +} + +.highlighttable { + margin-left: 10px; + margin-bottom: 20px; + margin-right: 10px; + border-collapse: separate !important; +} + +.highlighttable .highlight pre, .highlighttable .redhighlight pre { + padding: 0; +} + +.highlighttable code { + padding-right: 10px; + margin: 0; + padding-left: 2px; + font-size: 12px; + display: block; + line-height: 20px; + white-space: pre; + color: hsl(210, 100%, 8%); +} + +.highlight pre code, .redhighlight pre code, .highlighttable { + overflow-x: scroll; + display: block; + padding: 0; + font-size: 13px; + border: 1px solid rgb(220, 220, 220); + padding: 5px 10px; + box-sizing: border-box; + border-radius: 3; +} + +.highlight pre code, .highlighttable { + background-color: rgba(90, 140, 140, 0.1); +} + +.redhighlight pre code { + background-color: rgba(180, 80, 80, 0.1); +} + +.showcasetable code { + padding: 10px 10px 30px 30px; + margin: 10; +} + + +.highlight pre code, .redhighlight pre code { + width: 100%; + white-space: pre; +} + +.lineno { + color: rgb(214, 139, 0); +} + +.lineno::after { + content: ';'; + font-size: 0; +} + +.highlight + .highlight + .highlight, +.highlighttable + .highlight + .highlight, +.redhighlight + .redhighlight + .redhighlight +.highlighttable + .redhighlight + .redhighlight { + margin-top: -20px; +} + + +/** + * Syntax highlighting styles + */ +/* not official Xcode colors, but looks better on the web */ +.highlight { + background: #fff; } + .highlight .c { + color: #008d14; + font-style: italic; } + .highlight .err { + color: #a61717; + background-color: #e3d2d2; } + .highlight .k { + color: #103ffb; } + .highlight .cm { + color: #008d14; + font-style: italic; } + .highlight .cp { + color: #b72748; } + .highlight .c1 { + color: #008d14; + font-style: italic; } + .highlight .cs { + color: #008d14; + font-weight: bold; + font-style: italic; } + .highlight .gd { + color: #000; + background-color: #fdd; } + .highlight .gd .x { + color: #000; + background-color: #faa; } + .highlight .ge { + font-style: italic; } + .highlight .gr { + color: #a00; } + .highlight .gh { + color: #999; } + .highlight .gi { + color: #000; + background-color: #dfd; } + .highlight .gi .x { + color: #000; + background-color: #afa; } + .highlight .go { + color: #888; } + .highlight .gp { + color: #555; } + .highlight .gs { + font-weight: bold; } + .highlight .gu { + color: #aaa; } + .highlight .gt { + color: #a00; } + .highlight .kc { + color: orange; } + .highlight .kd { + color: orange; } + .highlight .kp { + color: #008d14; } + .highlight .kr { + color: #008d14; } + .highlight .kt { + color: #103ffb; } + .highlight .m { + color: orange; } + .highlight .s { + color: #b72748; } + .highlight .na { + color: orange; } + .highlight .nb { + color: #103ffb; } + .highlight .nc { + color: #3a95ba; } + .highlight .no { + color: orange; } + .highlight .ni { + color: orange; } + .highlight .ne { + color: orange; } + .highlight .nn { + color: orange; } + .highlight .nt { + color: orange; } + .highlight .w { + color: #bbb; } + .highlight .mh { + color: black; } + .highlight .mi { + color: black; } + .highlight .mo { + color: black; } + .highlight .il { + color: black; } + .highlight .sb { + color: #d14; } + .highlight .sc { + color: #d14; } + .highlight .sd { + color: #d14; } + .highlight .s2 { + color: #d14; } + .highlight .se { + color: #d14; } + .highlight .sh { + color: #d14; } + .highlight .si { + color: #d14; } + .highlight .sx { + color: #d14; } + .highlight .sr { + color: orange; } + .highlight .s1 { + color: #b72748; } + .highlight .ss { + color: #b72748; } + .highlight .bp { + color: #3a95ba; } + .highlight .vc { + color: #3a95ba; } + .highlight .vg { + color: black; } + .highlight .vi { + color: orange; } + .highlight .nl { + color: #3a95ba; } + + + +.language-toggle { + border-bottom: 2px #0484f2 solid; + background: white; + display: block; + box-sizing: border-box; + font-size: 125% + -webkit-font-smoothing: antialiased; + line-height: 1.5; + padding-right: 10px; +} +.language-toggle a.active { + color: #222220 !important; +} +.language-toggle a { + cursor: pointer; + display: block; + float: right; + padding-left: 1em; + + color: #a3a39e !important; + text-decoration: none; + transition: color 0.1s linear; +} +.language-toggle:after { + content: ""; + display: table; + clear: both; +} + +.highlight-group { + font-family: 'Inconsolata' !important; + margin: 0; + margin-top: 20px; + margin-bottom: 20px; + background: #f8f7f5; +} + +.hidden { + display: none; +} +.code { + padding: 15px; + overflow: auto; +} +pre { + font-family: 'Inconsolata' !important; + font-weight: 500; + color: #333333; +} + +.note { + padding: 10px; + border-radius: 3px; + background-color: #EFF7FF; + border: 1px solid #CCDDFF; + margin-bottom: 20px; +} + +.note p:before { + content: "NOTE:"; + font-weight: bold; +} + +.note p { + margin-bottom: 0px; +} + +.note-important { + padding: 10px; + border-radius: 3px; + background-color: #FFCCCC; + border: 1px solid #FF8899; + margin-bottom: 20px; +} + +.note-important p:before { + content: "IMPORTANT:"; + font-weight: bold; +} + +.note-important p { + margin-bottom: 0px; +} + + +.right { + float: right; +} + + +footer { + padding: 20px 0; +} + +footer p { + text-align: center; +} diff --git a/docs/static/media.css b/docs/static/media.css new file mode 100755 index 00000000..460a9eed --- /dev/null +++ b/docs/static/media.css @@ -0,0 +1,46 @@ +/* Media queries */ +@media (min-width: 600px) { + header { + display: block; + } + + header ul { + } + + header nav ul { + display: inline-block; + float: right; + margin: 0 auto; + } + + #logo { + float: left; + } + + .container .sidebar { + width: 19%; + float: left; + } + + .container .content { + width: 75%; + float: right; + } + +} + +@media (min-width: 950px) { + .container { + width: 900px; + } + + .container .sidebar { + width: 19%; + float: left; + } + + .container .content { + width: 75%; + float: right; + } +} \ No newline at end of file diff --git a/docs/static/pygments.css b/docs/static/pygments.css new file mode 100755 index 00000000..91f27c87 --- /dev/null +++ b/docs/static/pygments.css @@ -0,0 +1,61 @@ +.hll { background-color: #ffffcc } +.c { color: #999988; font-style: italic } /* Comment */ +.err { color: #a61717; background-color: #e3d2d2 } /* Error */ +.k { color: #000000; font-weight: bold } /* Keyword */ +.o { color: #000000; } /* Operator */ +.cm { color: #666666; font-weight: bold; font-style: italic } /* Comment.Multiline */ +.cp { color: #666666; font-weight: bold; font-style: italic } /* Comment.Preproc */ +.c1 { color: #666666; font-weight: bold; font-style: italic } /* Comment.Single */ +.cs { color: #666666; font-weight: bold; font-style: italic } /* Comment.Special */ +.gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ +.ge { color: #000000; font-style: italic } /* Generic.Emph */ +.gr { color: #aa0000 } /* Generic.Error */ +.gh { color: #999999 } /* Generic.Heading */ +.gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ +.go { color: #888888 } /* Generic.Output */ +.gp { color: #555555 } /* Generic.Prompt */ +.gs { font-weight: bold } /* Generic.Strong */ +.gu { color: #aaaaaa } /* Generic.Subheading */ +.gt { color: #aa0000 } /* Generic.Traceback */ +.kc { color: #000000; font-weight: bold } /* Keyword.Constant */ +.kd { color: #000000; font-weight: bold } /* Keyword.Declaration */ +.kn { color: #000000; font-weight: bold } /* Keyword.Namespace */ +.kp { color: #000000; font-weight: bold } /* Keyword.Pseudo */ +.kr { color: #000000; font-weight: bold } /* Keyword.Reserved */ +.kt { color: #445588; font-weight: bold } /* Keyword.Type */ +.m { color: #009999 } /* Literal.Number */ +.s { color: #d01040 } /* Literal.String */ +.na { color: #008080 } /* Name.Attribute */ +.nb { } /* Name.Builtin */ +.nc { color: #445588; font-weight: bold } /* Name.Class */ +.no { color: #008080 } /* Name.Constant */ +.nd { color: #3c5d5d; font-weight: bold } /* Name.Decorator */ +.ni { color: #800080 } /* Name.Entity */ +.ne { color: #990000; font-weight: bold } /* Name.Exception */ +.nf { color: #990000; font-weight: bold } /* Name.Function */ +.nl { color: #990000; font-weight: bold } /* Name.Label */ +.nn { color: #555555 } /* Name.Namespace */ +.nt { color: #000080 } /* Name.Tag */ +.nv { color: #008080 } /* Name.Variable */ +.ow { color: #000000; font-weight: bold } /* Operator.Word */ +.w { color: #bbbbbb } /* Text.Whitespace */ +.mf { color: #009999 } /* Literal.Number.Float */ +.mh { color: #009999 } /* Literal.Number.Hex */ +.mi { color: #009999 } /* Literal.Number.Integer */ +.mo { color: #009999 } /* Literal.Number.Oct */ +.sb { color: #d01040 } /* Literal.String.Backtick */ +.sc { color: #d01040 } /* Literal.String.Char */ +.sd { color: #d01040 } /* Literal.String.Doc */ +.s2 { color: #d01040 } /* Literal.String.Double */ +.se { color: #d01040 } /* Literal.String.Escape */ +.sh { color: #d01040 } /* Literal.String.Heredoc */ +.si { color: #d01040 } /* Literal.String.Interpol */ +.sx { color: #d01040 } /* Literal.String.Other */ +.sr { color: #009926 } /* Literal.String.Regex */ +.s1 { color: #d01040 } /* Literal.String.Single */ +.ss { color: #990073 } /* Literal.String.Symbol */ +.bp { color: #999999 } /* Name.Builtin.Pseudo */ +.vc { color: #008080 } /* Name.Variable.Class */ +.vg { color: #008080 } /* Name.Variable.Global */ +.vi { color: #008080 } /* Name.Variable.Instance */ +.il { color: #009999 } /* Literal.Number.Integer.Long */ diff --git a/docs/static/talks/10_3_2016_ASCollectionNode_Sequence_Diagrams.pdf b/docs/static/talks/10_3_2016_ASCollectionNode_Sequence_Diagrams.pdf new file mode 100755 index 00000000..ce202e60 Binary files /dev/null and b/docs/static/talks/10_3_2016_ASCollectionNode_Sequence_Diagrams.pdf differ diff --git a/docs/static/talks/ASCollectionView.pdf b/docs/static/talks/ASCollectionView.pdf new file mode 100755 index 00000000..43d834f1 Binary files /dev/null and b/docs/static/talks/ASCollectionView.pdf differ diff --git a/docs/static/talks/UICollectionView.pdf b/docs/static/talks/UICollectionView.pdf new file mode 100755 index 00000000..da3691d0 Binary files /dev/null and b/docs/static/talks/UICollectionView.pdf differ diff --git a/docs/static/toggle.js b/docs/static/toggle.js new file mode 100755 index 00000000..65b9b5e2 --- /dev/null +++ b/docs/static/toggle.js @@ -0,0 +1,27 @@ +document.addEventListener("DOMContentLoaded", function() { + var swiftButtons = document.getElementsByClassName("swiftButton"); + var objectiveCButons = document.getElementsByClassName("objcButton"); + var objcCodes = document.getElementsByClassName("objcCode"); + var swiftCodes = document.getElementsByClassName("swiftCode"); + + var totalCodeSections = swiftButtons.length; + for(var i = 0; i < totalCodeSections; i++) { + swiftButtons[i].onclick = function () { + for (var i = 0; i < totalCodeSections; i++) { + swiftCodes[i].classList.remove("hidden"); + objcCodes[i].classList.add("hidden"); + objectiveCButons[i].classList.remove("active"); + swiftButtons[i].classList.add("active"); + }; + } + + objectiveCButons[i].onclick = function () { + for (var i = 0; i < totalCodeSections; i++) { + swiftCodes[i].classList.add("hidden"); + objcCodes[i].classList.remove("hidden"); + objectiveCButons[i].classList.add("active"); + swiftButtons[i].classList.remove("active"); + }; + } + } +}); \ No newline at end of file