[swift-evolution] Working with enums by name
Patrick Smith
pgwsmith at gmail.com
Wed Jun 1 02:52:17 CDT 2016
I had no idea you could do this!!
> On 1 Jun 2016, at 12:32 PM, Brent Royal-Gordon via swift-evolution <swift-evolution at swift.org> wrote:
>
> Who said anything about repeating the name?
>
> Welcome to Apple Swift version 2.2 (swiftlang-703.0.18.8 clang-703.0.30). Type :help for assistance.
> 1> enum Planet: String { case mercury, venus, earth, mars, jupiter, saturn, uranus, neptune }
> 2> Planet.mercury.rawValue
> $R0: String = "mercury"
More information about the swift-evolution
mailing list