---
title: "can i Pass gesture recogniser in a notification"  
description: "can i Pass gesture recogniser in a notification"  
author: "Anonymous User"  
published: 2015-07-20  
updated: 2015-07-20  
canonical: https://www.mindstick.com/forum/23353/can-i-pass-gesture-recogniser-in-a-notification  
category: "iphone"  
tags: ["iphone", "ios", "objective c"]  
reading_time: 1 minute  

---

# can i Pass gesture recogniser in a notification

I am sending a [notification](https://www.mindstick.com/blog/205/property-notification-in-c-sharp) from one [class](https://www.mindstick.com/blog/165/generic-class-in-c-sharp) to another to call a [method](https://www.mindstick.com/forum/166/webservice-method) using

```
[[NSNotificationCenter defaultCenter]  postNotification:[NSNotification notificationWithName:@"gestureIsOn"  object: self ]];
```

WhatI want to achieve here is to receive the notification in another class but also passing the UIGestureRecognizer to find which [view](https://yourviews.mindstick.com/view/84701/layoffs-in-google-india-2023-view) it is, as the class receiving the notification contains 4 different views. I [already](https://yourviews.mindstick.com/view/88453/the-hidden-ways-ai-is-already-controlling-your-daily-life) tried to implement the receiving of the notification like this:

```
[[NSNotificationCenter defaultCenter] addObserver:self                                                                     selector:@selector(handleGestures::) name:@"gestureIsOn"                                                                     object:nil ];
```

and call the method handleGestures:

```
-(void)handleGestures:(UIGestureRecognizer *)sender :(NSNotification *)notification {             if(sender.view == view1)                do something}
```

Tried to use double :: in my [observer](https://www.mindstick.com/interview/2016/how-are-observer-and-observable-used) notification but this causing an [error](https://yourviews.mindstick.com/view/88527/fixing-quickbooks-error-4120-reinstalling-vs-repairing) of Terminating app due to uncaught [exception](https://www.mindstick.com/articles/1824/objective-c-exception-handling) 'NSInvalidArgumentException'

Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams) to everyone that spend time [reading](https://www.mindstick.com/articles/126273/books-commonly-found-on-college-reading-lists) this.

## Replies

### Reply by Tarun Kumar

You could send it like this:

```
[[NSNotificationCenter defaultCenter] postNotificationName:@"gestureIsOn"                                                  object:self                                                  userInfo:@{@"recognizer":recognizer}];
```

And on the receiving side:

```
UIGestureRecognizer *recognizer = notification.userInfo[@"recognizer"];
```


---

Original Source: https://www.mindstick.com/forum/23353/can-i-pass-gesture-recogniser-in-a-notification

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
