views:

39

answers:

1

My objective is to detect any touch event inside My Application on any view... (i.e Inside my application any touch event in anywhere should be detected...) I have tried it by subclassing my appDelegate Class with UIApplication but it is giving me error

http://stackoverflow.com/questions/3101345/how-to-detect-idle-user-in-iphone-sdk

how to resolve that error Or implement it in any other way...

Please Help

Thanks

A: 

OK, I've answered that linked question. However you may want to consider a different approach, which is using class_replaceMethod() to "swizzle" the UIView touch methods with your own implementation.

Graham Lee
but doesn't i need to do this for each view...?
mihirpmehta
@mihirpmehta no, do it once for the UIView class.
Graham Lee
Hi Graham... Thanks but i have TabBar controller in main window and 5 viewController for 5 tabs... I am not sure where to use class_replaceMethod() out of them...
mihirpmehta
@mihirpmehta _on UIView_.
Graham Lee