Is there a notification type for the NSNotificationCenter thats allows you to be notified of any touches on the screen in any class? Or is there another way to solve this?
Asked
Active
Viewed 1,176 times
1 Answers
1
You could subclass UIWindow and override -sendEvent: such that it posts a notification or does some other processing on touch events before dispatching them to the appropriate view. (Call super's implementation of -sendEvent: to do dispatch the event.)
I'd avoid notifications for this purpose if you can, or at least be very careful to limit the number of objects listening to such a notification. Dragging a finger across the screen can generate a large number of events. Since any number of objects can subscribe to a notification, you could easily create a situation where the app gets bogged down in sending notifications.

Caleb
- 124,013
- 19
- 183
- 272