HI . i am trying to move an UIImageView
object with UITouch
and have problem with the code how can i implement UITouch to detect only my UIImageView object ?
**imageA it my UIImageView
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *toucheA = [[event allTouches] anyObject];
if ([toucheA view] == imageA) {
CGPoint location = [toucheA locationInView:self];
imageA.center = location;
}
}
- (void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
[self touchesBegan:touches withEvent:event];
CGPoint postion = imageA.center;
imageA.center = postion;
postion.y = 230;
imageA.center = postion;
}
but doesn't work !