我正在尝试实现这样的字符串数组枚举
import UIKit
enum EstimateItemStatus: Int, [String] {
case Pending
case OnHold
case Done
var description: [String] {
switch self {
case .Pending:
return ["one", "Two"]
case .OnHold:
return ["one", "Two"]
case .Done:
return ["one", "Two"]
}
}
}
print(EstimateItemStatus.Pending.description)
但我收到了这个错误:
error: processArray.playground:3:31: error: multiple enum raw types 'Int' and '[String]'
enum EstimateItemStatus: Int, [String] {
~~~ ^
你们中的任何人都知道如何修复此错误以使枚举工作?
我会非常感谢你的帮助。