Update placeholder-fade-duration.md

This commit is contained in:
Hannah Troisi
2016-07-16 22:25:05 -07:00
committed by GitHub
parent ffb7d3bef9
commit 55ae68d547

View File

@@ -6,6 +6,8 @@ prevPage: image-modification-block.html
nextPage: layer-backing.html
---
## ASDisplayNodes may Implement Placeholders
Any `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 `.placeholderFadeDuration`;
For image drawing, use the node's `.calculatedSize` property.
@@ -16,7 +18,11 @@ The <code>-placeholderImage</code> function may be called on a background thread
See our ancient <a href="https://github.com/facebook/AsyncDisplayKit/tree/master/examples_extra/placeholders">Placeholders sample app</a> to see this concept, first invented by the Facebook Paper team, in action.
## ASNetworkImageNode also has a Default Image
## `.neverShowPlaceholders`
Hear <a href="https://youtu.be/RY_X7l1g79Q">Scott Goodson explain</a> placeholders, `.neverShowPlaceholders` and why UIKit doesn't have them.
## ASNetworkImageNode also have Default Images
In _addition_ to placeholders, `ASNetworkImageNode`s 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.