Sets the item’s dragging frame and contents.
- macOS 10.7+
The item content frame, which is in the same coordinate space as the value of
The item contents to display when dragging. Typically this is an
NSImage, but a
CGImagewill also work.
Alternate single image component setter.
This convenience method simplifies modifying the components of an
NSDragging when there is only one component. It sets the
dragging and creates a single
NSDragging instance with one image corresponding to the
icon key. You should use this method only under the following conditions: the drag image for this item is composed of a single image, or there are a reasonable number of dragging item instances being created or enumerated.
If your application requires the dragging of hundreds of items this method would create a instance for each item when it is called. Compare this to the
image block which is much faster to define and allows AppKit to create only a subset of the items using