Is it possible to use
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event;
in viewcontroller.m file? any tutorial pls?
In hit-testing, a window calls hitTest:withEvent: on the top-most view of the view hierarchy; this method proceeds by recursively calling pointInside:withEvent: on each view in the view hierarchy that returns YES, proceeding down the hierarchy until it finds the subview within whose bounds the touch took place.
They are separate classes: UIView is a class that represents the screen of the device of everything that is visible to the viewer, while UIViewController is a class that controls an instance of UIView, and handles all of the logic and code behind that view.
hitTest:withEvent:
method is declared in UIView class so you it can't be used in UIViewController subclasses directly.
But other touch-tracking methods such as touchesBegan:withEvent:
etc are declared in UIResponder and so can be implemented in both UIView and UIViewController subclasses
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With