Fix cell selection and highlighting in ASCollectionView

This commit is contained in:
Levi McCallum
2015-11-11 00:44:01 -08:00
parent 5b1e2145cc
commit e6b33dd062
5 changed files with 85 additions and 9 deletions

View File

@@ -13,6 +13,7 @@
#import <AsyncDisplayKit/AsyncDisplayKit.h>
#import "SupplementaryNode.h"
#import "ItemNode.h"
@interface ViewController () <ASCollectionViewDataSource, ASCollectionViewDelegateFlowLayout>
{
@@ -78,11 +79,7 @@
- (ASCellNode *)collectionView:(ASCollectionView *)collectionView nodeForItemAtIndexPath:(NSIndexPath *)indexPath
{
NSString *text = [NSString stringWithFormat:@"[%zd.%zd] says hi", indexPath.section, indexPath.item];
ASTextCellNode *node = [[ASTextCellNode alloc] init];
node.text = text;
node.backgroundColor = [UIColor lightGrayColor];
return node;
return [[ItemNode alloc] initWithString:text];
}
- (ASCellNode *)collectionView:(ASCollectionView *)collectionView nodeForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath