Swiftgram/submodules/AsyncDisplayKit/docs/_docs/subtree-rasterization.md
Peter 9bc996374f Add 'submodules/AsyncDisplayKit/' from commit '02bedc12816e251ad71777f9d2578329b6d2bef6'
git-subtree-dir: submodules/AsyncDisplayKit
git-subtree-mainline: d06f423e0ed3df1fed9bd10d79ee312a9179b632
git-subtree-split: 02bedc12816e251ad71777f9d2578329b6d2bef6
2019-06-11 18:42:43 +01:00

27 lines
894 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 Texture 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 enableSubtreeRasterization];
</pre>
<pre lang="swift" class = "swiftCode hidden">
rootNode.enableSubtreeRasterization()
</pre>
</div>
</div>
<br>
This line will cause the entire node hierarchy from that point on to be rendered into one layer.