Files
AsyncDisplayKit/_docs/subtree-rasterization.md
Hannah Trosi fc88b8ccac website refactoring
clean up optimization docs
rearrange sections in nav bar
add layout api sizing Q to FAQ
add corner rounding to Optimizations + check back soon tags for methods to be released in 2.0
add layoutSpecs
Containers overview -> node containers
Node overview -> node subclasses
remove ASTextCellNode
2016-07-10 22:52:58 -07:00

27 lines
911 B
Markdown
Executable File

---
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:
<div class = "highlight-group">
<span class="language-toggle"><a data-lang="swift" class="swiftButton">Swift</a><a data-lang="objective-c" class = "active objcButton">Objective-C</a></span>
<div class = "code">
<pre lang="objc" class="objcCode">
rootNode.shouldRasterizeDescendants = YES;
</pre>
<pre lang="swift" class = "swiftCode hidden">
rootNode.shouldRasterizeDescendants = true
</pre>
</div>
</div>
<br>
This line will cause the entire node hierarchy from that point on to be rendered into one layer.