【问题标题】:Swift 2/Xcode 7 beta - multiple bitmasks produce errorSwift 2/Xcode 7 beta - 多个位掩码产生错误
【发布时间】:2015-06-14 22:03:56
【问题描述】:

我正在创建一个 UIView 动画:

UIView.animateWithDuration(0.1,
    delay: 0,
    options: (.AllowUserInteraction | .Repeat | .Autoreverse),
    animations:
        { () -> Void in

            // Animate

    },
    completion: nil)

但是编译器说“找不到成员“Autoreverse””,或者最后的任何位掩码,除非有一个选项。 Swift 2 中的语法有变化吗?我看不到 Swift 文档中的任何内容,也记不起 WWDC 演示文稿中的任何内容。

或者它可能只是一个错误?

提前致谢

【问题讨论】:

    标签: ios swift2 xcode7


    【解决方案1】:

    在这里找到答案:

    Swift 2.0 - Binary Operator "|" cannot be applied to two UIUserNotificationType operands

    “在 Swift 2 中,语法已经更新..”

    简而言之,而不是

    .Type | .Another | .Third
    

    使用

    [.Type, .Another, .Third]
    

    【讨论】:

      猜你喜欢
      • 2015-11-05
      • 2014-10-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-16
      • 1970-01-01
      • 2015-10-17
      • 2015-08-25
      相关资源
      最近更新 更多