Double tap

Discussion in 'iOS Development' started by Carbo, Jul 18, 2008.

  1. Carbo

    Carbo New Member

    Joined:
    Oct 14, 2007
    Messages:
    17
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    hello
    I started learning objective c about one week ago. Now I would like to know what the code for a double tap event is. On 2.0 you can use UITouch but on 1.1.4 this is not possible as far as I know. Does anybody know what the code for a double tap event is?
  2. TmacHot

    TmacHot Active Member

    Joined:
    Apr 24, 2008
    Messages:
    1,723
    Likes Received:
    0
    Device:
    iPod touch
  3. Carbo

    Carbo New Member

    Joined:
    Oct 14, 2007
    Messages:
    17
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    Yes, I've seen this, but I don't know what's responsible for the double tap event.
  4. hitman2992

    hitman2992 New Member

    Joined:
    Dec 10, 2007
    Messages:
    123
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    I think what you might be looking for is mouseDown event
  5. Carbo

    Carbo New Member

    Joined:
    Oct 14, 2007
    Messages:
    17
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    I know how to use a mouseDown event for a single tap but I don't know how to use it for a double tap.

    On 2.0 you can use this event (UITouch):
    Code:
    - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
    	UITouch *touch = [touches anyObject];
    	if (touch.tapCount == 2 && touch.view == self) {
    		//Stuff that should be done on double-tap
    	}
    }
    
    But I need the code for a double tap event on 1.1.4.
  6. Lazrhog

    Lazrhog New Member

    Joined:
    Nov 7, 2007
    Messages:
    614
    Likes Received:
    11
    Device:
    iPhone 3G (Black)
    using mouse up and down events you can trigger up and down timers that can simulate the detection of a double tap with the right values and a small state machine
  7. Carbo

    Carbo New Member

    Joined:
    Oct 14, 2007
    Messages:
    17
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    Can you post an example, please?

Share This Page