sh-khashimov / SwiftFortuneWheel

The ultimate spinning wheel view that supports dynamic content and rich customization.
MIT License
351 stars 82 forks source link

Rotation animation could be sometimes frozzen #14

Closed GlueckskindRU closed 3 years ago

GlueckskindRU commented 3 years ago

This issue is repetible. It could happen in case if SpinningWheelAnimator.addRotationAnimation() starts before the WheelView.addWheelLayer() has been finished. In this case layerToAnimate property of animationObject is nil, so the action animationObject?.layerToAnimate?.add(transformAnim, forKey:"starRotationAnim") did nothing and there will be no animation.

GlueckskindRU commented 3 years ago

I've solved the problem by manualy making a time gap between initialization of SwiftFortuneWheel() and starting animation. A timer with interval 0.1 sec has helped me.