Swift 使用未解析的标识符“OrientationArwValue”

Swift 使用未解析的标识符“OrientationArwValue”,swift,Swift,斯威夫特一直给我上面键入的错误。这是代码 static func rotate(orientation:Orientation, clockwise: Bool) -> Orientation { var rotated = orientatiorawValue() + (clockwise ? 1 : -1) if rotated > Orientation.TwoSeventy.toRaw() { rotated = Orientation.Zer

斯威夫特一直给我上面键入的错误。这是代码

static func rotate(orientation:Orientation, clockwise: Bool) -> Orientation {
    var rotated = orientatiorawValue() + (clockwise ? 1 : -1)
    if rotated > Orientation.TwoSeventy.toRaw() {
        rotated = Orientation.Zero.toRaw()
    } else if rotated < 0 {
        rotated = Orientation.TwoSeventy.toRaw()
    }
    return Orientation.fromRaw(rotated)!
}

请非常具体。提前感谢:。

看起来您已经从Swift 1.0语法过渡到1.1语法了一半。无论您在哪里拥有.toRaw,您都需要切换到.rawValue,然后再修复这一行:

var rotated = orientation.rawValue + (clockwise ? 1 : -1)
最后,您的报税表需要:

return Orientation(rawValue: rotated)!

我认为你需要补充一些更具体的信息,以便有人能回答你的问题。