mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00

git-subtree-dir: submodules/AsyncDisplayKit git-subtree-mainline: d06f423e0ed3df1fed9bd10d79ee312a9179b632 git-subtree-split: 02bedc12816e251ad71777f9d2578329b6d2bef6
1.1 KiB
Executable File
1.1 KiB
Executable File
title | layout | permalink | prevPage | nextPage |
---|---|---|---|---|
Layer Backing | docs | /docs/layer-backing.html | accessibility.html | 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 Texture nodes, converting an entire subtree from views to layers is as simple as:
SwiftObjective-C
rootNode.isLayerBacked = YES;
rootNode.isLayerBacked = true
...and if you need to go back, it's as simple as deleting one line.