Skip to content

Commit

Permalink
Remove ivar of ASCellNode.owningNode
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhuy committed Jun 20, 2019
1 parent e1859a1 commit 4498316
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
9 changes: 7 additions & 2 deletions Source/ASCellNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ - (UIViewController *)viewController
return _viewController;
}

- (id<ASRangeManagingNode>)owningNode
{
return self.collectionElement.owningNode;
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-missing-super-calls"

Expand Down Expand Up @@ -306,7 +311,7 @@ - (void)handleVisibilityChange:(BOOL)isVisible
// in which case it is not valid to perform a convertRect (this actually crashes on iOS 8).
UIScrollView *scrollView = (_scrollView != nil && view.superview != nil && [view isDescendantOfView:_scrollView]) ? _scrollView : nil;
if (scrollView) {
cellFrame = [view convertRect:view.bounds toView:_scrollView];
cellFrame = [view convertRect:view.bounds toView:scrollView];
}

// If we did not convert, we'll pass along CGRectZero and a nil scrollView. The EventInvisible call is thus equivalent to
Expand All @@ -323,7 +328,7 @@ - (void)handleVisibilityChange:(BOOL)isVisible

UIScrollView *scrollView = self.scrollView;

ASDisplayNode *owningNode = scrollView.asyncdisplaykit_node;
id<ASRangeManagingNode> owningNode = self.owningNode;
if ([owningNode isKindOfClass:[ASCollectionNode class]]) {
NSIndexPath *ip = [(ASCollectionNode *)owningNode indexPathForNode:self];
if (ip != nil) {
Expand Down
1 change: 0 additions & 1 deletion Source/Details/ASCollectionElement.mm
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ - (ASCellNode *)node
ASDisplayNodeFailAssert(@"Node block returned nil node!");
node = [[ASCellNode alloc] init];
}
node.owningNode = _owningNode;
node.collectionElement = self;
ASTraitCollectionPropagateDown(node, _traitCollection);
node.nodeModel = _nodeModel;
Expand Down
2 changes: 0 additions & 2 deletions Source/Private/ASCellNode+Internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ NS_ASSUME_NONNULL_BEGIN

@property (weak, nullable) ASCollectionElement *collectionElement;

@property (weak, nullable) id<ASRangeManagingNode> owningNode;

@property (nonatomic, readonly) BOOL shouldUseUIKitCell;

@end
Expand Down

0 comments on commit 4498316

Please sign in to comment.