The problem is, partly, because user interactions are disabled on the content view. However, enabling user interactions disables scrolling as the view captures all touches. So here is the solution. Enable user interactions in storyboard, but subclass the content view like so:
@interface LNContentView : UIView
@end
@implementation LNContentView
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
UIView* result = [super hitTest:point withEvent:event];
return result == self ? nil : result;
}
@end
This way, hit test passes only if the accepting view is not self
, the content view.
Here is my commit: https://github.com/LeoNatan/ios-newbie