Step by step for starter developers…

1. Create a project in xCode with name “DragAndDrop” or any else…2. Add an element “NSImageView” on main view in the MainMenu.xib

3. Add files NSCImageView.m/NSCImageView.h to project with subclass of UIView

4. Replace “NSImageView” name class on “NSCImageView” in the NSImageView objec

5.  Change subclass “NSView” to “NSImageView”

6. Remove all methods from *.m file

7. Methods for getting entering and exit of dragging

8. Method for checking information of dragging result

Source of NSCImageView.m

Note: If you make drag and drop with NSView and any other object, you will need add this code:

1
2
[self registerForDraggedTypes:[NSArray arrayWithObjects:NSTIFFPboardType,
                                           NSFilenamesPboardType, nil]];

Result: