view controller node is resized to match layoutspec for cells

This commit is contained in:
Luke Parham
2015-12-09 13:13:39 -06:00
parent 5e34f10b81
commit eeb49859f0
5 changed files with 67 additions and 28 deletions

View File

@@ -251,25 +251,6 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c)
return self;
}
- (id)initWithViewControllerBlock:(ASDisplayNodeViewControllerBlock)viewControllerBlock
{
return [self initWithViewControllerBlock:viewControllerBlock didLoadBlock:nil];
}
- (id)initWithViewControllerBlock:(ASDisplayNodeViewControllerBlock)viewControllerBlock didLoadBlock:(ASDisplayNodeDidLoadBlock)didLoadBlock
{
if (!(self = [super init]))
return nil;
ASDisplayNodeAssertNotNil(viewControllerBlock, @"should initialize with a valid block that returns a UIViewController");
return [self initWithViewBlock:^UIView *{
UIViewController *vc = viewControllerBlock();
vc.view.clipsToBounds = YES; // not sure this is the way to go, doesn't really make it better per se
return vc.view;
} didLoadBlock:didLoadBlock];
}
- (id)initWithViewBlock:(ASDisplayNodeViewBlock)viewBlock
{
return [self initWithViewBlock:viewBlock didLoadBlock:nil];