我正在为每个案例显示不同的动画,而它似乎正在加在一起并加速。我尝试使用stopAnimating()以及removeAllAnimations()。他们都没有工作。
switch currentDrawType {
case 0:
for i in 0..<imageNames.count{
images.append(UIImage(named: imageNames[i])!)
}
self.starImage.animationImages = images
self.starImage.animationDuration = 0.5
case 1:
for a in 0..<imageA.count{
images.append(UIImage(named: imageA[a])!)
}
self.starImage.animationImages = images
self.starImage.animationDuration = 7.0
case 2:
for b in 0..<imageB.count{
images.append(UIImage(named: imageB[b])!)
}
self.starImage.animationImages = images
self.starImage.animationDuration = 0.5
default:
break
}