// 原始型是整型
enum Method:Int {
case Add
case Sub
case Mul
case Div
}
print("--------------->")
// 这个还是枚举值
print(Method.Mul)
// print(Method.Add.toRaw())
print("--------------->")
print(Method.Mul.rawValue)
print(Method.Mul.hashValue)
enum Method2:String {
case Add = "addStr"
case Sub = "subStr"
case Mul = "mulStr"
case Div = "divStr"
}
print(Method2.Div.rawValue)
原文链接:https://www.f2er.com/swift/322441.html