views:

34

answers:

1

hi all

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.

+1  A: 

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

willcodejavaforfood
for single finger touch i have to do other action and if user touch with two finger i have to panning of view
priyanka
can you please describe in detail
priyanka
do you understand the difference between tapCount and the number of touches?
willcodejavaforfood
yes i know the difference
priyanka
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ UITouch *touch = [touches anyObject]; CGPoint thePoint; NSLog(@"%d",[touches count]);}- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{ UITouch *touch = [touches anyObject]; CGPoint thePoint; NSLog(@"%d",[touches count]);}but both method log 1 count
priyanka