Instance Method

draggingImageForItemsAtIndexes:withEvent:offset:

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

Declaration

- (NSImage *)draggingImageForItemsAtIndexes:(NSIndexSet *)indexes withEvent:(NSEvent *)event offset:(NSPointPointer)dragImageOffset;

Parameters

indexes

The index set of the items to be dragged.

event

Mouse drag event.

dragImageOffset

An in/out parameter that will initially be set to NSZeroPoint. it can be modified to reposition the returned image. A dragImageOffset of NSZeroPoint will cause the image to be centered under the mouse.

Return Value

An image containing a rendering of the visible portions of the views for each item.

Discussion

You can override the default image by subclassing NSCollectionView and overriding this method, or by implementing the collectionView:draggingImageForItemsAtIndexes:withEvent:offset: delegate method, it will be preferred over this method.

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:

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

- frameForItemAtIndex:withNumberOfItems:

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