Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIPanGestureRecognizer causes index out of bounds crash #327

Closed
steprescott opened this issue Aug 28, 2015 · 3 comments
Closed

UIPanGestureRecognizer causes index out of bounds crash #327

steprescott opened this issue Aug 28, 2015 · 3 comments
Labels

Comments

@steprescott
Copy link

A tester has came back to me saying that when they stress test the double tap gesture of a chart it causes a crash.

I have been able to reproduce this issue and when it crashes the below exception is logged.

*** Terminating app due to uncaught exception 'NSRangeException', reason: '-[UIPanGestureRecognizer locationOfTouch:inView:]: index (0) beyond bounds (0).'

From looking at your Classes I can see that only the BarLineChartViewBase has a UIPanGestureRecognizer.

A potential fix to avoid this crash is to check for the number of touches before processing the gesture.

I have modified the first line in the panGestureRecognized method of the BarLineChartViewBase Class to

if (recognizer.state == UIGestureRecognizerState.Began && recognizer.numberOfTouches() > 0)
@danielgindi
Copy link
Collaborator

Will work on a fix soon. Actually numberOfTouches will ALWAYS be > 0, when the state is "began", or when another finger is added. I guess this is caused in a state of CANCEL.

@danielgindi
Copy link
Collaborator

@danielgindi
Copy link
Collaborator

After further research - it seems like UIPanGestureRecognizer is indeed unstable under stress testing. Causing 0 touches when it has a minimum of 1. Could be a bug in iOS 8 or something. Anyway I'll add a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants