Skip to content

Instantly share code, notes, and snippets.

@rldaulton
Created September 25, 2017 14:46
Show Gist options
  • Save rldaulton/69ba7f292a631445f3dd7ea483fa9d94 to your computer and use it in GitHub Desktop.
Save rldaulton/69ba7f292a631445f3dd7ea483fa9d94 to your computer and use it in GitHub Desktop.
Project Management with Global Enums
enum Environment {
case development
case staging
case production
}
let environment: Environment = .development
switch environment {
case .development:
// set web service URL to development
// set API keys to development
print("It's for development")
case .staging:
// set web service URL to staging
// set API keys to development
print("It's for staging")
case .production:
// set web service URL to production
// set API keys to production
print("It's for production")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment