Intercepting all touch events [duplicate]
I have a UIViewController inside of a navigation based app. I'd like the view controller to receive all touch events from child objects, such as a tableview and navigation bar. Or, any other technique that is able to intercept all touch events.
Right now, the 开发者_如何学Pythonfollowing never executes inside of the view controller:
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
I need to check a class level flag inside of the touch event, no matter where the touch came from (within any of the view's children).
See this question for the answer: Observing pinch multi-touch gestures in a UITableView
精彩评论