Skip to content

Commit

Permalink
Use cell mode while wrapping supplementary nodes (#1282)
Browse files Browse the repository at this point in the history
  • Loading branch information
maicki committed Jan 10, 2019
1 parent 22acb98 commit 52b84ba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/ASCollectionView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2044,13 +2044,17 @@ - (ASCellNodeBlock)dataController:(ASDataController *)dataController supplementa
}

// Wrap the node block
BOOL disableRangeController = ASCellLayoutModeIncludes(ASCellLayoutModeDisableRangeController);
__weak __typeof__(self) weakSelf = self;
return ^{
__typeof__(self) strongSelf = weakSelf;
ASCellNode *node = block();
ASDisplayNodeAssert([node isKindOfClass:[ASCellNode class]],
@"ASCollectionNode provided a non-ASCellNode! %@, %@", node, strongSelf);

if (!disableRangeController) {
[node enterHierarchyState:ASHierarchyStateRangeManaged];
}
if (node.interactionDelegate == nil) {
node.interactionDelegate = strongSelf;
}
Expand Down

0 comments on commit 52b84ba

Please sign in to comment.