Swift 3 enum
Simple Example
enum Lecture { case English case Math case Science } let lec : Lecture = Lecture.English print(lec) switch(lec) { case Lecture.English: print("English") break case Lecture.Math: print("Math") break case Lecture.Science: print("Science") break }
Example2
Have argument
enum Test { case Math(Int) case Science(Int) case English(Int) } let test1 = Test.Math(1)
Example3
enum BarCode { case JANCode(Int,Int,Int) case QRCode(String) }