Sets the selected state of the cell, optionally animating the transition between states.
SDKs
- iOS 2.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
Framework
- UIKit
Declaration
Parameters
selected
true
to set the cell as selected,false
to set it as unselected. The default isfalse
.animated
true
to animate the transition between selected states,false
to make the transition immediate.
Discussion
The selection affects the appearance of labels, image, and background. When the selected state of a cell is true
, it draws the background for selected cells (Reusing Cells) with its title in white.