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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:30:04+00:00 2026-05-31T06:30:04+00:00

Does anyone have any idea why Apple designed UIGestureRecognizer the way that default state

  • 0

Does anyone have any idea why Apple designed UIGestureRecognizer the way that default state is “possible” (The gesture recognizer has not yet recognized its gesture, but may be evaluating touch events. This is the default state.) rather then something like “idle”?

The “idle” state in my opinion would make more sense and meaning by eliminating “but may be evaluating touch events” part. “Idle” — when UIGestureRecognizer hasn’t received any touches and doesn’t perform any analysis (touches, timers..). As soon as it receives first touch it changes it’s state to “possible”, indicating that it performs some sort of analysis (recognition logic).


*Context:
I’m writing similar architecture for another platform. So this state would help to separate gesture recognizers which are actually doing something from those which haven’t received any touches or just ignored them (for implementing requireGestureRecognizerToFail method).

  • 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-05-31T06:30:06+00:00Added an answer on May 31, 2026 at 6:30 am

    We must think in terms of finite state machines. My college automata text: Automata and Computability by Dexter Kozen.

    Gesture recognizers are a set of states, including possible (P), cancelled (C), and ended (E). P is the start state, C and E are final states. Between P on one end and C and E on the other, there is a series of states, let’s call them the family S*. And there are transitions, triggered by touch events and timer events, between all of the various states. The particular arrangement of P, the S*, C, E, and the transitions between them all, are what give a particular gesture recognizer its functionality.

    For example, let’s say we want a single-touch recognizer to call a method if the user performs a single-touch down (1td), then single-touch up (1tu) within .5 seconds. And otherwise we want it to cancel. So we get the following machine:

    (P,1td) -> S
    (S,1tu) -> E
    (S,.5s) -> C
    

    Spelled out:

    When in state `possible`, upon receipt of a single touch-down event, transition to state `S`.
    When in state `S`, upon receipt of a single touch-up event, transition to state `ended`.
    

    It is when we get to the state ended that the gesture recognizer executes our callback. So those two alone would be fine, except that there’s a time requirement – the user must release his touch within .5 seconds of the touch-down, or else the gesture is not truly a single touch. So we have a 3rd production:

    When in state `S`, if a .5 second timer triggers (`.5s`), then enter state `cancelled`.
    

    Also, we might have a whole bunch of other things which could happen, such as a ‘three touch-down’ (3td) event. All of these other things would immediately move the machine into the cancelled state. So we might have (among many others) this production:

    (P,3td) -> C
    

    And so on.

    Thus we can visualize a gesture recognizer as a big machine that takes as input “letters” from an alphabet of input events, accepts (ends) some set of strings in that alphabet, and rejects (cancels) the others. For those of you who don’t already know – this is the theoretic underpinning of regular expressions. That’s right – gesture recognizers are just parsers of regular expressions over an alphabet of touch and timing events. And the gestures that they recognize are just strings written in that alphabet.

    So we get to crux of the question — why not have an idle state I at the beginning, one which ‘kicks off’ the gesture recognizer into it’s possible state? The reason is that to transition from I to P requires an input event. Suddenly, the string that is the gesture being recognized becomes one letter longer — and thus the gesture recognized is not the gesture we are after, but, for example, a tap and then the gesture, or a touch-down and then a gesture.

    This changes the gesture that is recognized and thus defeats our purpose.

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

Sidebar

Related Questions

Does anyone have any idea what is wrong with this create statement for mysql?
Does anyone have any idea how to change the thickness of the text pointer
Does anyone have any idea on how can you create a product filtering query
Does anyone have any idea when Microsoft might be dropping another Silverlight 4 public
Does anyone have any idea if you can find source JARs on Maven repositories?
Does anyone have any idea what this jQuery selector will do? object.find('td:eq(1) div div');
In datasets there was a method WriteXml or ReadXml Does anyone have any idea
I need to archive data from a CRM system. Does anyone have any idea
Does anyone have any recommendations of tools that can be of assistance with moving
does anyone have any idea what to do in order to find the number

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.