Search code examples
iphoneiphone-sdk-3.2panning

how to implement two fingers panning like safari broswer?


i try to implement panning and zooming functionality like safari browser in ipad.

i used UIPinchGestureRecognizer for zooming with two fingers touch. but i dont know how to implement two fingers panning.

when i touch with two fingers its tap count is 1.

please help.

thanks in advance.


Solution

  • You don't want the tapCount, you want the number of touches. If you touch down with two fingers you can two touch events each with a tap count of 1.

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

    [touches count] would return 2, one for each finger tip.

    Read through the apple guide for touch events