12

I've managed to get drag and drop working on my NSCollectionView, but there are some issues with the visual appearance and behaviour. The main issue is that the drop zone / placeholder is the wrong size i.e. it's smaller than the collection view's minItemSize. I've scoured the documentation, but can't see any way to specify this.

The second issue I have is that I'd like the cell image to actually be moved when it's being dragged, rather than just having the semi-transparent copy.

Here's the current behaviour:

Current behaviour

And here's the behaviour I'd like to have (as used in Sketch):

Desired behaviour

Any suggestions would be greatly appreciated. Let me know if any of the code would be useful — I'm not sure which parts would be relevant to solving this. Thanks!

Luke Rogers
  • 2,369
  • 21
  • 28
  • I'd personally like to see the code for this, as every time I try to adjust the layout of the collection view during a drag operation, the app crashes with an index-beyond-bounds error. – Ash Jul 04 '17 at 09:04
  • I'm interested if you ever found a solution to this problem? – Tritonal Nov 19 '20 at 07:13
  • @Tritonal I don’t think I did, sorry. I didn’t complete the project and it’s been a long time since I worked on it. I seem to remember that I was considering a more custom solution and ditching `NSCollectionView` altogether, but I’m not sure that would be the best idea. – Luke Rogers Nov 23 '20 at 16:06

0 Answers0