小编ica*_*ama的帖子

iOS Swift - 无法使用数组更改动画选项 [UIViewAnimationOptions]

我对arraySwift 2 中的动画选项有一些问题。我可以array像这样添加多个选项:[.Repeat, UIViewAnimationOptions.Autoreverse]这是如果我添加动画功能(第一个示例):

UIView.animateWithDuration(1, delay: 0, options: [.Repeat, UIViewAnimationOptions.Autoreverse], animations: {

    }) { (true) in

    }
Run Code Online (Sandbox Code Playgroud)

但我不能array像这样添加动画选项(第二个例子):

var animationOptions = [UIViewAnimationOptions]()
animationOptions.append(UIViewAnimationOptions.Repeat)
animationOptions.append(UIViewAnimationOptions.Autoreverse)
UIView.animateWithDuration(1, delay: 0, options: animationOptions, animations: {

    }) { (true) in

    }
Run Code Online (Sandbox Code Playgroud)

有人可以帮助我像第二个例子那样在数组中制作动画选项吗?

arrays animation ios swift swift2

3
推荐指数
1
解决办法
794
查看次数

标签 统计

animation ×1

arrays ×1

ios ×1

swift ×1

swift2 ×1