Instance Method


Asks the delegate whether the focus update specified by the context is allowed to occur.


optional func tableView(_ tableView: UITableView, shouldUpdateFocusIn context: UITableViewFocusUpdateContext) -> Bool



A table-view object in which the focus update is occurring.


An instance of UIFocusUpdateContext class, contains metadata for the focus related update.

Return Value

true if the focus should update; otherwise false.


The functionality of this delegate method is equivalent to overriding UITableView class’s shouldUpdateFocus(in:) method. This delegate method provides additional UITableView-related information in its context parameter, such as the index paths for the previously and next focused views. Note that, these index paths are only available if their views are contained within the table view. To learn more about the information provided by the context, see UITableViewFocusUpdateContext.

See Also

Managing Table View Focus

func tableView(UITableView, canFocusRowAt: IndexPath) -> Bool

Asks the delegate whether the cell at the specified index path is itself focusable.

func tableView(UITableView, didUpdateFocusIn: UITableViewFocusUpdateContext, with: UIFocusAnimationCoordinator)

Tells the delegate that a focus update specified by the context has just occurred.

func indexPathForPreferredFocusedView(in: UITableView) -> IndexPath?

Asks the delegate for the table view’s index path for the preferred focused view.