I'm trying to create a scrollview with paging that is smaller than the screen size to snap between the buttons in my scrollview. After much headache and searching I found a solution to create the custom paging size explained below. The problem is the buttons inside my scrollview aren't clickable because the hitTest is overriding it?
This answer solves half the problem https://stackoverflow.com/a/6948934/12264367 ... the code works to create the snapping effect but my buttons aren't clickable I'm guessing because the hitTest but I'm not sure how to fix that?
-(UIView *) hitTest:(CGPoint) point withEvent:(UIEvent *)event
{
UIView* child = [super hitTest:point withEvent:event];
if (child == self && self.subviews.count > 0)
{
return self.subviews[0];
}
return child;
}