我在Xcode 7中使用Swift 2.0 根据指南,我为自定义错误类型定义了一个枚举:
enum MyCustomError: ErrorType {
case Error1(retries: Int)
case Error2
case Error3(message: NSString)
}
但我收到以下错误:
Raw type 'ErrorType' is not convertible from any literal
Type 'MyCustomError' does not conform to protocol 'RawRepresentable'
我该如何解决这个问题? 提前谢谢。