在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
enum methodType{ case get case post case put case delete }
枚举赋值 enum methodType:String{ case get="get" case post="post" case put="put" case delete="delete" }
let type:methodType = .get let type2 = methodType.post let type3 = methodType(rawValue: "put")// 返回一个可选类型 值/nil let str=type3?.rawValue//打印字符串 "put"
print(type)
//省略写法 enum Direction:Int{ case east=0,west,north,south } print(Direction.north) |
请发表评论