Contents

tableView(_:willDisplay:forRowAt:)

Tells the delegate the table view is about to draw a cell for a particular row.

Declaration

optional func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath)

Parameters

  • tableView:

    The table view informing the delegate of this impending event.

  • cell:

    A cell that tableView is going to use when drawing the row.

  • indexPath:

    An index path locating the row in tableView.

Discussion

A table view sends this message to its delegate just before it uses cell to draw a row, thereby permitting the delegate to customize the cell object before it is displayed. This method gives the delegate a chance to override state-based properties set earlier by the table view, such as selection and background color. After the delegate returns, the table view sets only the alpha and frame properties, and then only when animating rows as they slide in or out.

See Also

Related Documentation

Configuring rows for the table view