What method did Apple replace dragImage with?

I have an application in which I allow the user to drag some data from NSView with a custom drag and drop image under the cursor.

I just upgraded to beta version of Xcode 6 and now my drag / drop code will not compile. This is because Apple abandoned the following NSView method :

dragImage: at: Offset: event: cardboard: source: slideBack:

Ok, but what should I use instead? All the Apple documentation I found still fun recommends the deprecated method.

There is also a dragFile: method, but my NSView presents AV data, and it is not suitable for writing a large new file to disk every time a user starts to drag and drop. A user can successfully abort a drag and drop, possibly several times in a row.

What is the new way to trigger a drag operation using a custom icon?

+4
source share
1 answer

Thanks to Kyle Sluder on the Apple Dev forums to warn me about this. It turns out the replacement

NSView beginDraggingSessionWithItems: event: source:

+2
source

Source: https://habr.com/ru/post/1547549/


All Articles