<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIFocusEnvironment/didUpdateFocus(in:with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIFocusEnvironment(im)didUpdateFocusInContext:withAnimationCoordinator:"
  },
  "title" : "didUpdateFocus(in:with:)"
}
-->

# didUpdateFocus(in:with:)

Called immediately after the system updates the focus to a new view.

```
func didUpdateFocus(in context: UIFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator)
```

## Parameters

`context`

An instance of [`UIFocusUpdateContext`](/documentation/UIKit/UIFocusUpdateContext) containing metadata of the focus related update.

`coordinator`

An instance of [`UIFocusAnimationCoordinator`](/documentation/UIKit/UIFocusAnimationCoordinator) used for coordinating focus-related animations.

## Discussion

After the focus is updated to a new view, the focus engine calls this method on all focus environments that contain either the previously focused view, the next focused view, or both, in ascending order. You should override this method to update your app’s state in response to changes in focus. Use the provided animation coordinator to animate changes in visual appearance related to the update. For more information on animation coordinators, see [`UIFocusAnimationCoordinator`](/documentation/UIKit/UIFocusAnimationCoordinator).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)