Instance Method

collectionView:acceptDrop:index:dropOperation:

Invoked when the mouse is released over a collection view that previously allowed a drop.

Declaration

- (BOOL)collectionView:(NSCollectionView *)collectionView acceptDrop:(id<NSDraggingInfo>)draggingInfo index:(NSInteger)index dropOperation:(NSCollectionViewDropOperation)dropOperation;

Parameters

collectionView

The collection view that send the message.

draggingInfo

An object that contains more information about this dragging operation.

index

The index of the proposed drop item.

dropOperation

The type of dragging operation.

Return Value

YES if the drop operation should be accepted, otherwise NO.

Discussion

This method is called when the mouse is released over a collection view that previously decided to allow a drop via the collectionView:validateDrop:proposedIndex:dropOperation: method. At this time, the delegate should incorporate the data from the dragging pasteboard and update the collection view's contents.

You must implement this method for your collection view to be a drag destination

See Also

Legacy Collection View Support

- collectionView:canDragItemsAtIndexes:withEvent:

Returns a Boolean indicating whether the collection view can begin dragging the specified items.

- collectionView:pasteboardWriterForItemAtIndex:

Provides the pasteboard writer for the item at the specified index

- collectionView:writeItemsAtIndexes:toPasteboard:

Invoked after it has been determined that a drag should begin, but before the drag has been started.

Deprecated
- collectionView:namesOfPromisedFilesDroppedAtDestination:forDraggedItemsAtIndexes:

Invoked to return an array of filenames that the receiver promises to create.

Deprecated
- collectionView:draggingImageForItemsAtIndexes:withEvent:offset:

Creates and returns a drag image to represent the specified items during a drag.

- collectionView:draggingSession:willBeginAtPoint:forItemsAtIndexes:

Notifies your delegate that a drag session is about to begin.

- collectionView:validateDrop:proposedIndex:dropOperation:

Validates the specified location to see if it is a valid drop target.