<!--
{
  "availability" : [
    "macOS: 10.6.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCollectionView/frameForItem(at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSCollectionView(im)frameForItemAtIndex:"
  },
  "title" : "frameForItem(at:)"
}
-->

# frameForItem(at:)

Returns the frame of the collection view item at the specified index.

```
func frameForItem(at index: Int) -> NSRect
```

## Parameters

`index`

The index of the collection view item.

## Return Value

The frame calculated by the receiver where it intends to place the subview for the [`NSCollectionViewItem`](/documentation/AppKit/NSCollectionViewItem) at the given index. The rectangle is returned in the collection view’s coordinate system.

## Discussion

You can use this method in the [`collectionView(_:draggingImageForItemsAt:with:offset:)`](/documentation/AppKit/NSCollectionViewDelegate/collectionView(_:draggingImageForItemsAt:with:offset:)-4yvk5) method to determine which views are in the visible portion of the enclosing scroll view.

Overriding this method will have no effect on the collection view’s subview layout.

---

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)