Skip to content

Instantly share code, notes, and snippets.

@MattFoley
Created April 18, 2016 22:13
Show Gist options
  • Save MattFoley/46519178115c4a30864f3796d4f87152 to your computer and use it in GitHub Desktop.
Save MattFoley/46519178115c4a30864f3796d4f87152 to your computer and use it in GitHub Desktop.
React Native Crashing Function
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
__block UIView *hitView;
[_stickyHeaderIndices enumerateIndexesWithOptions:0 usingBlock:^(NSUInteger idx, BOOL *stop) {
UIView *stickyHeader = [self contentView].reactSubviews[idx];
CGPoint convertedPoint = [stickyHeader convertPoint:point fromView:self];
hitView = [stickyHeader hitTest:convertedPoint withEvent:event];
*stop = (hitView != nil);
}];
return hitView ?: [super hitTest:point withEvent:event];
}
@MattFoley
Copy link
Author

Line 6 can throw an exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment