7.3 Swift原始值
// 原始型是整型 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) (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- sqlite C/C++ API接口介绍
- postgresql – 在触发器函数中,如何获取更新哪些字段
- 在Swift中返回struct的可变版本
- xml – 你会称它为水平还是深度?
- 解决react-native run-android 的时候报错connection time
- Friday Q&A 2015-11-06:为什么 Swift 中的 String API
- <?xml version="1.0" encoding="
- c# – Microsoft不保证Random Edition的实现在.NET版本中保
- ruby-on-rails – RSpec spec_helper访问会话变量
- ajax 上传进度条