//1.枚举类型
enum MethodType :String{case get = "get"case post = "post"case put = "put"case delete = "delete"
}//2.创建枚举
let type1 : MethodType = .get
let type2 = MethodType.post
let type3 = MethodType(rawValue: "put")//put
let strsde = type3?.rawValuelet btn = UIButton()
btn.setTitle("test", for: .normal)//3.给枚举类型进行赋值
enum Direction : Int{case east = 0case west = 1case north = 2case south = 3
}let d:Direction = .east//east
let d2 = Direction(rawValue:1) //west//4. 枚举类型定义方式二enum type : Int{case east = 0 ,west ,north, south
}