Skip to content

Instantly share code, notes, and snippets.

@jinSasaki
Created February 27, 2018 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jinSasaki/254344fce4214b0aa65bebaee5b6c5b1 to your computer and use it in GitHub Desktop.
Save jinSasaki/254344fce4214b0aa65bebaee5b6c5b1 to your computer and use it in GitHub Desktop.
struct Model {
enum State: Int {
case none, loaded
}
let value: Int
var state: State? { return State(rawValue: value) }
func p() {
if state == .none {
print("A")
} else {
print("B")
}
}
}
Model(value: 0).p()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment