关于swift枚举写法

2025-03-13 04:34:00
推荐回答(1个)
回答1:

1:swift的枚举类型是一系列的值,不同于c语言中枚举类型是整数类型。每个枚举定义了个新的类型 2:switch类型匹配 2.1枚举类型和switch单个匹配 enum PlatType{ case Plane, Ship, Train, Car } var eTransport:PlatType = PlatType.Ship switch