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

@@ -115,13 +115,22 @@ static BOOL _isInterceptedSelector(SEL sel)
@implementation _ASCollectionViewCell
- (void)setNode:(ASCellNode *)node
{
_node = node;
node.selected = self.selected;
node.highlighted = self.highlighted;
}
- (void)setSelected:(BOOL)selected
{
[super setSelected:selected];
_node.selected = selected;
}
- (void)setHighlighted:(BOOL)highlighted
{
[super setHighlighted:highlighted];
_node.highlighted = highlighted;
}
@@ -478,11 +487,8 @@ static BOOL _isInterceptedSelector(SEL sel)
_ASCollectionViewCell *cell = [self dequeueReusableCellWithReuseIdentifier:reuseIdentifier forIndexPath:indexPath];
ASCellNode *node = [_dataController nodeAtIndexPath:indexPath];
[_rangeController configureContentView:cell.contentView forCellNode:node];
cell.node = node;
[_rangeController configureContentView:cell.contentView forCellNode:node];
return cell;
}