Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8820585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:38:44+00:00 2026-06-14T05:38:44+00:00

Hello I have 2 UIImageViews in UIView . Once I touch on UIImageView touchesBegan

  • 0

Hello I have 2 UIImageViews in UIView.

Once I touch on UIImageView touchesBegan method gets called. But once I drag on UIImageView then touchesMoved is called. But at the same time touchesMoved for the second UIImageView is also called.

Can you please help me how i can get touchesMoved event for both the UIImageViews?

This is my code

-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    UITouch *touch = [touches anyObject];
    CGPoint currentPoint = [touch locationInView:self.view];

    if (CGRectContainsPoint(iv1.frame,currentPoint)==YES)
        NSLog(@"iv1 Begin");
    if (CGRectContainsPoint(iv2.frame,currentPoint)==YES)
        NSLog(@"iv2 Begin");
}
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
    UITouch *touch = [touches anyObject];
    CGPoint currentPoint = [touch locationInView:self.view];
    if(CGRectContainsPoint(iv1.frame,currentPoint)==YES)
        NSLog(@"iv1 Moved NO");
    if(CGRectContainsPoint(iv2.frame,currentPoint)==NO)
        NSLog(@"iv1 Moved YES");
    if(CGRectContainsPoint(iv2.frame,currentPoint)==YES)
        NSLog(@"iv2 Moved NO");
    if(CGRectContainsPoint(iv2.frame,currentPoint)==NO)
        NSLog(@"iv2 Moved NO");
}

-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
    UITouch *touch = [touches anyObject];
    CGPoint currentPoint = [touch locationInView:self.view];

    if (CGRectContainsPoint(iv1.frame,currentPoint)==YES)
        NSLog(@"iv1 End");
    if (CGRectContainsPoint(iv1.frame,currentPoint)==YES)
        NSLog(@"iv2 End");
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T05:38:45+00:00Added an answer on June 14, 2026 at 5:38 am

    You can use two outlets linked to two views and this is the code for reacognize the two view inside touch methods:

    -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
       UITouch *t = [touches anyObject];
       touchedView = t.view;
       if (t.view == view1) {
    
        //todo something with view1;
    
       } else if (t.view == view2) {
    
          //todo something with view2
    
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I have next function, what always return null as result, but service calling
hello i have just start using Raphael but i'm very confused in the following
Hello i have a big problem .. I'm creating a user login site but
Hello i have a login script and a register script but im storing the
Hello I have a form like below: <form method=post action=> <fieldset><legend>Products List</legend> <ul> <li><input
Hello i have a uiscrollview and i have one object of uiimageview inside the
Hello have to start a new Activity from the BroascastReceiver or the Service, but
Hello I have a view that deletes order numbers. Once a string has been
Hello I have like this 2 tables class User public int UserId{get;set;} { ....
Hello i have 2 arrays and and i want to put them in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.