Skip to content

Instantly share code, notes, and snippets.

@chris-muller
Last active August 4, 2016 09:26
Show Gist options
  • Save chris-muller/dc2b33a57e8304c87d6e9eef1360f2c3 to your computer and use it in GitHub Desktop.
Save chris-muller/dc2b33a57e8304c87d6e9eef1360f2c3 to your computer and use it in GitHub Desktop.
// Nice way of getting the conciseness
// benefits of using an enum when using
// non-literal values
enum Size {
case Large
case Medium
case Small
var value: CGSize {
switch self {
case .Large:
return CGSize(width: 2, height: 60)
case .Medium:
return CGSize(width: 2, height: 60)
case .Small:
return CGSize(width: 2, height: 60)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment