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

Slices are empty in class SwiftFortuneWheel #2

Closed
brunodornelesbr opened this issue Jul 1, 2020 · 4 comments
Closed

Slices are empty in class SwiftFortuneWheel #2

brunodornelesbr opened this issue Jul 1, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@brunodornelesbr
Copy link

When using SwiftFortuneWheel without storyboard, startAnimating(finishIndex) vanishes with the wheel. I've did a little research and found out that slices are not assigned on to the SwiftFortuneWheel class, only to WheelView. When startAnimating(finishIndex) tries to calculate the sliceDegree, it tries to divide by zero, hence the bug.

I've fixed this in my code by reassigning to SwiftFortuneWheel slices variable

self.fortuneWheel = SwiftFortuneWheel(frame: frame, slices: mappedSlices, configuration: configuration)
self.fortuneWheel.slices = mappedSlices

But I think this can be easily be solved by assigning it at the init function of the SwiftFortuneWheel

@sh-khashimov
Copy link
Owner

sh-khashimov commented Jul 1, 2020

it was fixed in version 0.6.2. Can you please confirm that?

@brunodornelesbr
Copy link
Author

I'm on version 0.8.0

sh-khashimov added a commit that referenced this issue Jul 1, 2020
@sh-khashimov
Copy link
Owner

sh-khashimov commented Jul 1, 2020

Sorry, it was my stupid mistake. Thank you for reporting this.
Now It should be fixed on 0.8.1.

@brunodornelesbr
Copy link
Author

Thanks for the quick fix

@sh-khashimov sh-khashimov added the bug Something isn't working label Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants