Merge pull request #837 from levi/levi/cell-selection

Fix selection inconsistency in ASTableView/ASCollectionView cell implementation
This commit is contained in:
appleguy
2015-11-28 16:56:25 -08:00
7 changed files with 117 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;
}
@@ -479,11 +488,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;
}