<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UICollectionView/allowsFocus",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UICollectionView(py)allowsFocus"
  },
  "title" : "allowsFocus"
}
-->

# allowsFocus

A Boolean value that determines whether the collection view allows its cells to become focused.

```
var allowsFocus: Bool { get set }
```

## Discussion

If you implement [`collectionView(_:canFocusItemAt:)`](/documentation/UIKit/UICollectionViewDelegate/collectionView(_:canFocusItemAt:)), its return value takes precedence over the value of this property.

The system determines the default value of this property according to the platform and other properties of 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)