views:

507

answers:

1

Without subclassing a UIResponder class(e.g. UIView) and overriding its touchesBegan:withEvent: method, is it possible to get informed of touch events of a UIResponder class?

This question was answered here.

+1  A: 

Your question is somewhat confusing...'without subclassing UIResponder...can you get informed of touch events of UIResponder?' Are you asking if you can add touchesBegan/Moved/Ended/Cancelled events to any NSObject?!? I'm not comfortable enough with the framework yet to know for sure if those methods would be called if they were implemented as a category on or subclass of NSObject?!?

But, regardless of what you're doing, the top (end) of the responder chain is UIApplication (also a subclass of UIResponder) and if you have an iPhone app then you have a singleton of UIApplication which you can query for touch events...

Meltemi
Thanks, UIApplication may help me. I want to inform one of my UIView classes when the user touches down the screen. How can I make use of UIApplication to do that?
cocoatoucher
ok. I think I need to subclass it. Thanks, your answer helped me
cocoatoucher