<!--
{
  "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/UICollectionViewDelegate/collectionView(_:didUpdateFocusIn:with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UICollectionViewDelegate(im)collectionView:didUpdateFocusInContext:withAnimationCoordinator:"
  },
  "title" : "collectionView(_:didUpdateFocusIn:with:)"
}
-->

# collectionView(_:didUpdateFocusIn:with:)

Tells the delegate that a focus update occurred.

```
optional func collectionView(_ collectionView: UICollectionView, didUpdateFocusIn context: UICollectionViewFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator)
```

## Parameters

`collectionView`

The collection view object notifying you of the focus change.

`context`

The context object containing metadata associated with the focus change. This object contains the index path of the previously focused item and the currently focused item.

`coordinator`

The animation coordinator to use when creating any additional animations.

## Discussion

The collection view calls this method when a focus-related change occurs. You can use this method to update your app’s state information or to animate changes to your app’s visual appearance.

If you subclass [`UICollectionView`](/documentation/UIKit/UICollectionView), you can also implement the same behavior by overriding the [`didUpdateFocus(in:with:)`](/documentation/UIKit/UIFocusEnvironment/didUpdateFocus(in:with:)) method, which is defined by the [`UIFocusEnvironment`](/documentation/UIKit/UIFocusEnvironment) protocol and adopted by all views.

## See Also

[`-  didUpdateFocusInContext:withAnimationCoordinator:`](/documentation/UIKit/UIFocusEnvironment/didUpdateFocus(in:with:))

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



---

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)