Created
June 18, 2018 20:12
-
-
Save novinfard/959d46c0a5fae650c2face6d94682ab8 to your computer and use it in GitHub Desktop.
[Simple enumerations in Swift]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
enum TestPhases { | |
case Beta | |
case Alpha | |
case Stable | |
} | |
enum TestPhasesNew: String { | |
case Beta = "Beta :)" | |
case Alpha = "Alpha ;)" | |
case Stable = "Stable :D" | |
} | |
enum TestPhasesInt: Int { | |
case Beta | |
case Alpha | |
case Stable | |
} | |
TestPhasesInt.Beta.rawValue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment