Skip to content

Commit 72d108c

Browse files
committed
Minor fixes in ASViewController and Multiplex sample.
1 parent 07c0d78 commit 72d108c

3 files changed

Lines changed: 10 additions & 12 deletions

File tree

AsyncDisplayKit/ASViewController.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ - (void)loadView
3333

3434
- (void)viewWillLayoutSubviews
3535
{
36-
ASSizeRange constrainedSize = ASSizeRangeMake(self.view.bounds.size, self.view.bounds.size);
36+
CGSize viewSize = self.view.bounds.size;
37+
ASSizeRange constrainedSize = ASSizeRangeMake(viewSize, viewSize);
3738
[_node measureWithSizeRange:constrainedSize];
3839
[super viewWillLayoutSubviews];
3940
}

examples/Multiplex/Sample/ScreenNode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
- (void)start;
1717
- (void)reload;
1818

19-
@end
19+
@end

examples/Multiplex/Sample/ScreenNode.m

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,13 @@ - (void)setText:(NSString *)text
6464

6565
- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
6666
{
67-
return
68-
[ASInsetLayoutSpec
69-
insetLayoutSpecWithInsets:UIEdgeInsetsMake(10, 10, 10, 10)
70-
child:
71-
[ASStackLayoutSpec
72-
stackLayoutSpecWithDirection:ASStackLayoutDirectionVertical
73-
spacing:10
74-
justifyContent:ASStackLayoutJustifyContentCenter
75-
alignItems:ASStackLayoutAlignItemsCenter
76-
children:@[[ASRatioLayoutSpec ratioLayoutSpecWithRatio:1 child:_imageNode], _textNode]]];
67+
ASRatioLayoutSpec *imagePlaceholder = [ASRatioLayoutSpec ratioLayoutSpecWithRatio:1 child:_imageNode];
68+
ASStackLayoutSpec *verticalStack = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionVertical
69+
spacing:10
70+
justifyContent:ASStackLayoutJustifyContentCenter
71+
alignItems:ASStackLayoutAlignItemsCenter
72+
children:@[imagePlaceholder, _textNode]];
73+
return [ASInsetLayoutSpec insetLayoutSpecWithInsets:UIEdgeInsetsMake(10, 10, 10, 10) child:verticalStack];
7774
}
7875

7976
#pragma mark -

0 commit comments

Comments
 (0)