wip after review

This commit is contained in:
Luke Parham
2015-12-21 01:24:46 -06:00
parent 6cbc51dc61
commit 322caaeb6a
6 changed files with 39 additions and 97 deletions

View File

@@ -1,15 +0,0 @@
//
// ImageCellNode.h
// Sample
//
// Created by McCallum, Levi on 11/22/15.
// Copyright (c) 2015 Facebook. All rights reserved.
//
#import <AsyncDisplayKit/AsyncDisplayKit.h>
@interface ImageCellNode : ASCellNode
- (instancetype)initWithImage:(UIImage *)image;
@end

View File

@@ -1,45 +0,0 @@
//
// ImageCellNode.m
// Sample
//
// Created by McCallum, Levi on 11/22/15.
// Copyright (c) 2015 Facebook. All rights reserved.
//
#import "ImageCellNode.h"
#import "ImageViewController.h"
@implementation ImageCellNode {
ASImageNode *_imageNode;
}
//- (id)initWithImage:(UIImage *)image
//{
// self = [super init];
// if (self != nil) {
// _imageNode = [[ASImageNode alloc] init];
// _imageNode.image = image;
// [self addSubnode:_imageNode];
// }
// return self;
//}
- (id)initWithImage:(UIImage *)image
{
return [self initWithViewControllerBlock:^UIViewController *{
return [[ImageViewController alloc] initWithImage:image];
}];
}
- (CGSize)calculateSizeThatFits:(CGSize)constrainedSize
{
[_imageNode measure:constrainedSize];
return constrainedSize;
}
- (void)layout
{
_imageNode.frame = CGRectMake(0, 0, _imageNode.calculatedSize.width, _imageNode.calculatedSize.height);
}
@end

View File

@@ -94,7 +94,10 @@ static NSUInteger kNumberOfImages = 14;
{
ASCellNode *node = [[ASCellNode alloc] initWithViewControllerBlock:^UIViewController *{
return [[ImageViewController alloc] initWithImage:_sections[indexPath.section][indexPath.item]];
}];
} didLoadBlock:nil];
node.layer.borderWidth = 1.0;
node.layer.borderColor = [UIColor blackColor].CGColor;
return node;
}