Contents

tableView(_:selectionFollowsFocusForRowAt:)

Asks the delegate whether to relate selection and focus behavior for the row at the corresponding index path.

Declaration

optional func tableView(_ tableView: UITableView, selectionFollowsFocusForRowAt indexPath: IndexPath) -> Bool

Parameters

  • tableView:

    The table view making the request.

  • indexPath:

    The index path of the row to determine selection behavior for.

Return Value

true if you want to automatically select the row at the specified index path when focus moves to it; otherwise, false.

Discussion

If the table view’s selectionFollowsFocus property is true and you return false from this delegate method, focus still moves to the row when the user selects it. However, when focus moves to the row, the row doesn’t automatically select.

See Also

Managing table view focus