Capturing touches on a subview outside the frame of its superview using hitTest:withEvent:

I have modified the accepted answer’s code to be more generic – it handles the cases where the view does clip subviews to its bounds, may be hidden, and more importantly : if the subviews are complex view hierarchies, the correct subview will be returned. – (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { if (self.clipsToBounds) { return … Read more