, UITableViewCell. hitTest:, , . , UITextField, , . , :
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
if (self.editing) {
if ([nickname pointInside:[self convertPoint:point toView:nickname] withEvent:nil])
return [nickname hitTest:[self convertPoint:point toView:nickname] withEvent:event];
return [super hitTest:point withEvent:event];
}
return [self contentView];
}
The attribute nickname, in this case, was a UITextField inside a custom UITableViewCell.
The condition around self.editing may or may not be relevant to your application. The idea here shows you how hitTest: can be used in general.
source
share