我正在创建一个UIView动画:
UIView.animateWithDuration(0.1,
delay: 0,
options: (.AllowUserInteraction | .Repeat | .Autoreverse),
animations:
{ () -> Void in
// Animate
},
completion: nil)
Run Code Online (Sandbox Code Playgroud)
但编译器说"无法找到成员"自动反转"",或者最后是哪个位掩码,除非有一个选项.Swift 2中的语法是否已更改?我在Swift文档中看不到任何内容,也不记得WWDC演示中的任何内容.
或者它可能只是一个错误?
提前致谢
Ada*_*ter 14
答案在这里找到:
Swift 2.0 - 二进制运算符"|" 不能应用于两个UIUserNotificationType操作数
"在Swift 2中,语法已经更新......"
缩短它,而不是
.Type | .Another | .Third
Run Code Online (Sandbox Code Playgroud)
使用
[.Type, .Another, .Third]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1517 次 |
| 最近记录: |