Ahsan
Ahsan

Reputation: 2982

problem with swip gesture recognizers in iOS

I am using the following code :

UISwipeGestureRecognizer *swipeRecognizer = 
   [[UISwipeGestureRecognizer alloc]
   initWithTarget:self 
   action:@selector(swipeDetected:)];
swipeRecognizer.direction = UISwipeGestureRecognizerDirectionRight;
[self.view addGestureRecognizer:swipeRecognizer];
[swipeRecognizer release];

And,

- (void)swipeDetected:(UIGestureRecognizer *)sender {
NSLog(@"Right Swipe");
}

But I dont see any output when I swipe in the simulator. Can anyone please help me out ? Thanks.

Upvotes: 1

Views: 652

Answers (1)

PengOne
PengOne

Reputation: 48398

Since you have a UITableView, it may be blocking the action. Try adding the swipeGesture directly to the tableView.

Upvotes: 1

Related Questions