Files
AsyncDisplayKit/_docs/button-node.md
2016-04-10 18:08:42 -05:00

814 B
Executable File

title, layout, permalink, next
title layout permalink next
ASButtonNode docs /docs/button-node.html text-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.