Try to move UIImageView in screen with touchesMoved <p>I try to move 2 UIImageView.</p> <p>Only one picture is supposed to move when I drag.</p> <p>What I trying to accomplish is move UIImageView when I touch and drag the UIImageView.</p> <p>This Is my viewDidLoad :</p> <pre><code>-(void)viewDidLoad { [super viewDidLoad]; myImageView = [[UIImageView alloc]initWithFrame:CGRectMake(100, 100, 200, 100)]; [myImageView setImage:[UIImage imageNamed:@"image1.png"]]; [self.view addSubview:myImageView]; myImageView1 = [[UIImageView alloc]initWithFrame:CGRectMake(100, 200, 200,100)]; [myImageView1 setImage:[UIImage imageNamed:@"image2"]]; [self.view addSubview:myImageView1]; } </code></pre> <p>This Is my touchesMoved method :</p> <pre><code> - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { // get touch event UITouch *touch = [[event allTouches] anyObject]; CGPoint touchLocation = [touch locationInView:self.view]; for (UIImageView *image in [self.view subviews]) { if ([touch view] == image) { // move the image view image.center = touchLocation; } } } </code></pre> <p>In this line I don't get the images view </p> <pre><code>for (UIImageView *image in [self.view subviews]) </code></pre> <p>It is possible to get the current touched UIIamgeView ?</p>