I have a bug where touches to the bottom area of a textview that can only be reached by scrolling are not being recognized. Using the visual debugger, I discovered that a scrollview was blocking the bottom of the view. A number of questions on SO and some Apple docs and this excellent article here suggest when you have a view blocking one below, you need to implement some version of the following method:
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
NSLog(@"hit test firing");
UIView *hitTestView = [super hitTest:point withEvent:event];
if (hitTestView == self) {
hitTestView = nil;
}
return hitTestView;
}
-
I have gotten confused, however, on when this method fires and also what views are what. In the above code, where would I specify that scrollview is the blocking my textview? Also I get the error with the above code: No visible interface declares the selector hitTestPointWithEvent
Thanks for any suggestions. Here is image in visual debugger. Are in blue is not receiving touch (tap) events.