Files
AsyncDisplayKit/_docs/button-node.md
Hannah Troisi bb30dc38a4 Update button-node.md
wip
2016-04-06 22:44:43 -07:00

18 lines
793 B
Markdown
Executable File

---
title: ASButtonNode
layout: docs
permalink: /docs/button-node.html
---
`ASButtonNode` (a subclass of `ASControlNode`) supports simple buttons, with multiple states for a text label and an image with a few different layout options. Enables layerBacking for subnodes to significantly lighten main thread impact relative to UIButton (though async preparation is the bigger win).
Features:
- supports state-changing background images
- supports state-changing titles
- supports text alignment
- supports contentEdgeInsets
- offers methods that allow more convenient usage than creating attributed strings — title NSString, UIFont, and UIColor.
Gotchas:
- the `selected` property logic should be handled by the developer. Tapping the ASButtonNode does not automatically enable selected.