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

# collectionView(_:canFocusItemAt:)

Asks the delegate whether the item at the specified index path can be focused.

```
optional func collectionView(_ collectionView: UICollectionView, canFocusItemAt indexPath: IndexPath) -> Bool
```

## Parameters

`collectionView`

The collection view object requesting this information.

`indexPath`

The index path of an item in the collection view.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the item can receive be focused or <doc://com.apple.documentation/documentation/Swift/false> if it can not.

## Discussion

You can use this method, or a cell’s [`canBecomeFocused`](/documentation/UIKit/UIView/canBecomeFocused) method, to control which items in the collection view can receive focus. The focus engine calls the cell’s [`canBecomeFocused`](/documentation/UIKit/UIView/canBecomeFocused) method first, the default implementation of which defers to the collection view and this delegate method.

If you do not implement this method, the ability to focus on items depends on whether the collection view’s items are selectable. When the items are selectable, they can also be focused as if this method had returned <doc://com.apple.documentation/documentation/Swift/true>; otherwise, they do not receive focus.

## See Also

[`allowsSelection`](/documentation/UIKit/UICollectionView/allowsSelection)

A Boolean value that indicates whether users can select items in the collection 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)