Skip to content

Instantly share code, notes, and snippets.

@barrault01
Created January 17, 2017 11:45
Show Gist options
  • Save barrault01/74e021adba9ec47d55be95dbd4ba437d to your computer and use it in GitHub Desktop.
Save barrault01/74e021adba9ec47d55be95dbd4ba437d to your computer and use it in GitHub Desktop.
struct Env {
private static let production : Bool = {
#if DEBUG
print("DEBUG")
let dic = ProcessInfo.processInfo.environment
if let forceProduction = dic["forceProduction"] , forceProduction == "true" {
return true
}
return false
#elseif ADHOC
print("ADHOC")
return false
#else
print("PRODUCTION")
return true
#endif
}()
static func isProduction () -> Bool {
return self.production
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment