ASDisplayNodes may Implement Placeholders
ASDisplayNode subclass may implement the
-placeholderImage method to provide a placeholder that covers content until a node’s contents are finished displaying. To use placeholders, set
.placeholderEnabled = YES and optionally set a
For image drawing, use the node’s
An ideal resource for creating placeholder images, including rounded rect solid colored ones or simple square corner ones is the
UIImage+ASConvenience category methods in Texture.
See our ancient Placeholders sample app to see this concept, first invented by the Facebook Paper team, in action.
Hear Scott Goodson explain placeholders,
.neverShowPlaceholders and why UIKit doesn’t have them.
ASNetworkImageNode also have Default Images
In addition to placeholders,
ASNetworkImageNodes also have a
.defaultImage property. While placeholders are meant to be transient, default images will persist if the image node’s
.URL property is
nil or if the URL fails to load.
We suggest using default images for avatars, while using placeholder images for photos.