---
title: updateFocusIfNeeded()
framework: uikit
role: symbol
role_heading: Instance Method
path: uikit/uifocusenvironment/updatefocusifneeded()
---

# updateFocusIfNeeded()

Tells the focus engine to force a focus update immediately.

## Declaration

```swift
func updateFocusIfNeeded()
```

## Discussion

Discussion If any focus environment is currently pending an update (after calling setNeedsFocusUpdate()), then calling this method forces the focus engine to immediately update focus. Unlike setNeedsFocusUpdate(), it does not matter if this environment currently contains focus, or if this environment is the one pending an update.

## See Also

### Requesting focus update

- [setNeedsFocusUpdate()](uikit/uifocusenvironment/setneedsfocusupdate().md)
