Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ivar of ASCellNode.owningNode #1559

Merged
merged 1 commit into from
Jun 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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