Ios 使用UIView.animateWithDuration进行简单的快速淡入?

Ios 使用UIView.animateWithDuration进行简单的快速淡入?,ios,animation,uiview,swift,Ios,Animation,Uiview,Swift,我每隔一秒钟就换一次图像。用定时器改变它的代码应该有动画。行self.finalDotImageView.image=self.openingscreendynamicsdot 就是那个真正改变它的人 所以,我这样做了,图像仍然像以前一样出现: 我怎样才能使它成为动画 不能直接为UIImageView的图像属性设置动画。有一个可行的解决方案。可能与@PartiallyFinite重复此代码给我错误:UIImage无法转换为UIView。我的代码是:`UIView.transitionWithVi

我每隔一秒钟就换一次图像。用定时器改变它的代码应该有动画。行self.finalDotImageView.image=self.openingscreendynamicsdot 就是那个真正改变它的人

所以,我这样做了,图像仍然像以前一样出现:

我怎样才能使它成为动画


不能直接为UIImageView的图像属性设置动画。有一个可行的解决方案。可能与@PartiallyFinite重复此代码给我错误:UIImage无法转换为UIView。我的代码是:`UIView.transitionWithViewself.OpeningScreendDynamicDot,持续时间:5.0,选项:UIViewAnimationOptions.CurveEaseIn,动画:{self.finalDotImageView.image=self.OpeningScreendDynamicDot},完成:nil`在哪一行出现错误?OpeningScreendDynamicDot在哪里声明?
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
      })
}