---
title: allowsFocus
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uicollectionview/allowsfocus
---

# allowsFocus

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

## Declaration

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

## Mentioned in

Building a desktop-class iPad app

## Discussion

Discussion If you implement 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.

## See Also

### Working with focus

- [allowsFocusDuringEditing](uikit/uicollectionview/allowsfocusduringediting.md)
- [selectionFollowsFocus](uikit/uicollectionview/selectionfollowsfocus.md)
- [remembersLastFocusedIndexPath](uikit/uicollectionview/rememberslastfocusedindexpath.md)
