标签:style blog io color ar sp div on log
import UIKit /* **枚举类型 */ enum direction { case North case Sourth case East case West } //不会被默认为整数类型 var d = direction.East d = .West switch d { case .North: println("North") case .West: println("West") default: println("default") } //指定类型 enum number { case one(Int)//指定为int类型的值 case two(Int) case three(Int) } var _one = number.one(1)//初始化 _one = number.two(2) switch _one { case .one: println("1") case .two: println("2") default: println("3") }
标签:style blog io color ar sp div on log
原文地址:http://www.cnblogs.com/yangyu001/p/4069096.html