Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit 58c2e80

Browse files
committed
Merge pull request #1067 from facebook/ASCellNodeVCCreation
[ASCellNode] Ensure we don't trigger the UIViewController to be created early if we are wrapping one.
2 parents affb786 + 6741ae6 commit 58c2e80

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

AsyncDisplayKit/ASCellNode.m

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
@interface ASCellNode ()
2222
{
23-
ASDisplayNodeDidLoadBlock _nodeLoadedBlock;
2423
UIViewController *_viewController;
2524
ASDisplayNode *_viewControllerNode;
2625
}
@@ -49,15 +48,13 @@ - (instancetype)initWithViewControllerBlock:(ASDisplayNodeViewControllerBlock)vi
4948
ASDisplayNodeAssertNotNil(viewControllerBlock, @"should initialize with a valid block that returns a UIViewController");
5049

5150
if (viewControllerBlock) {
52-
_viewController = viewControllerBlock();
5351

54-
__weak UIViewController *weakViewController = _viewController;
5552
_viewControllerNode = [[ASDisplayNode alloc] initWithViewBlock:^UIView *{
56-
return weakViewController.view;
53+
_viewController = viewControllerBlock();
54+
return _viewController.view;
5755
} didLoadBlock:didLoadBlock];
5856

5957
[self addSubnode:_viewControllerNode];
60-
_nodeLoadedBlock = didLoadBlock;
6158
}
6259

6360
return self;

0 commit comments

Comments
 (0)