【发布时间】:2017-01-31 19:38:10
【问题描述】:
我在 Swift 2 中使用 array 的动画选项有一些问题。我可以像这样在 array 添加多个选项:[.Repeat, UIViewAnimationOptions.Autoreverse] 这是如果我添加动画功能(第一个示例):
UIView.animateWithDuration(1, delay: 0, options: [.Repeat, UIViewAnimationOptions.Autoreverse], animations: {
}) { (true) in
}
但我不能像这样在array 中添加动画选项(第二个示例):
var animationOptions = [UIViewAnimationOptions]()
animationOptions.append(UIViewAnimationOptions.Repeat)
animationOptions.append(UIViewAnimationOptions.Autoreverse)
UIView.animateWithDuration(1, delay: 0, options: animationOptions, animations: {
}) { (true) in
}
有人可以帮我像第二个例子那样在数组中制作动画选项吗?
【问题讨论】:
标签: ios arrays swift animation swift2