mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
wip after review
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user