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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:26:57+00:00 2026-06-10T22:26:57+00:00

Say I am currently tracking a drag gesture. In my event handler I use

  • 0

Say I am currently tracking a drag gesture. In my event handler I use a threshold to determine when the drag results in an action. When the threshold is crossed, I want to indicate that the drag gesture has completed.

The only thing I can find in the docs is this line here:

If you change this property to NO while a gesture recognizer is
currently recognizing a gesture, the gesture recognizer transitions to
a cancelled state.

So:

if (translation.y > 100) {
    // do action
    [self doAction];

    //end recognizer
    sender.enabled = NO;
    sender.enabled = YES;
}

This works but it looks like there might be a neater way.

Does anyone know of another way to indicate that a gesture has ended programmatically? I would expect something like a method -end: that generates a final event with state UIGestureRecognizerStateEnded.

  • 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-10T22:26:59+00:00Added an answer on June 10, 2026 at 10:26 pm

    Have you defined a custom UIGestureRecognizer? If the gesture you’re recognizing is different from the standard ones defined by Apple because it has a different threshold or is otherwise not the same as a regular UIPanGestureRecognizer, then it might make sense to create your own UIGestureRecognizer. (see subclassing notes)

    If you have subclassed UIGestureRecognizer, you can simply set the state like this:

      self.state = UIGestureRecognizerStateEnded;
    

    You probably want to do this in the touchesMoved:withEvent: method. Also note:

    “Subclasses of UIGestureRecognizer must import UIGestureRecognizerSubclass.h. This header file contains a redeclaration of state that makes it read-write.”

    On the other hand, if you’re only implementing a UIGestureRecognizerDelegate, the state is read-only, and there is no way to directly set it. In that case your method of disabling/enabling might be the best you can do.

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

Sidebar

Related Questions

Say currently I have url like : http://mydomain.com/showpost.php?p=123 Now I want to make it
let's say currently there are two buffers in my vim session, and I want
let's say I have a view where I currently only use Model information from
I must say that i currently use fixtures to populate my database. In an
Currently I have a timestamp for example say, 2012-06-23 14:24:07.975 and two times -
Say I have a command line C program which is currently executing, and I
Say I have a table with a unique positive integer field. I currently have
I'm currently working in a team where we're using a subversion repository. I say
First let me explain how I currently handle validation, say, for an IPv4 address:
Say I use glRotate to translate the current view based on some arbitrary user

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.