stormbard
stormbard

Reputation: 56

Draggable Image View

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?

Upvotes: 0

Views: 547

Answers (1)

Master Stroke
Master Stroke

Reputation: 5128

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

3) Basic drag and drop

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 :-)

Upvotes: 1

Related Questions