我每隔一秒就会换一次图像。使用计时器更改它的代码应具有动画。第self.finalDotImageView.image = self.openingScreenDynamicDot
行是实际更改它的行。
所以,我这样做了,图像仍像以前一样进入:
如何制作动画?
func changeDot() {
println("the images should be changing...")
var theRandomImages: UIImage[] = [dotOne, dotTwo, dotThree, dotFour, dotFive, dotSix, dotSeven, dotEight, dotNine, dotTen, dotEleven, dotTwelve, dotThirteen]
imageNumber = Int(arc4random_uniform(13))
openingScreenDynamicDot = theRandomImages[Int(imageNumber)]
UIView.animateWithDuration(1.0, animations: {
self.finalDotImageView.image = self.openingScreenDynamicDot
})
}