---
title: "frameForItem(at:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscollectionview/frameforitem(at:)"
---

# frameForItem(at:)

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

## Declaration

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

## Parameters

- `index`: The index of the collection view item.

## Return Value

Return Value The frame calculated by the receiver where it intends to place the subview for the NSCollectionViewItem at the given index. The rectangle is returned in the collection view’s coordinate system.

## Discussion

Discussion You can use this method in the collectionView(_:draggingImageForItemsAt:with:offset:) 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.

## See Also

### Legacy Collection View Support

- [itemPrototype](appkit/nscollectionview/itemprototype.md)
- [newItem(forRepresentedObject:)](appkit/nscollectionview/newitem(forrepresentedobject:).md)
- [selectionIndexes](appkit/nscollectionview/selectionindexes.md)
- [maxNumberOfRows](appkit/nscollectionview/maxnumberofrows.md)
- [maxNumberOfColumns](appkit/nscollectionview/maxnumberofcolumns.md)
- [minItemSize](appkit/nscollectionview/minitemsize.md)
- [maxItemSize](appkit/nscollectionview/maxitemsize.md)
- [item(at:)](appkit/nscollectionview/item(at:)-80xze.md)
- [frameForItem(at:withNumberOfItems:)](appkit/nscollectionview/frameforitem(at:withnumberofitems:).md)
- [draggingImageForItems(at:with:offset:)](appkit/nscollectionview/draggingimageforitems(at:with:offset:)-951w7.md)
- [setDraggingSourceOperationMask(_:forLocal:)](appkit/nscollectionview/setdraggingsourceoperationmask(_:forlocal:).md)
