diff --git a/Source/UIScrollView+EmptyDataSet.m b/Source/UIScrollView+EmptyDataSet.m index 27d0a3a7..63670a53 100644 --- a/Source/UIScrollView+EmptyDataSet.m +++ b/Source/UIScrollView+EmptyDataSet.m @@ -685,6 +685,13 @@ - (void)swizzleIfPossible:(SEL)selector #pragma mark - UIGestureRecognizerDelegate Methods +// This is necessary to allow touches to pass through to any UIControl that is tapped within a custom view. Otherwise, +// the tap gesture on the DZNEmptyDataSetView gets the touch first which isn't the desired behaviour. The tap gesture +// should only get touch events if the view that was tapped is not a UIControl +- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch { + return ![touch.view isKindOfClass:[UIControl class]]; +} + - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { if ([gestureRecognizer.view isEqual:self.emptyDataSetView]) {