-
Notifications
You must be signed in to change notification settings - Fork 487
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
Rotating device causing index out of range. #63
Comments
Hello @GeorgeA93 thanks for reporting the issue! Indeed, #58 hasn't been released yet. Obviously, as you suspect, the dataSource methods aren't supposed to be called if coach marks are not showing. I'll look into it. |
Thanks for your reply. For anyone interested I am using the following work around to prevent the error:
This issue won't affect most users of this library because they are probably using a switch statement instead of accessing an array by index. (Assuming they have correctly implemented a default case in their switch statement) |
Great! 👏 By the way, I've suggested a workaround in the gitter chat for #58. Both issues will be fixed by 0.5.0 which should comme out before the end of august. |
The following is my implementation of the coachMarksForIndex data source function.
As you can see I am accessing an array to determine the point of interest for each CoachMark.
This works as expected the first time you start the coachMarksController. However, during a rotation of the device (iPad Pro) the data source method fires, passing '-1' as the index. Obviously causing the index out of range exception.
Please note I am rotating the device after the coachMarksController finishes the animation; there are no coachMarks on screen.
I originally thought I was doing something wrong, however I am slightly confused as to why the data source function is firing when there are no coachMarks on screen.
I then realised that after running the coachMarkController once, I was not able to run it again. (I soon saw that you have fixed this #58 but not released it?)
Any ideas?
The text was updated successfully, but these errors were encountered: