Skip to content

Instantly share code, notes, and snippets.

@pramod-kumar-ios
Created June 24, 2019 12:13
Show Gist options
  • Select an option

  • Save pramod-kumar-ios/344bd26d91d2d05467b8af1a975cfff9 to your computer and use it in GitHub Desktop.

Select an option

Save pramod-kumar-ios/344bd26d91d2d05467b8af1a975cfff9 to your computer and use it in GitHub Desktop.
import Foundation
enum Environment: String {
case production
case testing
case development
}
class PKSettingsBundleHelper {
static let shared = PKSettingsBundleHelper()
private init() {}
var currentEnvironment: Environment {
if let env = UserDefaults.standard.string(forKey: "currentEnvironment") {
return Environment(rawValue: env.lowercased()) ?? Environment.production
}
return Environment.production
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment