You could set the tag property of UIImageView
of each one of the letters and check against them on touchesMoved.
- (void)touchesMoved:(NSSet*)touches withEvent: (UIEvent*)event{
UITouch *touch = [[event allTouches] anyObject];
CGPoint location = [touch locationInView:touch.view.superview];
switch (touch.view.tag) {
case 0:
a.center=location;
break;
case 1:
b.center=location;
break;
case 3:
c.center=location;
break;
}
}
Edit
Using @beryllium 's comment:
- (void)touchesMoved:(NSSet*)touches withEvent: (UIEvent*)event{
UITouch *touch = [[event allTouches] anyObject];
CGPoint location = [touch locationInView:touch.view.superview];
touch.view.center = location;
}
Also note that you should get the images' superview location, and not from the image itself.