I have an image that is about 14000px by 14000px. I want to put it in a view and then be able to drag that image around to change what is seen. Is there a native way to do this or a custom class that has already been written or will I have to do it myself?
-
Does NSScrollView have a setting to do this by default? From what I have seen I don't see that so I would have to override the class myself. – stormbard Jan 22 '13 at 16:20
1 Answers
For iOS
1) drag and drop image around the screen : Using UITouch To Drag An Image Around The Screen
2) Drag And Drop objects : Drag and drop objects contended in a scrollable image gallery
For Mac
I don't think there is any ready-made way is available for you with mac os.You need to implement the NSDraggingSource's – draggingSession:endedAtPoint:operation: as required by you. Unfortunately the method "-draggedImage:endedAt:operation:" got deprecated in OS X v10.7 and later. You can refer this for implementing the NSDraggingSource protocol.
draggingSession:movedToPoint: Invoked when the drag moves on the screen.
- (void)draggingSession:(NSDraggingSession *)session movedToPoint:(NSPoint)screenPoint
--session: The dragging session.
--screenPoint: The point where the drag moved to, in screen coordinates.
I hope this will be useful for you...Happy coding :-)

- 1
- 1

- 5,108
- 2
- 26
- 57
-
I will take a look at these, but I was creating a Mac OSX app not an iOS app. – stormbard Jan 22 '13 at 20:20