mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Use collectionView:nodeBlockForItemAtIndexPath: in all examples
This commit is contained in:
@@ -90,16 +90,17 @@ static NSUInteger kNumberOfImages = 14;
|
||||
#pragma mark -
|
||||
#pragma mark ASCollectionView data source.
|
||||
|
||||
- (ASCellNode *)collectionView:(ASCollectionView *)collectionView nodeForItemAtIndexPath:(NSIndexPath *)indexPath
|
||||
- (ASCellNodeBlock)collectionView:(ASCollectionView *)collectionView nodeBlockForItemAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
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;
|
||||
UIImage *image = _sections[indexPath.section][indexPath.item];
|
||||
return ^{
|
||||
return [[ASCellNode alloc] initWithViewControllerBlock:^UIViewController *{
|
||||
return [[ImageViewController alloc] initWithImage:image];
|
||||
} didLoadBlock:^(ASDisplayNode * _Nonnull node) {
|
||||
node.layer.borderWidth = 1.0;
|
||||
node.layer.borderColor = [UIColor blackColor].CGColor;
|
||||
}];
|
||||
};
|
||||
}
|
||||
|
||||
- (ASCellNode *)collectionView:(ASCollectionView *)collectionView nodeForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
|
||||
|
||||
Reference in New Issue
Block a user