NSCollectionView drag and drop item to another section

If my collection view has two sections and 1 item in each section, and I try to drag and drop the item in one section to the other, the following method is not being called:


-(BOOL)collectionView:(NSCollectionView *)collectionView
            acceptDrop:(id <NSDraggingInfo>)draggingInfo
             indexPath:(NSIndexPath *)indexPath
        dropOperation:(NSCollectionViewDropOperation)dropOperation


However, if the first section has two items, in it, and I drag one item to the other section, the method does get called. In the validate drop method, I can see I'm returning NSDragOperationMove in both cases, because I'm logging it out.

I took a look at the Cocoa Slides sample code and in the sample they don't do cross section drag and drop. Is this a possible bug in NSCollectionView?


Also the method is not being called if I drop after the first row in second section (even with three items). but is is being called if I drop before the first row in a different section


Has anyone else tried using NSCollectionView and supported cross-section item re-ordering?

Accepted Answer

Seems like a bug. I'll have to file it later when I get time. Looks like a couple days of extra work to subclass NSCollectionView and reimplement this...


Edit: Seems you will actually have issues getting the accept drop method to call when doing cross-section drag and drop.

In the end, I had to subclass NSCollectionView and override all the dragging destination methods.

NSCollectionView drag and drop item to another section
 
 
Q