tags:

views:

31

answers:

0

Hi All

i have added Swipe Gesture Recognizer(left and right ) on main view. it is working fine in simulator but when running in device no swipe is happening

simulator version 4.2

device version 3.2

here is my code

 UISwipeGestureRecognizer *gestureRecRight=[[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(RightSwipe:)];

gestureRecRight.numberOfTouchesRequired= 1; gestureRecRight.direction =UISwipeGestureRecognizerDirectionRight; [self.view addGestureRecognizer:gestureRecRight]; [gestureRecRight release];

UISwipeGestureRecognizer *gestureRecLeft=[[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(LeftSwipe:)]; gestureRecLeft.numberOfTouchesRequired=1; gestureRecLeft.direction=UISwipeGestureRecognizerDirectionLeft; [self.view addGestureRecognizer:gestureRecLeft]; [gestureRecLeft release];

//handle events method -(void)RightSwipe:(id)sender{

[HBCommonMethod pushOrPopScreenInNavController:self.navigationController TabBarInfo:self.tabBarController inCurrentCon:self ForScreenId:@"919"];

}

-(void)LeftSwipe:(id)sender{ [HBCommonMethod pushOrPopScreenInNavController:self.navigationController TabBarInfo:self.tabBarController inCurrentCon:self ForScreenId:@"921"];

}

enter code here

any suggestion ??