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 8058435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:21:30+00:00 2026-06-05T09:21:30+00:00

I would like to track the separate touch sequences from touchesBegan through touchesMoved up

  • 0

I would like to track the separate touch sequences from touchesBegan through touchesMoved up until the touchesEnded. I am getting the coordinates of single touch events, but I would like to know which touch event corresponds to which touch event sequence.

For instance, if I am moving a first finger across the screen, and then touch the screen with the second finger, and remove the first finger – I want to display the coordinates of the first finger in red color and the coordinates of second finger in blue color.

Is this possible? If yes, how do I determine which events should be “red” and which events should be “blue”?

This is my code:

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    [self handleTouches:[event allTouches]];
}
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
    [self handleTouches:[event allTouches]];
}
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
    [self handleTouches:[event allTouches]];
}
-(void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
    [self handleTouches:[event allTouches]];
}

- (BOOL)handleTouches: (NSSet*)touches {
    for (UITouch* touch in touches) {
        // ...
    }
}
  • 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-05T09:21:31+00:00Added an answer on June 5, 2026 at 9:21 am

    The touch objects are consistent through the events, so if you wanted to track a red and a blue touches, you’d declare an iVar for each, when the touches start, you assign whichever touch you want to that ivar and then, in your loop, you would check if the touch is the same as the pointer you stored.

    UITouch *red;
    UITouch *blue;
    
    -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
        for (UITouch* touch in touches) {
            if(something) red = touch;
            else blue = touch;
        }
    }
    -(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
        [self handleTouches:touches];
    }
    -(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
        for (UITouch* touch in touches) {
            if(red == touch) red = nil;
            if(blue == touch) blue = nil;
        }
    }
    -(void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
        for (UITouch* touch in touches) {
            if(red == touch) red = nil;
            if(blue == touch) blue = nil;
        }
    }
    
    - (BOOL)handleTouches: (NSSet*)touches {
        for (UITouch* touch in touches) {
            if(red == touch) //Do something
            if(blue == touch) //Do something else
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to track changing keywords on the streaming API (from a java
I would like to track how many surveys have been done by different departments
I would like to track users clicks on my website. For that purpose, I
I would like to track the path that leads to a 404 with Google
I have a xml web service which I would like to track using Google
I am making a small game in flash, I would like to track scores
I would like to add track code for each link of in my email
I have various models of which I would like to keep track and collect
I am implementing a logging function and I would like to keep track of
I would like to confirm whether I am on the right track when identifying

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.