diff --git a/Classes/CustomBadge.m b/Classes/CustomBadge.m index 8e0bb55..adfcbb3 100644 --- a/Classes/CustomBadge.m +++ b/Classes/CustomBadge.m @@ -238,6 +238,16 @@ - (void)drawRect:(CGRect)rect { } +// Allow clicks on the badge passthrough to the object below. This is useful when attaching to a button +// see: http://stackoverflow.com/a/4010809 +-(BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event { + for (UIView *view in self.subviews) { + if ([view pointInside:[self convertPoint:point toView:view] withEvent:event]) + return YES; + } + return NO; +} + - (void)dealloc { [badgeText release];