diff --git a/AsyncDisplayKit/ASCellNode.h b/AsyncDisplayKit/ASCellNode.h index 289e52917f..6467f68bed 100644 --- a/AsyncDisplayKit/ASCellNode.h +++ b/AsyncDisplayKit/ASCellNode.h @@ -169,6 +169,12 @@ typedef NS_ENUM(NSUInteger, ASCellNodeVisibilityEvent) { */ @property (nonatomic) UITableViewCellSelectionStyle selectionStyle; +/* @abstract The view used as the background of the cell when it is selected. + * ASTableView uses these properties when configuring UITableViewCells that host ASCellNodes. + * ASCollectionView uses these properties when configuring UICollectionViewCells that host ASCellNodes. + */ +@property (nonatomic, strong, nullable) UIView *selectedBackgroundView; + /* @abstract The accessory type view on the right side of the cell. Please take care of your ASLayoutSpec so that doesn't overlay the accessoryView * @default UITableViewCellAccessoryNone * ASTableView uses these properties when configuring UITableViewCells that host ASCellNodes. diff --git a/AsyncDisplayKit/ASCollectionView.mm b/AsyncDisplayKit/ASCollectionView.mm index 961b77662e..80664fb04f 100644 --- a/AsyncDisplayKit/ASCollectionView.mm +++ b/AsyncDisplayKit/ASCollectionView.mm @@ -952,6 +952,7 @@ static NSString * const kReuseIdentifier = @"_ASCollectionReuseIdentifier"; if (_ASCollectionViewCell *asCell = ASDynamicCast(cell, _ASCollectionViewCell)) { asCell.node = node; + asCell.selectedBackgroundView = node.selectedBackgroundView; [_rangeController configureContentView:cell.contentView forCellNode:node]; } diff --git a/AsyncDisplayKit/ASTableView.mm b/AsyncDisplayKit/ASTableView.mm index c7f3430008..37208cdeb4 100644 --- a/AsyncDisplayKit/ASTableView.mm +++ b/AsyncDisplayKit/ASTableView.mm @@ -853,6 +853,7 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell"; [_rangeController configureContentView:cell.contentView forCellNode:node]; cell.node = node; + cell.selectedBackgroundView = node.selectedBackgroundView; } return cell;