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

  • SEARCH
  • Home
  • 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 7883147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:27:25+00:00 2026-06-03T04:27:25+00:00

I neet to capture all the main gestures. for example I want to be

  • 0

I neet to capture all the main gestures. for example I want to be able to track when the user taps once, taps twice, taps once with one finger, taps twice with two fingers, when he pinches, when he rotates the fingers, when he drags one finger when he drags two fingers.

I know how to do all this functions the problem is that I don’t want to fire two events. For example when the user pinches I don’t what the drag event to fire. Also when the user drags one finger I don’t want the tap function to fire.

this is what I have so far:

-(void)singleTap:(NSIndexPath *)event
{

}

-(void)doubleTapMethod:(id)event
{
    if(enableTap==NO){
        enableMove=YES;
        return;
    }

     NSLog(@"double tap with number of fingers = %i",TouchesCount); 
}

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{

    enableTap=YES;
    enableMove=NO;


    UITouch *touch = [[event allTouches] anyObject];
    CGPoint location = [touch locationInView:touch.view];

    TapCount = touch.tapCount;


    X=location.x;
    Y=location.y;

    NSData *data = [ @"SSSSS" dataUsingEncoding:NSUTF8StringEncoding];

    [udpSocket sendData:data toHost:IP port:Port withTimeout:-1 tag:1];


    switch (TapCount) {
        case 1:
            [self performSelector:@selector(singleTap:) withObject:nil afterDelay: delay];
            break;
        case 2:
            [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(singleTap:) object:nil];
            [self performSelector:@selector(doubleTapMethod:) withObject:nil afterDelay:delay];
            break;
        case 3:
            [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(doubleTapMethod:) object:nil];
            //[self performSelector:@selector(tripleTapMethod) withObject:nil afterDelay:delay];
            break;
        case 4:
            //[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(tripleTapMethod) object:nil];
            //[self quadrupleTap];
            break;
        default:
            break;
    }

}

-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{


    enableTap=NO;

    if(enableMove==NO)
        return;

    NSLog(@"touches moved %i",TapCount);
    UITouch *touch = [[event allTouches] anyObject];
    CGPoint location = [touch locationInView:touch.view];    

    NSData *data = [ [NSString stringWithFormat:@"%i,%i", ((int)location.x)-X,((int)location.y)-Y] dataUsingEncoding:NSUTF8StringEncoding];

    [udpSocket sendData:data toHost:IP port:Port withTimeout:-1 tag:1];


}

-(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{

    TouchesCount = touches.count;
    return;//here


    NSData *data = [ @"EEEEEE" dataUsingEncoding:NSUTF8StringEncoding];
    [udpSocket sendData:data toHost:IP port:Port withTimeout:-1 tag:1];

}

I know I am missing a lot of implementation but I don’t want to keep working on it until I am sure I am on the write path. for example maybe I should use the UITapGestureRecognizer class instead and do something like:

UITapGestureRecognizer * r = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(viewWasDoubleTapped:)];
[r setNumberOfTapsRequired:2];
[r setNumberOfTouchesRequired:2];
[[self view] addGestureRecognizer:r];
  • 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-03T04:27:26+00:00Added an answer on June 3, 2026 at 4:27 am

    Yes! You should definitely use the gesture recognizers for this purpose. There are gesture recognizer for everything you have mentioned in your original post.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't know much about grids in magento, but I neet to create one.
I neet to load >1 billion rows into empty MyISAM table. I'm sure all
I neet access to current object in a static method. Code: protected static $name;
HI, I neet to pass chunk data from WCF service to client. I have
In my web application i neet to check session already exist or not. i
To Serialize a class with protobuf-net, you neet to provide the class and property
I want to increment a url automatically using javascript and use it in Greasemonky
I have a List<string> words = new List<string> {word1, word2, word3}; And i want
I have many objects in one page which xpath is: //td[@class='bxec-day' or @class='bxec-day bxec-holiday'
I've a mongoid embedded one to many model on Rails 3.1, to full text

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.