Skip to content

Commit

Permalink
Rename AsyncDisplayKit to Texture (#4)
Browse files Browse the repository at this point in the history
* Rename AsyncDisplayKit to Texture

* More renaming
  • Loading branch information
garrettmoon authored Apr 11, 2017
1 parent cdad21c commit 8c34401
Show file tree
Hide file tree
Showing 62 changed files with 214 additions and 214 deletions.
2 changes: 1 addition & 1 deletion docs/404.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ layout: default

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.
If you find a broken link, feel free to send a pull request. You can also let us know at [Github](https://github.com/texturegroup/texture/issues) so that we can fix it.
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AsyncDisplayKit Documentation
# Texture Documentation

We use [Jekyll](http://jekyllrb.com/) to build the site using Markdown and host it on [Github Pages](https://pages.github.com/).

Expand Down
4 changes: 2 additions & 2 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
url: http://asyncdisplaykit.org
name: AsyncDisplayKit
url: http://texturegroup.org
name: Texture
relative_permalinks: false
markdown: kramdown
timezone: America/Los_Angeles
Expand Down
2 changes: 1 addition & 1 deletion docs/_docs/accessibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ nextPage: layer-backing.html

Accessibility works seamlessly in ways that even UIKit doesn’t provide. When using the powerful optimization features of <a href = "layer-backing.html">Layer Backing</a> (`.layerBacked`) and <a href = "subtree-rasterization.html">Subtree Rasterization</a> (`.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.
The Texture 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.
14 changes: 7 additions & 7 deletions docs/_docs/adoption-guide-2-0-beta1.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Add the following to your podfile
<div class = "highlight-group">
<div class = "code">
<pre lang="objc" class="objcCode">
pod 'AsyncDisplayKit', '>= 2.0'
pod 'Texture', '>= 2.0'
</pre>
</div>
</div>
Expand All @@ -36,7 +36,7 @@ then run
<div class = "code">
<pre lang="objc" class="objcCode">
pod repo update
pod update AsyncDisplayKit
pod update Texture
</pre>
</div>
</div>
Expand All @@ -53,7 +53,7 @@ If your app fails to build instead of just showing the warnings, you might have

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`
3. Disable deprecation warnings in Texture. 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.

Expand All @@ -71,7 +71,7 @@ A full API changelog from `1.9.92` to `2.0-beta.1` is available <a href="apidiff

#### ASDisplayNode Changes

- ASDisplayNode's `.usesImplicitHierarchyManagement` has been renamed to `.automaticallyManagesSubnodes`. The <a href = "http://asyncdisplaykit.org/docs/automatic-subnode-mgmt.html">Automatic Subnode Management</a> API has been moved out of Beta, but has a few documented [limitations]().
- ASDisplayNode's `.usesImplicitHierarchyManagement` has been renamed to `.automaticallyManagesSubnodes`. The <a href = "http://texturegroup.org/docs/automatic-subnode-mgmt.html">Automatic Subnode Management</a> API has been moved out of Beta, but has a few documented [limitations]().

- ASDisplayNode's `-cancelLayoutTransitionsInProgress` has been renamed to `-cancelLayoutTransition`. The <a href = "layout-transition-api.html">Layout Transition API</a> has been moved out of Beta. Significant new functionality is planed for future dot releases.

Expand All @@ -92,11 +92,11 @@ These new methods replace the following:

#### 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`).
Texture'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.
It is important that developers using Texture 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.

Expand Down Expand Up @@ -134,7 +134,7 @@ Resources:

- [Video](https://youtu.be/yuDqvE5n_1g) of the ASCollectionNode Behind-the-Scenes talk at Pinterest. The <a href="/static/talks/10_3_2016_ASCollectionNode_Sequence_Diagrams.pdf">diagrams</a> 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.
- 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/texturegroup/texture/tree/master/examples) to conform to this new API.


#### Layout API Updates
Expand Down
4 changes: 2 additions & 2 deletions docs/_docs/asenvironment.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Any object that conforms to the `<ASEnvironment>` protocol can propagate specifi

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.
This means that whenever a node needs to query something about its environment, for example to check its [interface state](http://texturegroup.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.**
ASEnvironment powers many of the most valuable features of Texture. **There is no public API available at this time.**
6 changes: 3 additions & 3 deletions docs/_docs/asrunloopqueue.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ 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.
Even with main thread work, Texture 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.
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 `Texture` 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.
**ASRunLoopQueue is enabled by default when running Texture.** A developer does not need to be aware of it's existence except to know that it helps reduce main thread blockage.
6 changes: 3 additions & 3 deletions docs/_docs/automatic-layout-basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ ASLayout is an automatic, asynchronous, purely Objective-C box model layout feat

`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.

`<ASLayoutable>` 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.
`<ASLayoutable>` instances (all ASDisplayNodes and subclasses) do not have any size or position information. Instead, Texture 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:
The terminology is a bit confusing, so here is a brief description of all of the Texture automatic layout players:

Items that conform to the **\<ASLayoutable\> 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.
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 Texture, 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.

Expand Down
8 changes: 4 additions & 4 deletions docs/_docs/automatic-layout-containers.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ 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.
Texture 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.

Expand Down Expand Up @@ -47,7 +47,7 @@ Both nodes and layoutSpecs conform to the `<ASLayoutable>` protocol. Any `ASLay
</tr>
<tr>
<td><b><code>ASLayoutSpec</code></b></td>
<td><p>Can be used as a spacer in a stack spec with other children, when <code>.flexGrow</code> and/or <code>.flexShrink</code> is applied.</p> <p><i>This class can also be subclassed to create custom layout specs - advanced ASDK only!</i></p></td>
<td><p>Can be used as a spacer in a stack spec with other children, when <code>.flexGrow</code> and/or <code>.flexShrink</code> is applied.</p> <p><i>This class can also be subclassed to create custom layout specs - advanced Texture only!</i></p></td>
</tr>
</table>

Expand Down Expand Up @@ -138,7 +138,7 @@ The following properties may be set on any node or `layoutSpec`s, but will only

### 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.
Texture'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.

Expand Down Expand Up @@ -187,6 +187,6 @@ An inset spec requires its object to have an intrinsic size. It adds the inset p
<img src="/static/images/overlay-vs-inset-spec.png">

### Best Practices
- AsyncDisplayKit layout is called on a background thread. Do not access the device screen bounds, or any other UIKit methods in `layoutSpecThatFits:`.
- Texture 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?
4 changes: 2 additions & 2 deletions docs/_docs/automatic-layout-examples-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ prevPage: layout2-quickstart.html
nextPage: layout2-layoutspec-types.html
---

Check out the layout specs <a href="https://github.com/facebook/AsyncDisplayKit/tree/master/examples/LayoutSpecExamples">example project</a> to play around with the code below.
Check out the layout specs <a href="https://github.com/texturegroup/texture/tree/master/examples/LayoutSpecExamples">example project</a> to play around with the code below.

## Simple Header with Left and Right Justified Text

Expand Down Expand Up @@ -161,7 +161,7 @@ override func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec

let absoluteSpec = ASAbsoluteLayoutSpec(children: [photoNode, iconNode])

// ASAbsoluteLayoutSpec's .sizing property recreates the behavior of ASDK Layout API 1.0's "ASStaticLayoutSpec"
// ASAbsoluteLayoutSpec's .sizing property recreates the behavior of Texture Layout API 1.0's "ASStaticLayoutSpec"
absoluteSpec.sizing = .sizeToFit

return absoluteSpec;
Expand Down
4 changes: 2 additions & 2 deletions docs/_docs/automatic-layout-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Three examples in increasing order of complexity.

###Discussion

Get the full ASDK project at examples/ASDKgram.
Get the full Texture project at examples/ASDKgram.

#Social App Layout 2

Expand Down Expand Up @@ -201,4 +201,4 @@ Get the full ASDK project at examples/ASDKgram.

###Discussion

Get the full ASDK project at examples/CatDealsCollectionView.
Get the full Texture project at examples/CatDealsCollectionView.
4 changes: 2 additions & 2 deletions docs/_docs/automatic-subnode-mgmt.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ When enabled, ASM means that your nodes no longer require `addSubnode:` or `remo

### Example ###
<br>
Consider the following intialization method from the PhotoCellNode class in <a href="https://github.com/facebook/AsyncDisplayKit/tree/master/examples/ASDKgram">ASDKgram sample app</a>. This <code>ASCellNode</code> subclass produces a simple social media photo feed cell.
Consider the following intialization method from the PhotoCellNode class in <a href="https://github.com/texturegroup/texture/tree/master/examples/ASDKgram">ASDKgram sample app</a>. This <code>ASCellNode</code> 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" these have been removed and replaced with a single line that enables ASM.

Expand Down Expand Up @@ -287,7 +287,7 @@ The `_userAvatarImageNode`, `_photoImageNode`, and `_photoCommentsNode` are adde

An appropriately constructed ASLayoutSpec will know which subnodes need to be added, removed or animated.

Try out the <a href="https://github.com/facebook/AsyncDisplayKit/tree/master/examples/ASDKgram">ASDKgram sample app</a> 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.
Try out the <a href="https://github.com/texturegroup/texture/tree/master/examples/ASDKgram">ASDKgram sample app</a> 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.

Expand Down
Loading

0 comments on commit 8c34401

Please sign in to comment.