Instance Method

frameForItemAtIndex:

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

Declaration

- (NSRect)frameForItemAtIndex:(NSUInteger)index;

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 at the given index. The rectangle is returned in the collection view’s coordinate system.

Discussion

You can use this method in the collectionView:draggingImageForItemsAtIndexes:withEvent: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

The receiver’s collection view item prototype.

Deprecated
- newItemForRepresentedObject:

Returns the collection view item that is used for the specified object.

Deprecated
selectionIndexes

The indexes of the currently selected items.

maxNumberOfRows

The maximum number of rows that the collection view displays.

Deprecated
maxNumberOfColumns

The maximum number of columns that the collection view displays.

Deprecated
minItemSize

The minimum size (in points) of items in the collection view grid.

Deprecated
maxItemSize

The maximum size (in points) of items in the collection view grid.

Deprecated
- itemAtIndex:

Returns the collection view item for the represented object at the specified index.

- frameForItemAtIndex:withNumberOfItems:

Returns the frame of an item based on the number of items in the collection view.

- draggingImageForItemsAtIndexes:withEvent:offset:

This method computes and returns an image to use for dragging.