i’m using this code below to drag an image across the screen. The one thing i like to change is the location of the image. Right now, the location changes to every touch so everytime i try to move it, it translate to my finger. How do i make it so it can move relative to my finger? e.g. if the image is in the middle of the screen, and i put my finger at the bottom right of the screen, the image don’t get translate to my finger. Hope that makes sense. Thanks in advance.
// get touch event
UITouch *touch = [[event allTouches] anyObject];
// get the touch location
CGPoint touchLocation = [touch locationInView:touch.view];
// move the image view
image.center = touchLocation;
uiimage-detecting-touch-and-dragging
this may help..!!