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

# updateFocusIfNeeded()

Forces the system to act on a pending focus update for the current environment.

## Declaration

```swift
func updateFocusIfNeeded()
```

## Discussion

Discussion If the current environment has a pending focus update, calling this method forces the system to update the focus information immediately instead of waiting for the next run loop cycle. If no focus update is pending, this method does nothing. You create a pending focus update using the requestFocusUpdate(to:) method. The system may also schedule focus updates in response to interface-related events.

## See Also

### Managing focus updates

- [requestFocusUpdate(to:)](uikit/uifocussystem/requestfocusupdate(to:).md)
