i want to create an NSNotification for all the the touch events happening with there specific recognise types and not handling them just observing them, any ideas?
Asked
Active
Viewed 117 times
3 Answers
0
Take a look to the UIGestureRecognizerDelegate reference, it could work for you: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIGestureRecognizerDelegate_Protocol/Reference/Reference.html
0
Yes, UIGestureRecognizerDelegate will work for you. You can selectively enable touch events through the mrthod.
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
{
return (touch.view != self.itemWhichDoNotRequireTouch);
}

Xcoder
- 1,762
- 13
- 17
-
sir, touch.view is a readonly property also my question was not to interfere in responder chain of UIGestureRecogniser i don't want view not to handle a gesture but only that whenever there is a gesture i get a notification that a certain gesture event has happened. – Abhinav Singh May 03 '13 at 09:05
0
The iOS 6 Cookbook has an example of subclassing the UIWindow, and sending the events to a singleton UIView that's sat above the UIWindow. Works really well.
https://github.com/erica/iOS-6-Cookbook/tree/master/C01%20Gestures/13%20-%20TOUCHkit
Edit: this is also observational, it does not interrupt the responder chain.

user352891
- 1,181
- 1
- 8
- 14