Contents

setSelected(_:animated:)

Sets the selected state of the cell, optionally animating the transition between states.

Declaration

func setSelected(_ selected: Bool, animated: Bool)

Parameters

  • selected:

    True to set the cell as selected, False to set it as unselected. The default is False.

  • 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.

See Also

Managing cell selection and highlighting