Skip to content

Commit b693544

Browse files
Vadim NovoseltsevAdlai Holler
authored andcommitted
selectedBackgroundView (facebookarchive#2875)
1 parent 6af131b commit b693544

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

AsyncDisplayKit/ASCellNode.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,12 @@ typedef NS_ENUM(NSUInteger, ASCellNodeVisibilityEvent) {
169169
*/
170170
@property (nonatomic) UITableViewCellSelectionStyle selectionStyle;
171171

172+
/* @abstract The view used as the background of the cell when it is selected.
173+
* ASTableView uses these properties when configuring UITableViewCells that host ASCellNodes.
174+
* ASCollectionView uses these properties when configuring UICollectionViewCells that host ASCellNodes.
175+
*/
176+
@property (nonatomic, strong, nullable) UIView *selectedBackgroundView;
177+
172178
/* @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
173179
* @default UITableViewCellAccessoryNone
174180
* ASTableView uses these properties when configuring UITableViewCells that host ASCellNodes.

AsyncDisplayKit/ASCollectionView.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,7 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell
952952

953953
if (_ASCollectionViewCell *asCell = ASDynamicCast(cell, _ASCollectionViewCell)) {
954954
asCell.node = node;
955+
asCell.selectedBackgroundView = node.selectedBackgroundView;
955956
[_rangeController configureContentView:cell.contentView forCellNode:node];
956957
}
957958

AsyncDisplayKit/ASTableView.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
853853
[_rangeController configureContentView:cell.contentView forCellNode:node];
854854

855855
cell.node = node;
856+
cell.selectedBackgroundView = node.selectedBackgroundView;
856857
}
857858

858859
return cell;

0 commit comments

Comments
 (0)