support layers as well as views when doing ASDisplayCell cleanup (in case we add support for layer-backed ASDisplayCells in the future.)

This commit is contained in:
Ethan Nagel
2015-05-03 21:45:33 -07:00
parent b40c1dbfc3
commit 38f08c9bd8

View File

@@ -514,8 +514,12 @@ static void *kASSizingQueueContext = &kASSizingQueueContext;
ASDisplayNodeAssertMainThread();
[_nodes enumerateObjectsUsingBlock:^(NSMutableArray *section, NSUInteger sectionIndex, BOOL *stop) {
[section enumerateObjectsUsingBlock:^(ASCellNode *node, NSUInteger rowIndex, BOOL *stop) {
if (node.isNodeLoaded && node.view.superview) {
[node.view removeFromSuperview];
if (node.isNodeLoaded) {
if (node.layerBacked) {
[node.layer removeFromSuperlayer];
} else {
[node.view removeFromSuperview];
}
}
}];
}];