added sample app that initializes ASCollectionView cells using view controllers, wip though

This commit is contained in:
Luke Parham
2015-12-08 21:57:14 -06:00
parent f5d06c5989
commit 5e34f10b81
55 changed files with 1589 additions and 3 deletions

View File

@@ -251,6 +251,25 @@ 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];
@@ -271,7 +290,6 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c)
return self;
}
- (id)initWithLayerBlock:(ASDisplayNodeLayerBlock)layerBlock
{
return [self initWithLayerBlock:layerBlock didLoadBlock:nil];