Skip to content

Instantly share code, notes, and snippets.

@yarneo
Created January 3, 2019 21:49
Show Gist options
  • Save yarneo/065d06dfbd011e6167125c1646742c5c to your computer and use it in GitHub Desktop.
Save yarneo/065d06dfbd011e6167125c1646742c5c to your computer and use it in GitHub Desktop.
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
if (self.layer.shapeGenerator) {
if (CGPathContainsPoint(self.layer.shapeLayer.path, nil, point, true)) {
return self;
} else {
return nil;
}
}
return [super hitTest:point withEvent:event];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment