[ASDisplayNode] Placeholders should always be recreated if returning to past nodes.

If previously-displayed contents is gone (e.g. clearContents), and is not finished displaying
by the time the node is onscreen, recreate the placeholder immediately.
This commit is contained in:
Scott Goodson
2016-03-18 21:13:26 -07:00
parent 0745eabec9
commit c5c7abb1d6
5 changed files with 126 additions and 93 deletions

View File

@@ -265,6 +265,11 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent
}
}
- (BOOL)placeholderShouldPersist
{
return (self.image == nil && self.imageIdentifiers.count > 0);
}
/* displayWillStart in ASNetworkImageNode has a very similar implementation. Changes here are likely necessary
in ASNetworkImageNode as well. */
- (void)displayWillStart