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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:50:00+00:00 2026-06-18T08:50:00+00:00

I am using UISwipeGestureRecognizer to get swipe gesture in iPhone. i want to get

  • 0

I am using UISwipeGestureRecognizer to get swipe gesture in iPhone. i want to get 2 location points on Began of swipe touch and on end of swipe touch. i have implemented swipe touch method as below

- (void)handleSwipeFrom:(UISwipeGestureRecognizer *)recognizer {

    CGPoint touchLocation = [recognizer locationInView:recognizer.view];
    touchLocation = [[CCDirector sharedDirector] convertToGL:touchLocation];
    touchLocation = [self convertToNodeSpace:touchLocation];

    CCLOG(@"Hello %@ - %d",NSStringFromCGPoint(touchLocation),recognizer.state);

    if (recognizer.state == UIGestureRecognizerStateBegan) {

        CGPoint touchLocation = [recognizer locationInView:recognizer.view];
        touchLocation = [[CCDirector sharedDirector] convertToGL:touchLocation];
        touchLocation = [self convertToNodeSpace:touchLocation];

        CCLOG(@"UIGestureRecognizerStateBegan %@",NSStringFromCGPoint(touchLocation));

    } else if (recognizer.state == UIGestureRecognizerStateChanged) {    

        CCLOG(@"UIGestureRecognizerStateChanged");

    } else if (recognizer.state == UIGestureRecognizerStateEnded) {
        CGPoint touchLocationEnd = [recognizer locationInView:recognizer.view];
        touchLocationEnd = [[CCDirector sharedDirector] convertToGL:touchLocationEnd];
        touchLocationEnd = [self convertToNodeSpace:touchLocationEnd];
        CCLOG(@"UIGestureRecognizerStateEnded %@",NSStringFromCGPoint(touchLocationEnd));
        }        

    //}
}

My swipe touch is working. but it only shows UIGestureRecognizerStateEnded. even when i swipe on screen and my touch is not ended yet but the StateEnded is called. how can i call StateBegin and get location and then StateEnd. right now just StateEnded is working other two Begin and Changing are not working.

  • 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-18T08:50:01+00:00Added an answer on June 18, 2026 at 8:50 am

    Update:
    I find the reason:

    A swipe is a discrete gesture, and thus the associated action message
    is sent only once per gesture.

    And this image:
    enter image description here

    So there are only three states for UISwipeGestureRecognizer:possible, recognized and ended. But I still don’t know why possible is not called.


    I tried your code and get the same result. I also don’t know why this happen. If you can’t find solution for this problem I suggest you use the for touch methods to analysis the touch yourself. This can surely handle the event but a little complicated than use gesture recognizer.

    - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
    - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
    - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
    - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this gesture swipe method that I want to call from another method
It is said that a Swipe Gesture UISwipeGestureRecognizer cannot tell the ending location of
Using Location.getBearing(); I seem to get randomly changing bearings. Aka, I can turn the
Hi all i have a problem with UISwipeGestureRecognizer to web view i am using
Using batch script, I want to get a first token of a line delimited
I need to catch two different swipping gestures using UISwipeGestureRecognizer (for example, UISwipeGestureRecognizerDirectionRight and
Using a populated Table Type as the source for a TSQL-Merge. I want to
Using the Redis info command, I am able to get all the stats of
Using RestKit 0.10.1, I have objects served similar to this json format: {objects: [
I'm using UISwipeGestureRecognizer successfully to capture and action when gestures on the screen are

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.