---
title: "GestureRecognizer not working with UIScrollView in Objective-C?"  
description: "GestureRecognizer not working with UIScrollView in Objective-C?"  
author: "Anonymous User"  
published: 2016-02-20  
updated: 2016-02-22  
canonical: https://www.mindstick.com/forum/33989/gesturerecognizer-not-working-with-uiscrollview-in-objective-c  
category: "iphone"  
tags: ["iphone", "ios", "objective c"]  
reading_time: 1 minute  

---

# GestureRecognizer not working with UIScrollView in Objective-C?

I have created an app using UIScrollView and I also added a [gesture](https://yourviews.mindstick.com/view/228/female-passenger-praised-uber-drivers-gesture) recognizer but calling [method](https://www.mindstick.com/forum/166/webservice-method) in gesture recognizer is not working.this is the [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii):\

```
UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizer alloc]                                      initWithTarget:self                                      action:@selector(doubbleTapHandler:)];[self.scrollView addGestureRecognizer:doubleTap];
```

and this is the [implementation](https://www.mindstick.com/forum/33764/how-to-implementation-of-class-in-c-sharp):\
\

```
-(void)doubleTapHandler:(UITapGestureRecognizer*)recognizer{  //here I am doing some UIRelatedTasks}
```

Can any one tell me how can I [solve this issue](https://answers.mindstick.com/qa/95726/i-am-getting-we-re-working-on-setting-you-up-on-my-google-adsense-for-a-very-long-time-how-should-i-solve-this-issue)?\

## Replies

### Reply by Tarun Kumar

According to the code you are provided above, you are created tap gesture recognizer and add it to the scrollview. All the thing is correct but tell me one thing how your scrollview will find that double tap is happening on it.\
So add this line of code, this scrollview will count the number of taps if 2 tap will happened on it then it will coll the selector method ***doubleTapHandler:***\
*doubleTap .numberOfTapsRequired=2;*\
Here is your complete code:\

```
UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizer alloc]                                      initWithTarget: self                                      action:@selector(doubbleTapHandler:)];doubleTap.numberOfTapsRequired = 2;[self.scrollView addGestureRecognizer: doubleTap];
```


---

Original Source: https://www.mindstick.com/forum/33989/gesturerecognizer-not-working-with-uiscrollview-in-objective-c

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
