---
title: "tableView(_:shouldUpdateFocusIn:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitableviewdelegate/tableview(_:shouldupdatefocusin:)"
---

# tableView(_:shouldUpdateFocusIn:)

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

## Declaration

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

## Parameters

- `tableView`: A table view in which the focus update is occurring.
- `context`: An instance of doc://com.apple.uikit/documentation/UIKit/UIFocusUpdateContext class, contains metadata for the focus related update.

## Return Value

Return Value true if the focus should update; otherwise false.

## Discussion

Discussion 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

- [tableView(_:canFocusRowAt:)](uikit/uitableviewdelegate/tableview(_:canfocusrowat:).md)
- [tableView(_:didUpdateFocusIn:with:)](uikit/uitableviewdelegate/tableview(_:didupdatefocusin:with:).md)
- [indexPathForPreferredFocusedView(in:)](uikit/uitableviewdelegate/indexpathforpreferredfocusedview(in:).md)
- [tableView(_:selectionFollowsFocusForRowAt:)](uikit/uitableviewdelegate/tableview(_:selectionfollowsfocusforrowat:).md)
