Skip to content

Instantly share code, notes, and snippets.

@novinfard
Created June 18, 2018 20:12
Show Gist options
  • Save novinfard/959d46c0a5fae650c2face6d94682ab8 to your computer and use it in GitHub Desktop.
Save novinfard/959d46c0a5fae650c2face6d94682ab8 to your computer and use it in GitHub Desktop.
[Simple enumerations in Swift]
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