tableView(_:shouldHighlightRowAt:)
Asks the delegate if the specified row should be highlighted.
Declaration
optional func tableView(_ tableView: UITableView, shouldHighlightRowAt indexPath: IndexPath) -> BoolParameters
- tableView:
The table view that is making this request.
- indexPath:
The index path of the row being highlighted.
Return Value
true if the row should be highlighted or false if it should not.
Discussion
As touch events arrive, the table view highlights rows in anticipation of the user selecting them. As it processes those touch events, the table view calls this method to ask your delegate if a given cell should be highlighted. Your delegate can implement this method and use it to prevent the highlighting of a row when another row is already selected or when other relevant criteria occur.
If you do not implement this method, the default return value is true.