ASViewController example improvements (#2592)

This commit is contained in:
Michael Schneider
2016-11-10 16:33:01 -08:00
committed by appleguy
parent 171cc2f527
commit 2ba8239ff5
4 changed files with 24 additions and 32 deletions

View File

@@ -27,9 +27,10 @@
self = [super init];
if (self == nil) { return self; }
self.automaticallyManagesSubnodes = YES;
_imageNode = [[ASNetworkImageNode alloc] init];
_imageNode.backgroundColor = ASDisplayNodeDefaultPlaceholderColor();
[self addSubnode:_imageNode];
return self;
}
@@ -38,7 +39,7 @@
- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
{
return [ASRatioLayoutSpec ratioLayoutSpecWithRatio:1.0 child:_imageNode];
return [ASRatioLayoutSpec ratioLayoutSpecWithRatio:1.0 child:self.imageNode];
}
- (void)layoutDidFinish