Update Videos example to leverage automatic measure: call before layout

This commit is contained in:
Michael Schneider 2016-05-17 11:49:59 +02:00
parent b4d490848f
commit ecd7727ceb

View File

@ -28,6 +28,7 @@
// Root node for the view controller
_rootNode = [ASDisplayNode new];
_rootNode.frame = self.view.bounds;
_rootNode.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
ASVideoNode *guitarVideoNode = self.guitarVideoNode;
@ -54,16 +55,6 @@
[self.view addSubnode:_rootNode];
}
- (void)viewDidLayoutSubviews
{
[super viewDidLayoutSubviews];
// After all subviews are layed out we have to measure it and move the root node to the right place
CGSize viewSize = self.view.bounds.size;
[self.rootNode measureWithSizeRange:ASSizeRangeMake(viewSize, viewSize)];
[self.rootNode setNeedsLayout];
}
#pragma mark - Getter / Setter
- (ASVideoNode *)guitarVideoNode;