无限的CABasicAnimation 在页面消失后再返回后被暂停

https://stackoverflow.com/questions/13501133/infinite-cabasicanimation-stops

Actually there is a simple way to solve this
setting your animation to this

animation.removedOnCompletion = false

and the layer itself isn’t destroyed when NavigationController pushed another ViewController’s view, because UINavigationController got viewControllers property which will retain the original viewController and therefore its view and your animated layer. It is this CABasicAnimation object destroyed when view removed from interface even though you set its repeatCount to infinite. So set the removedOnCompletion to false to keep it

发表评论

电子邮件地址不会被公开。