Instance Property


The view used as the background of the cell when it is selected.


var selectedBackgroundView: UIView? { get set }


The default is nil for cells in plain-style tables (UITableView.Style.plain) and non-nil for section-group tables UITableView.Style.grouped). UITableViewCell adds the value of this property as a subview only when the cell is selected. It adds the selected background view as a subview directly above the background view (backgroundView) if it is not nil, or behind all other views. Calling setSelected(_:animated:) causes the selected background view to animate in and out with an alpha fade.

See Also

Accessing Views of the Cell Object

var contentView: UIView

The content view of the cell object.

var backgroundView: UIView?

The view used as the background of the cell.

var multipleSelectionBackgroundView: UIView?

The background view to use for a selected cell when the table view allows multiple row selections.