-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
NSLog(@" touches ");
}
The above method is not calling in my apps. My application description is as under.
I have a MainViewController
which loads a ContentViewController
in it. ContentViewController
has a webview which loads a pdf file.
How to listen the tap of MainViewController's
View.
Regards.
Best Answer
I may be not 100% accurate here, but if you place
-touchesBegan:withEvent:
in your view controller (or its main view) then you will get only those touches that have not been handled by some subviews in the view hierarchy. To intercept all touches you should use UIView subclass for your controller view and overridehitTest:withEvent:
method in it:For more information see Event delivery section in "Event handling guide" for iOS